Skip to main content
GET /api/v1/trades/history

Query Parameters

FieldTypeNeedDescriptionExample
”account”stringoptionalUser’s wallet address42trU9A5…
“symbol”stringoptionalMarket symbol to filter byBTC
”builder_code”stringoptionalOnly return trades with this builder codeBUILDER1
”start_time”integeroptionalStart time in milliseconds1625097600000
”end_time”integeroptionalEnd time in milliseconds1759215599188
”limit”integeroptionalMaximum number of records to return, defaults to 100100
”cursor”stringoptionalCursor pagination to access records. Default to none1115hVka
/api/v1/trades/history?account=42trU9A5...&start_time=1625097600000&end_time=1759215599188

Response

  • Status 200: Successfully retrieved portfolio position history
  {
  "success": true,
  "data": [
    {
      "history_id": 19329801,
      "order_id": 315293920,
      "client_order_id": "acf...",
      "symbol": "LDO",
      "amount": "0.1",
      "price": "1.1904",
      "entry_price": "1.176247",
      "fee": "0",
      "pnl": "-0.001415",
      "event_type": "fulfill_maker",
      "side": "close_short",
      "created_at": 1759215599188,
      "cause": "normal"
    },
    ...
  ],
  "next_cursor": "11111Z5RK",
  "has_more": true
}
FieldTypeDescription
”history_id”integerHistory id of trade
”order_id”integerOrder id of order that resulted in the trade
”client_order_id”UUIDCLOID of order that resulted in the trade
”symbol”stringTrading pair symbol
”amount”decimal stringAmount (in token denomination) of the trade event
”price”decimal stringCurrent price of the specified symbol
”entry_price”decimal stringPrice at which the trade event was executed
”fee”decimal stringFee paid by the trade event
”spot_fee”decimal string or nullNative spot fee paid for this trade; only set for spot-buy fills
”pnl”decimal stringPnL generated by the trade event
”event_type”string”fulfill_taker” if taker
”fulfill_maker” if maker
”side”string”open_long"
"open_short"
"close_long"
"close_short"
"created_at”integerTimestamp in milliseconds when the trade event occurred
”cause”string”normal”
regular user-initiated trading
”market_liquidation” position was liquidated due to insufficient margin
”backstop_liquidation” position was liquidated by backstop mechanism
”settlement”
position was closed due to Auto-Deleveraging (ADL) or other settlement
’next_cursor’stringNext cursor for pagination
’has_more’booleanTrue if there exists a ‘next_cursor’
FieldTypeDescription
'event_type'string

”fulfill_taker” if taker
”fulfill_maker” if maker

'side'string

”open_long"
"open_short"
"close_long"
"close_short”

'cause'string

”normal”
regular user-initiated trading
”market_liquidation” position was liquidated due to insufficient margin
”backstop_liquidation” position was liquidated by backstop mechanism
”settlement”
position was closed due to Auto-Deleveraging (ADL) or other settlement

  • Status 400: Invalid request parameters
  • Status 401: Unauthorized access
  • Status 500: Internal server error

Code Example (Python)

import requests

response = requests.get(
    "/api/v1/trades/history?account=42trU9A5...&symbol=BTC&limit=20&cursor=11115hVka",
    headers={"Accept": "*/*"},
)

data = response.json()