Crypto-as-a-Service: Place Trade Orders

Execute market, limit, stop, or TWAP trades on Go Accounts with BitGo as counterparty. See the Guide.

  1. View the latest trading pairs available for your account. The ticker symbol for testnet USD includes an asterisk (*). However, in mainnet, the ticker symbol for USD doesn't.

    API Reference

  2. Place a trade order on your Go Account. You can place market orders (immediate execution at current market value), limit orders (pending orders at a specified price), stop orders (conditional orders triggered at a specified price), TWAP orders (time-weighted average price), or steady pace orders. The example shows a market order. For stop orders, use "type": "stop" with a required triggerPrice; include limitPrice for a stop limit order.

    API Reference

// 1. List Trading Pairs (Optional)
export BITGO_EXPRESS_HOST="<YOUR_LOCAL_HOST>"
export ACCOUNT_ID="<YOUR_GO_ACCOUNT_WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
curl -X GET \
  "https://app.bitgo-test.com/api/prime/trading/v1/accounts/$ACCOUNT_ID/products" \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
// 2. Place Trade Order
export BITGO_EXPRESS_HOST="<YOUR_LOCAL_HOST>"
export ACCOUNT_ID="<YOUR_GO_ACCOUNT_WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"

curl -X POST \
  "http://$BITGO_EXPRESS_HOST/api/prime/trading/v1/accounts/$ACCOUNT_ID/orders" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "clientOrderId": "myorder1",
    "type": "market",
    "product": "TBTC-TUSD*",
    "side": "buy",
    "quantity": "10000",
    "quantityCurrency": "TUSD*"
  }'
Response
// 1. List Trading Pairs (Optional) Response
{
    "data": [
        {
            "id": "0d75f716-680b-11eb-a7a5-0a34d7f8426c",
            "name": "TXRP-TUSD*",
            "baseCurrencyId": "8a93fece-6878-4b27-88eb-a83a40af0318",
            "baseCurrency": "TXRP",
            "quoteCurrencyId": "e708df52-ba80-42cd-868c-5dab42fe6bac",
            "quoteCurrency": "TUSD*",
            "baseMinSize": "",
            "baseMaxSize": "",
            "baseIncrement": "0.000001",
            "quoteMinSize": "10",
            "quoteIncrement": "0.01",
            "quoteDisplayPrecision": 4,
            "isTradeDisabled": false,
            "isMarginTradeSupported": true
        },
        {
            "id": "016a8ac2-b75a-11ed-84ea-0a52a0835891",
            "name": "TDOGE-TUSD*",
            "baseCurrencyId": "2f124c6c-d79c-4dc0-b57d-b8c60b408a37",
            "baseCurrency": "TDOGE",
            "quoteCurrencyId": "e708df52-ba80-42cd-868c-5dab42fe6bac",
            "quoteCurrency": "TUSD*",
            "baseMinSize": "",
            "baseMaxSize": "",
            "baseIncrement": "0.0001",
            "quoteMinSize": "10",
            "quoteIncrement": "0.01",
            "quoteDisplayPrecision": 2,
            "isTradeDisabled": false,
            "isMarginTradeSupported": true
        }
    ]
}

// 2. Place Trade Order Response
{
  "id": "67fd640c-cb6c-4218-80ae-49e79ec15646",
  "accountId": "60e740e7898f7d00064d43769a73dc48",
  "clientOrderId": "myorderid1",
  "time": "2021-08-05T18:05:23.431Z",
  "creationDate": "2021-08-05T18:05:22.286Z",
  "scheduledDate": "2021-08-05T18:05:00.000Z",
  "lastFillDate": "2021-08-05T18:05:23.302Z",
  "completionDate": "2021-08-05T18:05:23.431Z",
  "settleDate": "2021-08-05T20:00:00.000Z",
  "fundingType": "funded",
  "type": "market",
  "status": "completed",
  "product": "TBTC-TUSD*",
  "side": "buy",
  "quantity": "1000",
  "quantityCurrency": "TUSD*",
  "filledQuantity": "0.02457152",
  "averagePrice": "40697.32"
}