Skip to main content
This guide walks through understanding your trading account and completing your first trade. Refer to the Hold APIs and A1 APIs sections for more detail.
This section assumes you have already created and configured your API key.
1

List trading accounts

List the trading accounts associated with your organization to get the trading account ID(s) needed for future calls.GET /v2/trading/accounts
{
  "data": [
    {
      "enabled": true,
      "id": "1a7df984-c4b4-11ef-ad6b-4e27db456598",
      "name": "Test Trading Account [TRUST]"
    }
  ]
}
2

Check balances or credit

Check the pre-funded balance using your API key and the trading account ID from the previous step.GET /v2/trading/accounts/{tradingAccountId}/balance
{
  "data": [
    {
      "balance": {
        "assetType": "USD",
        "currentPrice": "1",
        "currentUSDValue": "989793.79",
        "quantity": "989793.79"
      }
    },
    {
      "balance": {
        "assetType": "BTC",
        "currentPrice": "94404.709262226",
        "currentUSDValue": "755237.67",
        "quantity": "8"
      }
    },
    {
      "balance": {
        "assetType": "SOL",
        "currentPrice": "183.26165178161",
        "currentUSDValue": "916.31",
        "quantity": "5"
      }
    }
  ]
}
Check the credit limit for the account and any unsettled trades.GET /v2/trading/accounts/{tradingAccountId}/credit
{
  "data": {
    "limits": [
      {
        "assetType": "USD",
        "quantity": "1000000"
      }
    ],
    "usage": [
      {
        "assetType": "AAVE",
        "quantity": "50"
      },
      {
        "assetType": "USD",
        "quantity": "100770.01"
      }
    ]
  }
}
3

List trading pairs

Review available trading pairs for your organization.GET /v2/trading/pairs
{
  "data": [
    {
      "description": "Buy AAVE with USD, or Sell AAVE for USD",
      "pair": "AAVE-USD",
      "referenceData": {
        "baseAssetType": "AAVE",
        "baseSizeIncrement": "0.00000001",
        "lastUpdateTime": "2024-07-09T15:57:55.249Z",
        "minimumOrderSize": "0.000000010000000000000002",
        "priceIncrement": "0.0000001",
        "quoteAssetType": "USD",
        "quoteSizeIncrement": "0.01"
      }
    },
    {
      "description": "Buy ATOM with USD, or Sell ATOM for USD",
      "pair": "ATOM-USD",
      "referenceData": {
        "baseAssetType": "ATOM",
        "baseSizeIncrement": "0.0001",
        "lastUpdateTime": "2024-07-09T15:58:40.249Z",
        "minimumOrderSize": "1",
        "priceIncrement": "0.000001",
        "quoteAssetType": "USD",
        "quoteSizeIncrement": "0.001"
      }
    }
  ]
}
4

Request a quote

Request a quote with the following parameters:
ParameterDescriptionExample
tradingPairPair from the prior call"BTC-USD"
quantityQuantity in currency units"1"
currencyCurrency of quantity"BTC"
side"BUY", "SELL", or "TWOWAY""BUY"
idempotentIdUnique per quote to avoid duplicatesUUID
accountIdTrading account IDUUID
POST /v2/trading/quote
{
  "currency": "BTC",
  "quantity": "1",
  "side": "BUY",
  "tradingPair": "BTC-USD",
  "idempotentId": "01944c42-5ad3-4108-b376-f78cd6ff0394",
  "accountId": "fd80d8fc-d20f-11ef-ab13-d2dbc7cc735e"
}
Response:
{
  "data": {
    "offerAmount": {
      "assetType": "USD",
      "quantity": "99551.67"
    },
    "offerPrice": "99551.67",
    "quoteID": "45055f47-1d5c-4444-921c-7208c3e4178e",
    "quoteRequest": {
      "currency": "BTC",
      "quantity": "1",
      "side": "BUY",
      "tradingPair": "BTC-USD"
    },
    "quoteStatus": "OPEN",
    "timestamp": "2025-01-15T19:29:01.870Z",
    "validUntilTime": "2025-01-15T19:29:04.870Z"
  }
}
5

Accept the quote

Accept the quote to execute the trade.POST /v2/trading/quote/accept
{
  "quoteID": "45055f47-1d5c-4444-921c-7208c3e4178e",
  "side": "BUY",
  "allowedSlippage": "0.001",
  "accountId": "fd80d8fc-d20f-11ef-ab13-d2dbc7cc735e",
  "idempotentId": "01944c42-5ad3-4108-b376-f78cd6ff0394"
}
Response:
{
  "data": {
    "quoteID": "45055f47-1d5c-4444-921c-7208c3e4178e",
    "side": "BUY",
    "tradeID": "4ececdba-56c9-4cf2-ae11-9f439c351b43",
    "tradeStatus": "PENDING"
  }
}