Retrieve closed-trade history
Returns server-composed closed trades, newest close first, with per-leg entry and exit economics. A page may hold fewer than `limit` trades and still return a `nextCursor`: closed positions with no confirmed fills are skipped. Page until `nextCursor` is absent, never until a page comes back short.
x-api-key<token>
In: header
Query Parameters
limit?integer
Range
0 < value <= 200Default
20cursor?string
startDate?string
endDate?string
includeSteps?|
Default
falseHeader Parameters
X-Trade-Account-Id*string
UUID of the trade account the request acts on. Must belong to the authenticated user.
Format
uuidResponse Body
application/json
curl -X GET "https://example.com/positions/closed" \ -H "X-Trade-Account-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6"{ "limit": 0, "nextCursor": "string", "trades": [ { "positionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "connector": "hyperliquid", "openedAt": "string", "closedAt": "string", "closedReason": "NETTED", "origin": "PEAR", "grossPnl": "+42.5", "netPnl": "+42.5", "totalFees": "+42.5", "tradeFees": "+42.5", "pearFees": "+42.5", "totalFunding": "+42.5", "entryNotional": "1250.75", "exitNotional": "1250.75", "exitNotionalComplete": true, "hasSyntheticFills": true, "unstableHistoricalData": true, "longAssets": [ "BTC" ], "shortAssets": [ "BTC" ], "legs": [ { "asset": "BTC", "side": "LONG", "entryVwap": "1250.75", "exitVwap": "1250.75", "grossPnl": "+42.5", "netPnl": "+42.5", "totalFees": "+42.5", "tradeFees": "+42.5", "pearFees": "+42.5", "funding": "+42.5", "entryNotional": "1250.75", "exitQuantity": "1250.75", "undeterminedSize": "1250.75" } ], "steps": [ { "executionId": "string", "at": "string", "grossPnl": "+42.5", "legs": [ { "kind": "INCREASE", "asset": "BTC", "side": "BUY", "quantity": "1250.75", "price": "1250.75", "tradeFee": "+42.5", "pearFee": "+42.5" } ] } ] } ]}