Positions

Snapshot of the authenticated account's open positions.

GET /positions

Auth: Authorization: Bearer <access_token>. The account is derived from the token — there is no path parameter for user id.

Query Parameters

ParameterRequiredDescription
statusNoFilter by position status. Accepts OPEN (default), CLOSING, CLOSED.
symbolNoFilter to a single instrument.

Example

curl "https://api.godarkdex.com/api/v1/positions?status=OPEN" \
  -H "Authorization: Bearer $TOKEN"

Response

{
  "code": 0,
  "data": {
    "positions": [
      {
        "position_id": "pos_01HXYZ",
        "symbol": "BTC-USDC-PERP",
        "side": "long",
        "size": 0.5,
        "entry_price": 95000.0,
        "mark_price": 95500.0,
        "margin": 4750.0,
        "leverage": 5,
        "unrealized_pnl": 250.0,
        "realized_pnl": 0,
        "funding_accrued": -12.5,
        "liquidation_price": 85500.0,
        "status": "OPEN",
        "created_at": "2026-04-20T10:30:00.123Z",
        "updated_at": "2026-04-20T11:00:00.456Z"
      }
    ]
  },
  "timestamp": "2026-04-20T11:05:00.789Z",
  "request_id": "req_01HXYZ..."
}

Field Reference

FieldTypeDescription
position_idstringPosition id
symbolstringInstrument id
sidestringlong or short
sizenumberPosition size in base asset (always positive; direction is given by side)
entry_pricenumberVolume-weighted average entry price
mark_pricenumberReference price used for PnL and liquidation math
marginnumberCollateral allocated to this position (USDC)
leveragenumberEffective leverage
unrealized_pnlnumberCurrent unrealized PnL (USDC)
realized_pnlnumberCumulative realized PnL since position opened (USDC)
funding_accruednumberNet funding paid/received (USDC; negative = paid out)
liquidation_pricenumberPrice at which this position would be liquidated (see Margin & Liquidation)
statusstringOPEN, CLOSING, or CLOSED
created_atstringPosition open timestamp (RFC 3339)
updated_atstringLast update timestamp (RFC 3339)

Streaming Alternative

GET /positions is a single snapshot. For live updates — fills, mark price moves, liquidation-price changes — subscribe to the Positions Channel over WebSocket. The channel sends a snapshot on subscribe and then incremental updates.

For margin health tiers, partial liquidation, and how liquidation_price is derived, see Margin & Liquidation.