Cover Short Positions

Cover short margin positions by asset or cover all short positions at once. See the Guide.

  1. Cover open short margin positions by buying more assets to reduce the amount owed. You can cover all short positions or cover by asset. If you are close to your Net Open Position limit, covering short positions can help you avoid a margin call.

    To cover positions by asset instead of all positions, replace "all": true with "currencies": ["<ASSET_ID>"] in the request body.

    Prerequisites: Access token must have the trade_trade scope. You must have the Trade role on your enterprise.

    API Reference

// 1. Cover Positions
export BITGO_EXPRESS_HOST="<YOUR_LOCAL_HOST>"
export ACCOUNT_ID="<YOUR_ACCOUNT_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
curl -X POST \
  http://$BITGO_EXPRESS_HOST/api/prime/trading/v1/accounts/$ACCOUNT_ID/margin/positions/cover \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
        "all": true
      }'
Response
// 1. Cover Positions Response
{
  "balances": [
    {
      "currency": "BTC",
      "quantity": 2,
      "balanceValue": {
        "quantity": "1000000",
        "currency": "USD"
      }
    }
  ]
}