Skip to main content

private/get-trades

POST 

/private/get-trades

Gets all executed trades for a particular instrument.

Users should use user.trade to keep track of real-time trades, and private/get-trades should primarily be used for recovery; typically when the websocket is disconnected.

Request

Body

required
    id int64required

    Request id (echoed in response)

    method stringrequired

    Must be "private/get-trades"

    api_key stringrequired

    Your API key (only required for private REST)

    sig stringrequired

    HMAC-SHA256 signature in hex (only required for private REST)

    nonce int64required

    Current timestamp in milliseconds, e.g. "1771761038000".

    params objectrequired
    instrument_name string

    E.g. BTCUSD-PERP. Omit for 'all'.

    start_time int64

    Start time in Unix time format (inclusive), ms or ns. Default: end_time - 1 day. Nanosecond recommended for accurate pagination.

    end_time int64

    End time in Unix time format (exclusive), ms or ns. Default: current system timestamp. Nanosecond recommended for accurate pagination.

    limit int32

    Maximum number of trades to retrieve before end_time. Default: 100. Max: 100.

    isolation_id string

    Optional filter for trades of a particular isolated position. Omit for 'all'.

Success.
Schema
    id int64

    Echoed request id

    method string

    Method invoked

    code int32

    0 = success; non-zero indicates error (reason code).

    result object
    Present when code === 0. result.data[] per docs (account_id, traded_quantity, traded_price, fees, order_id, trade_id, etc.).
    data object[]
    List of trades.
  • Array [
  • account_id string

    Account ID.

    event_date string

    Event date.

    journal_type string

    Journal type would be TRADING.

    traded_quantity decimal

    Trade quantity.

    traded_price decimal

    Trade price.

    fees decimal

    Net trade fees (after fee credits applied, if any). The negative sign means a deduction on balance.

    fee_credits decimal

    Fee credits used to offset the trade fees. The negative sign means fee credits were consumed.

    order_id int64

    Order ID.

    trade_id int64

    Trade ID.

    trade_match_id int64

    Trade match ID.

    client_oid string

    Client Order ID.

    taker_side TakerSide (string)

    Possible values: [MAKER, TAKER]

    Maker or taker side of the trade

    side OrderSide (string)

    Possible values: [BUY, SELL]

    BUY or SELL

    instrument_name string

    E.g. BTCUSD-PERP.

    fee_instrument_name string

    E.g. USD.

    create_time int64

    Create timestamp in milliseconds.

    create_time_ns int64

    Create timestamp in nanoseconds.

    match_count int32

    Optional. Number of orders matched; Maker's order always 1; Taker's is the number of orders matched.

    match_index int32

    Optional. Only for Maker's order; which order entry of the price level was matched; 0-based.

    isolation_id string

    Isolation ID of the order if under isolated position.

    isolation_type IsolationType (string)

    Possible values: [ISOLATED_MARGIN]

    Isolation type

    transact_time_ns int64

    Trade transaction time in nanoseconds.

  • ]
  • message string

    Present when code !== 0.

    original string

    Present when code !== 0.