Method Name
private/get_trade_history
private/get_trade_historyGet trade history for a subaccount, with filter parameters.
Required minimum session key permission level is read_only
Parameters
| from_timestampinteger Earliest timestamp to filter by (in ms since Unix epoch). If not provied, defaults to 0. |
| instrument_namestring Instrument name to filter by |
| order_idstring Order id to filter by |
| pageinteger Page number of results to return (default 1, returns last if above num_pages) |
| page_sizeinteger Number of results per page (default 100, max 1000) |
| quote_idstring If supplied, quote id to filter by. Supports either a concrete UUID, or is_quote and is_not_quote enum |
| subaccount_idinteger Subaccount_id (must be set if wallet is blank) |
| to_timestampinteger Latest timestamp to filter by (in ms since Unix epoch). If not provied, defaults to returning all data up to current time. |
| walletstring Wallet address (if set, subaccount_id ignored) |
Response
| idstring or integerrequired |
| resultobjectrequired |
| result.subaccount_idintegerrequired Subaccount ID requested, or 0 if not provided |
| result.paginationobjectrequired Pagination info |
| result.pagination.countintegerrequired Total number of items, across all pages |
| result.pagination.num_pagesintegerrequired Number of pages |
| result.tradesarray of objectsrequired List of trades |
| result.trades[].directionstringrequired Order direction enum buysell |
| result.trades[].expected_rebatestringrequired Expected rebate for this trade |
| result.trades[].extra_feestringrequired Extra fee in USDC added by the referring client (included in trade fee) |
| result.trades[].index_pricestringrequired Index price of the underlying at the time of the trade |
| result.trades[].instrument_namestringrequired Instrument name |
| result.trades[].is_transferbooleanrequired Whether the trade was generated through private/transfer_position |
| result.trades[].labelstringrequired Optional user-defined label for the order |
| result.trades[].liquidity_rolestringrequired Role of the user in the trade enum makertaker |
| result.trades[].mark_pricestringrequired Mark price of the instrument at the time of the trade |
| result.trades[].order_idstringrequired Order ID |
| result.trades[].quote_idstring or nullrequired Quote ID if the trade was executed via RFQ |
| result.trades[].realized_pnlstringrequired Realized PnL for this trade |
| result.trades[].realized_pnl_excl_feesstringrequired Realized PnL for this trade using cost accounting that excludes fees |
| result.trades[].rfq_idstring or nullrequired RFQ ID if the trade was executed via RFQ |
| result.trades[].subaccount_idintegerrequired Subaccount ID |
| result.trades[].timestampintegerrequired Trade timestamp (in ms since Unix epoch) |
| result.trades[].trade_amountstringrequired Amount filled in this trade |
| result.trades[].trade_feestringrequired Base_fee (only takers) + unit_fee (adjusted via rebates / discounts) + extra_fee (set by referrring client)) |
| result.trades[].trade_idstringrequired Trade ID |
| result.trades[].trade_pricestringrequired Price at which the trade was filled |
| result.trades[].transaction_idstringrequired The transaction id of the related settlement transaction |
| result.trades[].tx_hashstring or nullrequired Blockchain transaction hash |
| result.trades[].tx_statusstringrequired Blockchain transaction status enum requestedpendingsettledrevertedignoredtimed_out |
Example
{request_example_shell}{request_example_javascript}{request_example_python}The above command returns JSON structured like this:
{response_example_json}