Market Data

public/get_trade_history

Changed on

Returns paginated, anonymized trades with optional filters: trade_id (a UUID, which overrides all other filters), instrument_name, instrument_type (erc20/option/perp), currency, subaccount_id, batch_status (a batch-status name; unset returns trades in every batch state), and from_timestamp/to_timestamp. Without trade_id, subaccount_id or instrument_name, or whenever batch_status is set, the window is limited to the 30 days ending at to_timestamp (or now). Each trade is enriched with its settlement status and transaction hash. A block trade does not show who traded it: wallet is the zero address, and subaccount_id, realized_pnl and realized_pnl_excl_fees are 0. The subaccount_id filter does not return block trades. Public endpoint.

post/public/get_trade_history

Request

  • Base URL
    https://api.derive.xyz/v3
  • Auth
    none declared

Request body

GetPublicTradeHistoryRequest required
batch_status, 'Batching' | 'Executing' | 'Da' | 'Proving' | 'Settling' | 'Settled' | 'BatchingError' | 'ExecutingError' | 'DaError' | 'ProvingError' | 'SettlingError' | 'SettledError' nullable

Batch lifecycle status — the single source of lifecycle truth for every operation in the batch (individual ops carry no status of their own). Each stage has a healthy variant and a corresponding ...Error variant meaning that stage failed. Serialized as the variant name (string) in API responses.

currency, string nullable
from_timestamp, integer nullable
instrument_name, string nullable
instrument_type, 'option' | 'perp' | 'erc20' nullable

Asset type of the instrument: "option", "perp", or "erc20".

page, integer nullable
page_size, integer nullable
subaccount_id, integer nullable
to_timestamp, integer nullable
trade_id, string nullable

Response

Success

PublicTradesResult required
pagination, Pagination required

Response envelope for paginated RPCs.

trades, SettledTrade[] required

Changes