View Margin Positions
View your net open margin positions listed by asset. See the Guide.
-
View your net open margin positions listed by asset. Each position includes the net open position, its current USD value, short and long margin position notional limits, and unrealized profit and loss (PnL).
Prerequisites: Access token must have the
trade_viewscope. You must have the Trade role on your enterprise.
// 1. View Net Open Positions
export ACCOUNT_ID="<YOUR_ACCOUNT_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
curl -X GET \
https://app.bitgo-test.com/api/prime/trading/v1/accounts/$ACCOUNT_ID/margin/netopenpositions \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN"
// 1. View Net Open Positions
// Use the REST API for this step (see cURL tab)
Response
// 1. View Net Open Positions Response
{
"netOpenPositions": [
{
"currency": "BTC",
"enterpriseId": "63925f940c259a00061853808ffea830",
"netOpenPosition": -2.3242,
"netOpenPositionValue": -124017.22,
"shortMarginPositionNotionalLimit": {
"quantity": 1000000,
"currency": "USD"
},
"longMarginPositionNotionalLimit": {
"quantity": 1000000,
"currency": "USD"
},
"unrealizedPnL": {
"quantity": 1200,
"currency": "USD"
},
"lastModified": "2024-07-29T21:13:09.000Z"
}
]
}