private/get-positions
POSTReturns the user's position./private/get-positions
Request
Body
required
id int64required
Request id (echoed in response)
method stringrequired
Must be "private/get-positions"
api_key stringrequired
Your API key (only required for private REST)
sig stringrequired
HMAC-SHA256 signature in hex (only required for private REST)
nonce int64required
Current timestamp in milliseconds, e.g. "1771761038000".
params objectrequired
instrument_name string
E.g. BTCUSD-PERP. Omit for 'all'.
Success.
Schema
- Array [
- ]
id int64
Echoed request id
method string
Method invoked
code int32
0 = success; non-zero indicates error (reason code).
result object
Present when code === 0. result.data[] per docs (account_id, quantity, cost, open_position_pnl, etc.).
data object[]
List of positions.
account_id string
Account ID.
instrument_name string
E.g. BTCUSD-PERP.
type string
E.g. PERPETUAL_SWAP.
quantity decimal
Position quantity.
cost string
Position cost or value in USD.
open_position_pnl string
Profit and loss for the open position.
open_pos_cost string
Open position cost.
session_pnl string
Profit and loss in the current trading session.
update_timestamp_ms int64
Updated time (Unix timestamp).
isolation_id string
Isolation ID of the isolated position.
isolation_type IsolationType (string)
Possible values: [ISOLATED_MARGIN]
Isolation type
message string
Present when code !== 0.
original string
Present when code !== 0.