User Account
Get Positions
Get Started
Products
Trading Formulas
Rest API
WebSocket API
- WebSocket Connection
- Order Creation
- Order Book
- User Account
- Error Reference
User Account
Get Positions
This is the WebSocket counterpart of the REST endpoint Get Account Positions
{
"message": "positions",
"content": {
"market": "ETH-USD", // optional
}
}
{
"resultType": "positions",
"data": {
"statusCode": 200,
"positions": [
{
"market": "ETH-USD",
"value": "3772.272138",
"quantity": "1.0",
"funding": "92.49110924999998",
"realizedPnl": "0.1",
"unrealizedPnl": "-33.25166999999965",
"liquidationPrice": "3500.652918",
"type": "LONG"
},
{
"market": "BTC-USD",
"value": "65000.272138",
"quantity": "1.0",
"funding": "920.49110924999998",
"realizedPnl": "1.5",
"unrealizedPnl": "400.25166999999965",
"liquidationPrice": "61033.135417",
"type": "SHORT"
}
]
}
}
URL
Unlike other streams, this stream is market agnostic.
Headers
See Authorization section on how to retrieve authorization token. Once token is received, set Sec-WebSocket-Protocol
headers in the WebSocket handshake request or on connect()
.
Example value (authorization token) :
authorization#eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdGFnaW5nLmZ1bmdpYmxlLnh5eiIsInN1YiI6ImQxM2I1MzBmLWFmNzMtNDBmOS04ZjhlLWVkNzk1OTU3YTU3ZiIsImF1ZCI6WyJzdGFnaW5nLWFwcC5mdW5naWJsZS54eXoiXSwiZXhwIjoxNzAzMzA1NzQwLCJpYXQiOjE3MDMzMDM5NDB9.vsHe4G_yEkRfz8XNoTKcX83udA-LUysWD4q80wfCC8k
{
"message": "positions",
"content": {
"market": "ETH-USD", // optional
}
}
{
"resultType": "positions",
"data": {
"statusCode": 200,
"positions": [
{
"market": "ETH-USD",
"value": "3772.272138",
"quantity": "1.0",
"funding": "92.49110924999998",
"realizedPnl": "0.1",
"unrealizedPnl": "-33.25166999999965",
"liquidationPrice": "3500.652918",
"type": "LONG"
},
{
"market": "BTC-USD",
"value": "65000.272138",
"quantity": "1.0",
"funding": "920.49110924999998",
"realizedPnl": "1.5",
"unrealizedPnl": "400.25166999999965",
"liquidationPrice": "61033.135417",
"type": "SHORT"
}
]
}
}
{
"message": "positions",
"content": {
"market": "ETH-USD", // optional
}
}
{
"resultType": "positions",
"data": {
"statusCode": 200,
"positions": [
{
"market": "ETH-USD",
"value": "3772.272138",
"quantity": "1.0",
"funding": "92.49110924999998",
"realizedPnl": "0.1",
"unrealizedPnl": "-33.25166999999965",
"liquidationPrice": "3500.652918",
"type": "LONG"
},
{
"market": "BTC-USD",
"value": "65000.272138",
"quantity": "1.0",
"funding": "920.49110924999998",
"realizedPnl": "1.5",
"unrealizedPnl": "400.25166999999965",
"liquidationPrice": "61033.135417",
"type": "SHORT"
}
]
}
}