Place Margin Order

Overview

Margin orders are similar to trade orders, except the assets for margin orders withdraw from your Margin Trade Account instead of your Go Account.

You can execute all trade order types as margin trades. See Place Trade Orders for more information.

BitGo initiates a Net Open Position (NOP) check before trades execute. Trades that exceed your NOP limit don't execute. Additionally, BitGo runs margin calculations after trades successfully execute. If the trade causes your account to violate the margin limits, then you can't place further trades until your account returns to a healthy state, such as by posting more collateral.

Prerequisites

Place Trade Order

Endpoint: Place Order

  • cURL (Market)
  • cURL (Limit)
  • cURL (TWAP)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 export BITGO_EXPRESS_HOST="<YOUR_LOCALHOST>" export ACCOUNT_ID="<YOUR_ACCOUNT_ID>" export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>" curl -X POST \ https://$BITGO_EXPRESS_HOST/api/prime/trading/v1/accounts/$ACCOUNT_ID/orders \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -d '{ "clientOrderId": "myorder1", "type": "market", "product": "TBTC-TUSD*", "fundingType": "margin", "side": "buy", "quantity": "10000", "quantityCurrency": "TUSD*" }'

Step Result

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "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": "margin", "type": "market", "status": "completed", "product": "TBTC-TUSD*", "side": "buy", "quantity": "1000", "quantityCurrency": "TUSD*", "filledQuantity": "0.02457152", "averagePrice": "40697.32" }

Next

  1. Cover Short Positions
  2. Close All Positions

See Also