Cover Short Positions
Overview
When you sell assets purchased using margin funds, you have an open short position. If you are close to your Net Open Position limit, you may want to cover some of your short positions to avoid a margin call. You can cover a short position by buying more assets in an attempt to reduce the amount owed. You can cover short positions by asset or cover all your short positions.
Prerequisites
Cover Positions
Endpoint: Cover Short Positions
1 2 3 4 5 6 7 8 9 10
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/margin/positions/cover \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -d '{ "all": true }'
Step Result
1 2 3 4 5 6 7 8 9 10 11 12
{ "balances": [ { "currency": "BTC", "quantity": 2, "balanceValue": { "quantity": "1000000", "currency": "USD" } } ] }