Get User Trade by Order

Method: private/get_user_trades_by_order

Parameters

Parameter Type Required Description
orderId string true Order id
sorting string false Direction of results sorting (default value means no sorting, results will be returned in order in which they left the database). Allowed values: "asc", "desc", "default"
historical boolean false Determines whether historical trade and order records should be retrieved. false (default): Returns recent records: orders for 30 min, trades for 24h. true: Fetches historical records, available after a short delay due to indexing. Recent data is not included.

Request Example

{
  "rid": 3466,
  "method": "private/get_user_trades_by_order",
  "params": {
    "orderId": "ETH-584830574",
    "sorting": "asc",
    "historical": false
  }
}

Response

Returns an array of trade objects with the following fields:

Name Type Description
tradeId string Trade id
tickDirection integer Direction of the "tick" (0 = Plus Tick, 1 = Zero-Plus Tick, 2 = Minus Tick, 3 = Zero-Minus Tick).
feeCurrency string Currency, i.e "BTC", "ETH", "USDC"
api boolean true if user order was created with API
advanced string Advanced type of user order: "usd" or "implv" (only for options; omitted if not applicable)
orderId string Id of the user order (maker or taker), i.e. subscriber's order id that took part in the trade
liquidity string Describes what was role of users order: "M" when it was maker order, "T" when it was taker order
postOnly boolean true if user order is post-only
side string Direction: buy, or sell
contracts string Trade size in contract units (optional, may be absent in historical trades)
mmp boolean true if user order is MMP
indexPrice string Index Price at the moment of trade
label string User defined label (presented only when previously set for order by user)
blockTradeId string Block trade id - when trade was part of a block trade
price string Price in base currency
comboId string Optional field containing combo instrument name if the trade is a combo trade
matchingId string Always null
orderType string Order type: "limit", "market", or "liquidation"
tradeAllocations array of object List of allocations for Block RFQ pre-allocation. Each allocation specifies user_id, amount, and fee for the allocated part of the trade. For broker client allocations, a client_info object will be included
profitLoss string Profit and loss in base currency.
timestamp long The timestamp of the trade (milliseconds since the UNIX epoch)
iv string Option implied volatility for the price (Option only)
state string Order state: "open", "filled", "rejected", "cancelled", "untriggered" or "archive" (if order was archived)
underlyingPrice string Underlying price for implied volatility calculations (Options only)
blockRfqQuoteId string ID of the Block RFQ quote - when trade was part of the Block RFQ
quoteSetId string QuoteSet of the user order (optional, present only for orders placed with private/mass_quote)
markPrice string Mark Price at the moment of trade
blockRfqId string ID of the Block RFQ - when trade was part of the Block RFQ
comboTradeId string Optional field containing combo trade identifier if the trade is a combo trade
reduceOnly boolean true if user order is reduce-only
quantity string Trade amount. For perpetual and inverse futures the amount is in USD units. For options and linear futures and it is the underlying base currency coin
liquidation string Optional field (only for trades caused by liquidation): "M" when maker side of trade was under liquidation, "T" when taker side was under liquidation, "MT" when both sides of trade were under liquidation
tradeSeq integer The sequence number of the trade within instrument
riskReducing boolean true if user order is marked by the platform as a risk reducing order (can apply only to orders placed by PM users)
instrumentName string Unique instrument identifier
legs array Optional field containing leg trades if trade is a combo trade (present when querying for only combo trades and in combo_trades events)

Response Example

{
  "rid": 3466,
  "result": [
    {
      "tradeSeq": 1966042,
      "tradeId": "ETH-2696068",
      "timestamp": 1590480712800,
      "tickDirection": 3,
      "state": "filled",
      "reduceOnly": false,
      "price": "203.8",
      "postOnly": false,
      "orderType": "market",
      "orderId": "ETH-584830574",
      "matchingId": null,
      "markPrice": "203.78",
      "liquidity": "T",
      "instrumentName": "ETH-PERPETUAL",
      "indexPrice": "203.89",
      "feeCurrency": "ETH",
      "fee": "0.00036801",
      "side": "buy",
      "quantity": "100"
    }
  ]
}

results matching ""

    No results matching ""