HomeDocumentationAPI Reference
Log In
API Reference

Get Trade History

Method Name

public/get_trade_history

Get trade history for a subaccount, with filter parameters.

Parameters

currencystring
Currency to filter by (defaults to all)
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 (defaults to all)
instrument_typestring
Instrument type to filter by (defaults to all)
enum erc20optionperp
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)
subaccount_idinteger
Subaccount ID to filter by
to_timestampinteger
Latest timestamp to filter by (in ms since Unix epoch). If not provied, defaults to returning all data up to current time.
trade_idstring
Trade ID to filter by. If set, all other filters are ignored
tx_hashstring
On-chain tx hash to filter by. If set, all other filters are ignored
tx_statusstring
Transaction status to filter by (default settled).
enum settledrevertedtimed_out

Response

idstring or integerrequired
resultobjectrequired
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[].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[].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
Fee for this trade
result.trades[].trade_idstringrequired
Trade ID
result.trades[].trade_pricestringrequired
Price at which the trade was filled
result.trades[].tx_hashstringrequired
Blockchain transaction hash
result.trades[].tx_statusstringrequired
Blockchain transaction status
enum settledrevertedtimed_out
result.trades[].walletstringrequired
Wallet address (owner) of the subaccount

Example

{request_example_shell}
{request_example_javascript}
{request_example_python}

The above command returns JSON structured like this:

{response_example_json}