v1

latestOpenAPI 3.0.02026-08-04134348905.1 KB
Trading

Accept a quote

Permissions required: Execute trades

Accept a quote by its quoteID and side.

Idempotent Requests

This endpoint supports idempotent requests so that a quote cannot be accepted twice if an API call was interrupted and is retried. To send an idempotent request, include the idempotentId field in the body of the POST request.

post/trading/quote/accept

Headers

Api-Signaturestring required

A hex-encoded Ed25519 signature of timestamp_epoch_seconds + uppercase(http_method) + request_path + request_body.

Construction example:

  toHex(
    ed25519Sign(
      signing_key,
      '{}{}{}{}'.format(timestamp_epoch_seconds, toUpper(httpMethod), httpRequestPath, httpBody)
    )
  )
Api-Timestampinteger required

Current timestamp, represented as unix epoch seconds

Request body

accountIdstring required

The ID of a trading account. This field is used to specify the trading account into which assets should be settled.

allowedSlippagestring

The maximum slippage Anchorage Digital will consider when accepting this order, communicated in terms of actual value (i.e. "0.001" => 10bps). Must be greater than or equal to 0 and less than or equal to 0.002 (20bps).

In order to illustrate how this setting works, as an example, we shall consider a commission of 10bps for a quote priced at 10000, and that we are about to accept this quote with an allowedSlippage of "0.0008" (8bps). Then, considering the market has moved away from the quoted price, one of the following two scenarios will be applicable:

  1. Best market price within allowedSlippage - fill the order at the spread off the market Best Market Price: 10007 Trade Status: Executed Customer Execution Price: 10017.007

  2. Best market price outside of allowedSlippage - reject the order Best Market Price: 10009 Trade Status: Rejected

idempotentIdstring nullable

A client-provided unique ID for idempotent requests (optional). This value must match the one provided to request quote.

quoteIDstring required

ID of the quote to trade.

side'BUY' | 'SELL' required

Trade side, either "BUY" or "SELL".

vaultIDstring

Currently in BETA.

The ID of a vault. This optional field is used to specify the vault into which assets should be settled. If provided, the API key must have the following permissions: Read vault activity

Example request

{
  "accountId": "6290d9bd-494f-11ed-975e-2e567b4c0e09",
  "allowedSlippage": "0.0005",
  "idempotentId": "01944c42-5ad3-4108-b376-f78cd6ff0393",
  "side": "BUY",
  "vaultID": "1c920f4241b78a1d483a29f3c24b6c4c"
}

Response

Successfully accepted the quote

Example response

{
  "data": {
    "side": "BUY"
  }
}