trades (API service)
Sends the latest 300 trades for one instrument, newest first, right after you
subscribe and again every few seconds. This is the /api-ws channel named
trades; the node /ws trades channel pushes each
trade as it happens instead.
Channeltradesserver → client · type
tradesShow the latest 300 trades for one instrument from /api-ws, refreshed every few seconds.
Subscribe
{
"method": "subscribe",
"subscription": {
"type": "trades",
"coin": "BTC"
}
}Try it
Subscription parameters
coinstringrequired
Instrument name (`BTC`, `BTC-USDC`) or numeric id; for an Outcome market, its `instrument_id` as a string.
typestringrequired
"trades"Server message
channelstring
"trades"dataobject[]
Newest first. Each push repeats the full list — de-duplicate by `tid`.
coinstring
Base name.
hashstring
instrumentIdinteger
instrumentTypestring
marketTypestring
pxstring
sidestring
Taker side: "B" = buy, "A" = sell.
"B""A"symbolstring
szstring
tidinteger
Trade id.
timeinteger
Unix ms.
usersstring · address[]
The two counterparties.
Message example
{
"channel": "trades",
"data": [
{
"coin": "BTC",
"symbol": "BTC-USDC",
"side": "B",
"px": "83280.7",
"sz": "0.0053",
"time": 1791894528994,
"hash": "0xed3383f38be30c011dfc126d880b5575ff0b713f81056f75ce58a3ec64f9b971",
"tid": 323976318000002,
"users": [
"0xe3f0e9c1cfb95590f165ed6df5e1a9f53d117c24",
"0x079e74e124151e4a411df17ea7e3ef97f4d049e3"
],
"instrumentId": 1,
"instrumentType": "perps",
"marketType": "perps"
}
]
}Every push repeats the whole list, so de-duplicate by tid. side is the
taker's side.