Messages
WebSocket
OnchainTrade
Subscribe to receive real-time transaction (trade/swap) updates for pools, as seen on GeckoTerminal.com
WSS
This WebSocket channel allows you to subscribe to real-time updates of token trades of a pool.Documentation Index
Fetch the complete documentation index at: https://docs.coingecko.com/llms.txt
Use this file to discover all available pages before exploring further.
- Lookup by Network + Pool Address
- It will return transaction type (buy/sell), tx hash, amount of token transacted, volume, and current price data of the specified pool.
Data Payload
| Field | Type | Description | Example | |
|---|---|---|---|---|
c | channel_type | string | Indicates the type of channel subscribed to. | G2 |
n | network_id | string | Identifier of the blockchain network. Check full list of IDs here. | eth |
pa | pool_address | string | Contract address of the pool. | 0x88e6a0c2dd6fcb..3f5640 |
tx | tx_hash | string | Transaction hash. | 0x0b8ac5a16c2d5a..4d422 |
ty | type | string | Type of transaction (b for buy or s for sell). | b |
to | token_amount | float | Amount of token transacted. | 100 |
toq | quote_token_amount | float | Amount of quote token transacted. | 0.0124384489204242 |
vo | volume_in_usd | float | The transaction value in USD. | 1000 |
pc | price_in_native_currency | float | Current token price in network’s native token currency. E.g. Base network’s native currency is ETH. | 3639.78228844745 |
pu | price_in_usd | float | Current token price in USD. | 3.566 |
t | last_updated_at | integer | Timestamp of the last data update in UNIX time. | 1752072129000 |
null when specific data is unavailable. Ensure your application is capable of handling null values for fields that may not always have data.
1. Establish Connection to WebSocket
2. Subscribe to a specific channel - OnchainTrade
Input Example:3. Stream OnchainTrade data
Input Example:Tips:
Unsubscribe to stop streaming OnchainTrade data
Input Example: Unsubscribe for 1 specific pool data:Messages

