v1

latestOpenAPI 3.0.02026-07-26117342409.6 KB
Quote Executions

Create Quote Execution

Execute on a quote for buying or selling an asset.

The side, market, and guaranteed price of the execution are specified by the quote with ID quote_id.

The amount to buy or sell must be specified in either fiat or crypto by setting exactly one of:

  • base_amount to specify the amount of crypto to buy or sell.
  • quote_amount to specify the amount of fiat to spend or acquire.

An otherwise-valid request to create a quote execution may fail with the following types of errors:

  • Expired if the quote with ID quote_id has expired.
  • Insufficient Funds if the profile with ID profile_id has insufficient available balance to fund the execution.
  • Rejected if extreme market conditions (e.g. a very large price swing) have invalidated the quote.
  • Already Exists if a Quote Execution with the same ref_id has already been created.
post/profiles/{profile_id}/quote-executions

Path parameters

profile_idstring required

The ID of the profile under which to execute this order.

Request body

quote_idstring required

The ID of the held Quote for buying or selling some asset.

ref_idstring

A unique identifier for the quote execution (for idempotence).

base_amountstring

The amount of the base asset (crypto) to buy or sell using the specified quote. The maximum precision is 8 decimals.

quote_amountstring

The amount of the quote asset (fiat) to spend or acquire using the specified quote. The maximum precision is 2 decimals.

metadataobject

Metadata to store on the quote execution. Up to 6 key/value pairs may be stored, with each key and value at most 100 characters.

identity_idstring

The end user that requests the quote execution.

account_idstring

The account under which this quote execution is placed. The provided identity must be allowed to trade on behalf of this account.

recipient_profile_idstring

The ID of the profile under which to deposit the funds.

Example request

{
  "quote_id": "366a26d2-3098-4226-a520-4bb43ae4d922",
  "quote_amount": "14102.82",
  "metadata": {
    "customer_id": "9b8c9cba-801e-4418-adc0-ede709df6339"
  }
}

Response

A successful response.

idstring required

The UUID of the quote execution.

profile_idstring required

The ID of the profile under which this order executed.

quote_idstring required

The ID of the quote used to create this quote execution.

ref_idstring

A unique identifier for the quote execution creation (for idempotence).

status'CREATED' | 'SETTLED' required

A QuoteExecution begins in state CREATED and transitions to end state SETTLED when all accounting movements are complete.

market'ETHEUR' | 'ETHSGD' | 'ETHUSD' | 'BTCEUR' | 'BTCSGD' | 'BTCUSD' | 'PAXGUSD' | 'BCHUSD' | 'LTCUSD' | 'USDPUSD' | 'LINKUSD' | 'AAVEUSD' | 'UNIUSD' | 'PEPEUSD' | 'TRUMPUSD' | 'SHIBUSD' | 'ARBUSD' | 'BONKUSD' | 'ENAUSD' | 'MNTUSD' | 'ONDOUSD' | 'PENGUUSD' | 'QNTUSD' | 'RENDERUSD' | 'SKYUSD' | 'WIFUSD' | 'WLDUSD' | 'DOGEUSD' | 'AVAXUSD' | 'SUIUSD' | 'POLUSD' | 'XLMUSD' | 'BNBUSD' required
side'BUY' | 'SELL' required

Trade side.

pricestring decimal required

The guaranteed price of the quote.

base_amountstring decimal required

The amount of assets (crypto) in the transaction.

base_assetstring required

The "base" side of the trading pair (crypto - like BTC, ETH, PAXG).

quote_amountstring decimal required

The amount of quote currency (cash) in the transaction.

quote_assetstring required

The "quote" side of the trading pair (fiat - like USD, EUR, SGD).

created_atstring date-time required

The time at which the quote execution was created.

settled_atstring date-time

The time at which the quote execution was settled, completing its lifecycle.

metadataobject

Client-specified metadata.

identity_idstring

The identity under which this quote execution is placed.

account_idstring

The account under which this quote execution is placed.

recipient_profile_idstring

The ID of the profile under which to deposit the funds.

Example response

{
  "id": "43a59965-be3a-45ab-841d-c55386e0ff90",
  "profile_id": "b7b77d82-e6a7-4ae9-9904-36231aedf985",
  "quote_id": "366a26d2-3098-4226-a520-4bb43ae4d922",
  "status": "SETTLED",
  "market": "BTCUSD",
  "side": "BUY",
  "price": "6001.2",
  "base_amount": "2.35",
  "base_asset": "BTC",
  "quote_amount": "14102.82",
  "quote_asset": "USD",
  "created_at": "2020-01-17T18:36:31.345Z",
  "settled_at": "2020-01-17T18:36:32.123Z",
  "metadata": {
    "customer_id": "9b8c9cba-801e-4418-adc0-ede709df6339"
  }
}