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


currency 
string
Currency to filter by (defaults to all)
from_timestamp  integer
Earliest timestamp to filter by (in ms since Unix epoch). If not provied, defaults to 0.
instrument_name  string
Instrument name to filter by (defaults to all)
instrument_type  string
Instrument type to filter by (defaults to all)
enum erc20 option perp
page  integer
Page number of results to return (default 1, returns last if above num_pages)
page_size  integer
Number of results per page (default 100, max 1000)
subaccount_id  integer
Subaccount ID to filter by
to_timestamp  integer
Latest timestamp to filter by (in ms since Unix epoch). If not provied, defaults to returning all data up to current time.
trade_id  string
Trade ID to filter by. If set, all other filters are ignored
tx_hash  string
On-chain tx hash to filter by. If set, all other filters are ignored
tx_status  string
Transaction status to filter by (default settled).
enum settled reverted timed_out

Response


id 
string or integer required
result  object required
result. pagination  object required
Pagination info
result.pagination. count  integer required
Total number of items, across all pages
result.pagination. num_pages  integer required
Number of pages
result. trades  array of objects required
List of trades
result.trades[]. direction  string required
Order direction
enum buy sell
result.trades[]. expected_rebate  string required
Expected rebate for this trade
result.trades[]. extra_fee  string required
Extra fee in USDC added by the referring client (included in trade fee)
result.trades[]. index_price  string required
Index price of the underlying at the time of the trade
result.trades[]. instrument_name  string required
Instrument name
result.trades[]. liquidity_role  string required
Role of the user in the trade
enum maker taker
result.trades[]. mark_price  string required
Mark price of the instrument at the time of the trade
result.trades[]. quote_id  string or null required
Quote ID if the trade was executed via RFQ
result.trades[]. realized_pnl  string required
Realized PnL for this trade
result.trades[]. realized_pnl_excl_fees  string required
Realized PnL for this trade using cost accounting that excludes fees
result.trades[]. rfq_id  string or null required
RFQ ID if the trade was executed via RFQ
result.trades[]. subaccount_id  integer required
Subaccount ID
result.trades[]. timestamp  integer required
Trade timestamp (in ms since Unix epoch)
result.trades[]. trade_amount  string required
Amount filled in this trade
result.trades[]. trade_fee  string required
Fee for this trade
result.trades[]. trade_id  string required
Trade ID
result.trades[]. trade_price  string required
Price at which the trade was filled
result.trades[]. tx_hash  string required
Blockchain transaction hash
result.trades[]. tx_status  string required
Blockchain transaction status
enum settled reverted timed_out
result.trades[]. wallet  string required
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}