Overview
Receive position updates including size, average entry and exit prices, margin, liquidation price, profit and loss (PnL), and more via thepositions channel.
Channel information
| Property | Value |
|---|---|
| Channel Name | positions |
| Authentication | Required |
| Update Frequency | On position changes |
| Data Type | Array of position objects |
Subscribe
{
"op": "subscribe",
"args": [ { "channel": "positions" } ]
}
Message format
{
"type": "position",
"data": [
{
"id": "pos-uuid",
"symbol": "US500-BTC",
"accountId": "acct-uuid",
"side": "long",
"entryAmount": "1.000",
"exitAmount": "0.500",
"size": "0.500",
"tradeMode": "isolated",
"openDate": 1640995200000,
"closeDate": null,
"avgEntry": "50000.00",
"avgExit": null,
"entryFees": "0.00100000",
"exitFees": null,
"positionBalance": "0.05000000",
"initialMargin": "0.05000000",
"maintenanceMargin": "0.00500000",
"liquidationPrice": "45000.00",
"leverage": "10.0",
"unrealizedPnl": "0.00100000",
"realizedPnl": "0.00200000",
"markPrice": "52500.00",
"status": "normal",
"updatedAt": 1640995200000000000,
"createdAt": 1640995200000000000
}
]
}
object
Position fields
Show Position properties
Show Position properties
string
Position identifier
string
Instrument symbol
string
Account identifier (UUID)
string
long or shortstring
Total entry amount (BTC)
string
Total exit amount (BTC)
string
Current position size (BTC)
string
e.g.
isolatedinteger
Open time in ms
integer?
Close time in ms, if closed
string
Average entry price
string?
Average exit price (if any)
string
Entry fees (BTC)
string?
Exit fees (BTC)
string
Position margin balance (BTC)
string
Initial margin (BTC)
string
Maintenance margin (BTC)
string
Liquidation price
string
Leverage
string
Unrealized PnL (BTC)
string
Realized PnL (BTC)
string
Mark price
string
normal, liquidation, or adlinteger
Update time in ns
integer
Creation time in ns