Skip to main content
The tplus stream commands open a persistent WebSocket connection and print every incoming event to stdout until you press Ctrl-C. This makes them ideal for monitoring live activity, debugging integrations, and feeding data into downstream processes. Two services provide streaming data: the orderbook service (--orderbook-base-url) handles order and user-trade streams, while the market-data service (--market-data-base-url) handles finalized trades, depth, and klines.

Stream subcommands

Orders stream

Subscribe to all order lifecycle events (new, filled, cancelled) for the authenticated account:
tplus stream orders
This stream connects to the orderbook service.

Trades stream

Subscribe to a feed of finalized public trades across all markets:
tplus stream trades
This stream connects to the market-data service.

Order book depth

Stream incremental order book depth updates for a specific asset. Each message contains price-level changes since the previous snapshot:
tplus stream depth 0xabc123...@42161
This stream connects to the market-data service.

Klines (candlestick) stream

Stream real-time OHLCV candle updates as they close for a specific asset:
tplus stream klines 0xabc123...@42161
This stream connects to the market-data service.

User trades stream

Subscribe to a feed of trades executed by a specific user. If --user is omitted, the stream defaults to the authenticated account’s public key:
# Authenticated account's trades
tplus stream user-trades

# Another user's trades by public key
tplus stream user-trades --user <pubkey>
This stream connects to the orderbook service.

Quick reference

SubcommandServiceDescription
tplus stream ordersOrderbookOrder lifecycle events for the authenticated account
tplus stream tradesMarket dataFinalized public trades (all markets)
tplus stream depth <asset_id>Market dataIncremental order book depth updates
tplus stream klines <asset_id>Market dataReal-time OHLCV candle updates
tplus stream user-trades [--user <pubkey>]OrderbookFill events for a specific user

Machine-readable output

By default, stream events are printed as formatted tables. Switch to JSON for programmatic consumption:
tplus stream depth 0xabc123...@42161 --output-format json
Pipe JSON stream output into jq or a custom script for real-time processing:
tplus stream trades --output-format json | jq '.price'

Stopping a stream

Press Ctrl-C to disconnect from the WebSocket and exit the command cleanly. The CLI will log the disconnection to ~/.tplus/cli/logs/tplus.log.
Streams reconnect automatically if the underlying WebSocket is interrupted. If you need to capture only a fixed number of events, pipe the JSON output into a script that exits after receiving enough messages.