Skip to content

trade#

WS wss://api.pro.anboto.xyz/api/v2/ws

Channel for subscribing to trade (fill) updates for a specific exchange

Authenticate the connection with a listenKey — see WebSocket.

Subscribe message#

topic string required
trade
exchange string required
Trading exchange, case-insensitive
Example: BINANCE
method enum required
subscribe / unsubscribe

Update message fields#

trade_id string
Anboto's trade Id
order_id integer
The Anboto id of the child (slice) order that executed on the exchange
parent_order_id integer
The Anboto id of the parent order the filled child order belongs to; the order_id reported by the REST order endpoints and the order topic
exchange_id integer
The platform exchange id of the filled child order (see GET /api/v2/data/exchanges). A trade subscription delivers fills of its subscribed exchange; fills with an unresolved exchange (child order not yet cached) are passed through
symbol string
the symbol of the trade
side enum
trade side — BUY, SELL
taker_or_maker enum
maker or taker of the trade — MAKER, TAKER
price decimal
the price of the trade
amount decimal
the quantity of the trade
cost decimal
the notional of the trade
fee_currency string
fee currency
fee_cost decimal
the fee of the trade
timestamp integer
Unix timestamp of this status change in milliseconds
ext_trade_id string
trade Id from exchange
ext_order_id string
order Id of the trade from exchnage

Responses#

code 0 Acknowledgment of successful subscription
code ≠ 0 Error response for failed subscription — see Errors
{
  "topic": "trade",
  "exchange": "BINANCE",
  "method": "subscribe"
}
{
  "topic": "order",
  "exchange": "BINANCE",
  "method": "unsubscribe"
}

Update trade

{
  "trade_id": "151990408",
  "order_id": 558547168212975616,
  "symbol": "KITE/USDT:USDT",
  "side": "SELL",
  "taker_or_maker": "MAKER",
  "price": 0.21735,
  "amount": 153,
  "cost": 33.25455,
  "fee_currency": "BNB",
  "fee_cost": 7.55e-06,
  "timestamp": 1719224096000,
  "ext_trade_id": "1204004183",
  "ext_order_id": "151990408",
  "client_order_id": "554500941080543232",
  "parent_order_id": 558547165436166144,
  "exchange_id": 1
}

Ack code 0

{
  "code": 0,
  "message": "string"
}