Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

trades

Public real-time trade stream.

Outcome markets reuse this channel: pass the numeric instrument_id as coin. This is the public tape for one market. The node also supports the Outcome-specific outcomeTrades batch/user subscription, but the current public web client uses this single-instrument stream.

Channeltradesserver → client · type trades

Drive the public trade tape for one instrument.

Subscribe
{
  "method": "subscribe",
  "type": "trades",
  "subscription": {
    "type": "trades",
    "coin": "4"
  }
}
Try it
WS wss://rpc.txflow-testnet.xyz/ws
Subscription parameters
coinstringrequired
typestringrequired
"trades"
userstringnullableoptional

Optional filter: only trades where this address is taker or maker are pushed. Omit or "" for all trades. Use the account address, not an agent's.

Server message
channelstring
"trades"
dataWsTrade[]
coinstring

Trading pair symbol.

hashstring

Transaction hash, hex, 0x-prefixed.

pxDecimalString

Trade price.

sidestring

Taker side: "B" = buy, "A" = sell.

"A""B"
symbolstring

Trading pair symbol (duplicate of coin, kept for backward compatibility).

szDecimalString

Trade size.

tidinteger

Trade id.

timeinteger

Trade timestamp, milliseconds.

usersstring[]

[takerAddress, makerAddress].

instrumentIdintegernullable

Instrument's external id. Omitted on legacy payloads.

makerClosedPnlDecimalString

Realized PnL closed by the maker in this trade.

makerFeeDecimalString

Fee charged to the maker.

makerReduceOnlyboolean

Whether the maker's order was reduce-only.

takerClosedPnlDecimalString

Realized PnL closed by the taker in this trade.

takerFeeDecimalString

Fee charged to the taker.

takerReduceOnlyboolean

Whether the taker's order was reduce-only.

Message example
{
  "channel": "trades",
  "data": [
    {
      "coin": "4",
      "symbol": "",
      "instrumentId": 9001,
      "side": "B",
      "px": "0",
      "sz": "0",
      "time": 1700000000000,
      "hash": "",
      "tid": 0,
      "users": [
        ""
      ],
      "takerFee": "",
      "makerFee": "",
      "takerClosedPnl": "",
      "makerClosedPnl": "",
      "takerReduceOnly": false,
      "makerReduceOnly": false
    }
  ]
}