Skip to main content
POST
/
trading
/
quote
Request a quote
curl --request POST \
  --url https://api.anchorage-staging.com/v2/trading/quote \
  --header 'Api-Access-Key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "currency": "USD",
  "quantity": "100",
  "side": "BUY",
  "tradingPair": "BTC-USD",
  "accountId": "aaa44c42-5ad3-4108-b376-f78cd32f0543",
  "idempotentId": "01944c42-5ad3-4108-b376-f78cd6ff0393",
  "quantityRounding": true
}
'
{
  "data": {
    "offerAmount": {
      "assetType": "USD",
      "quantity": "11733.73"
    },
    "offerPrice": "11733.73",
    "quoteID": "06f71d1e-e7e8-11ea-adc1-0242ac120002",
    "quoteRequest": {
      "currency": "BTC",
      "quantity": "1",
      "side": "BUY",
      "tradingPair": "BTC-USD"
    },
    "quoteStatus": "OPEN",
    "timestamp": "2020-08-31T16:57:07.265Z",
    "validUntilTime": "2020-08-31T16:57:10.265Z"
  }
}

Authorizations

Api-Access-Key
string
header
required

An API key associated with a security role

Body

application/json

Request for quote examples

BUY quote requests:

  • I want to buy the amount of BTC equivalent to 100 USD (I buy BTC and sell USD)

    {
    "tradingPair": "BTC-USD",
    "side": "BUY",
    "quantity": "100",
    "currency": "USD"
    }
  • I want to buy 1 BTC (I buy BTC and sell USD)

    {
    "tradingPair": "BTC-USD",
    "side": "BUY",
    "quantity": "1",
    "currency": "BTC"
    }
  • I want to buy the amount of ETH equivalent to 1 BTC (I buy ETH and sell BTC)

    {
    "tradingPair": "ETH-BTC",
    "side": "BUY",
    "quantity": "1",
    "currency": "BTC"
    }

SELL quote requests:

  • I want to sell the amount of BTC equivalent to 100 USD (I sell BTC and buy USD)

    {
    "tradingPair": "BTC-USD",
    "side": "SELL",
    "quantity": "100",
    "currency": "USD"
    }
  • I want to sell 1 BTC (I sell BTC and buy USD)

    {
    "tradingPair": "BTC-USD",
    "side": "SELL",
    "quantity": "1",
    "currency": "BTC"
    }
  • I want to sell 1 ETH (I sell ETH and buy BTC)

    {
    "tradingPair": "ETH-BTC",
    "side": "SELL",
    "quantity": "1",
    "currency": "ETH"
    }

TWOWAY quote requests:

  • I want two-way quotes to buy 1 ETH and sell BTC or to sell 1 ETH and buy BTC
    {
    "tradingPair": "ETH-BTC",
    "side": "TWOWAY",
    "quantity": "1",
    "currency": "ETH"
    }
currency
string
required

Currency of quantity.

Example:

"USD"

quantity
string
required

Quantity to quote for in units of currency.

Example:

"100"

side
enum<string>
required

Side of the quote request. "BUY", "SELL", or "TWOWAY".

Available options:
BUY,
SELL,
TWOWAY
Example:

"BUY"

tradingPair
string
required

Trading pair being quoted.

Example:

"BTC-USD"

accountId
string | null

Account ID for quote, must match the accountId on accept quote.

Example:

"aaa44c42-5ad3-4108-b376-f78cd32f0543"

idempotentId
string | null

A client-provided unique ID for idempotent requests (optional). If provided a value, the same idempotentId must be also provided to accept quote.

Maximum string length: 128
Example:

"01944c42-5ad3-4108-b376-f78cd6ff0393"

quantityRounding
boolean

Optional boolean to specify if quantity should round to Anchorage Digital supported increments. If false or not specified, the request can be rejected if quantity has more precision than our published size increments. The rounding is done as a truncation of the extra fractional digits.

Response

Successfully created request for quote

data
Quote · object
required