Skip to main content
WSS

Notes

  • Streams real-time trade/swap updates for pools by network and pool address.
  • Returns transaction type (buy/sell), tx hash, token amounts, volume, and price data.
  • Lookup format: network_id:pool_address (e.g. bsc:0x172fcd41e0913e95784454622d1c3724f546f849).
  • Find supported network IDs via Networks List.
  • Use Top Pools by Token Address to find the most liquid pool address.
  • Fields may return null when data is unavailable. Ensure your application handles null values.
Update Frequency:
As fast as ~0.1 seconds for actively traded pools.

Data Payload


1. Establish Connection

You can also pass the key as a header: x-cg-pro-api-key: YOUR_KEY
Output:

2. Subscribe to OnchainTrade

Input:
Output:

3. Stream Trade Data

Input:
Output:
Streaming output:
Output keys may appear in any order.

4. Unsubscribe

Unsubscribe from a specific pool:
Unsubscribe from the channel entirely:

x_cg_pro_api_key
type:httpApiKey

CoinGecko API key

Subscribe to OnchainTrade
type:object

Subscribe to the OnchainTrade channel

Stream OnchainTrade Data
type:object

Set pools to receive trade updates for

OnchainTrade Update
type:object

Real-time DEX trade update from server