Skip to main content
Room ID: trades
Endpoint: wss://staging-api.struct.to/ws
Live on-chain DEX transactions: swaps, liquidity events, pool creation, and migrations, across chains on one connection. Subscribe with targets. Each target names a chain plus any of token_address, pool_id and trader; every field you set must match. Its mode decides what it follows: Per connection you can follow 50 unique markets (pool mode), 50 unique tokens (asset mode) and 50 unique wallets; extras come back in rejected. A token without a live pool is rejected in pool mode; use mode: "asset" to follow it anyway. A trade that matches several targets arrives once. Buy/Sell, price and market cap describe the target’s token_address when it has one; otherwise the pool’s preferred token, else the listed (non-quote) token.

Migrations

Pool subscriptions follow migrations automatically. When a subscribed pool migrates (for example a bonding curve graduating to an AMM pool), the destination pool is added to your targets, keeping the launched token’s perspective, and its trades start arriving. This room sends no migration event: watch the address room (an address_update for the destination pool with migrated_from_pool_id, dirty kind pool) to be notified. Pools that had already migrated when you subscribe are followed immediately and listed in the response’s migrations. The original pool stays subscribed. Token targets need nothing: the token keeps trading under the same address.

Subscribe

Every action is answered with chain_trade_stream_subscribe_response: your full normalized targets (including pools added by migrations), types, protocols, migrations and rejected entries with a reason.

Filters

Example

Events

Each trade arrives as trade_stream_update. The example is a buy and includes every swap field. Liquidity adds and removes, pool creates and migrations carry amounts and reserves (token units, _usd and _native) but no price or market_cap. Pick Response (Long) or Response (Short) in the right-hand panel; the room sends whichever mode the connection selected (WebSocket defaults to short). See long and short field names.
Last modified on September 29, 2026