Skip to main content
GET
Get user position

Path Parameters

user_pubkey
string
required

User pubkey (base58 encoded)

position_id
string
required

Position id

Query Parameters

traderPdaIndex
integer<int32>
required

PDA index of the user's trader holding the position.

Response

200 - application/json

Successful response

One position of one subaccount: from the trade that left the market flat (or reversed the previous position) to the trade that next made it flat or reversed it.

Size amounts are in base units and money amounts in USD, as decimal strings. PnL terms are signed; fees is what the trader paid, negative for net rebates; netPnl = realizedPnl + fundingPayment - fees. For an open position every amount covers the trades so far and excludes unrealized PnL.

avgEntryPrice
string
required
complete
boolean
required

false when the recorded history does not account for the whole position; amounts then cover only the recorded part.

entrySize
string
required

Total size bought (long) or sold (short) into the position.

exitSize
string
required

Total size traded out of the position.

fees
string
required
fundingPayment
string
required
marketSymbol
string
required
netPnl
string
required
openKey
object
required

The trade that opened the position.

openedAt
string<date-time>
required
peakSize
string
required

Largest size held at any point.

positionId
string
required

Stable identifier of the position.

realizedPnl
string
required
side
enum<string>
required
Available options:
long,
short
status
enum<string>
required
Available options:
open,
closed
subaccountIndex
integer<int32>
required

Subaccount holding the position; 0 is the cross account.

traderPdaIndex
integer<int32>
required
userPubkey
string
required

Wallet of the user whose trader holds the position (base58 encoded).

avgExitPrice
string | null

None until the position is reduced.

closeKey
object | null

The trade that closed the position; the position's trades are those from openKey through closeKey in its subaccount and market.

closeReason
enum<string> | null

How a closed position ended.

Available options:
closed,
reversed,
liquidated,
adl,
marketSettled,
takeProfit,
stopLoss
closedAt
string<date-time> | null
reversedFrom
string | null

The position this one reversed out of.

reversedInto
string | null

The position this one reversed into.

tradesCursor
string | null

cursor for trades_v2 whose first page starts at closeKey and goes back in time; None while the position is open.