market-details follows a list of pools. For every trade in any of them, it sends the trade together with the pool’s market data, re-priced at that trade. Use it for pair pages and pool dashboards.
Weight: the number of distinct pools in pools. See Subscription weight.
Parameters
There is no
excludeNoise and no token parameter on this channel.
pools must contain pool addresses. Unlike REST GET /market/details, a token address is not resolved to its best pool. The channel does not check that the pools exist: an address that is not a pool subscribes successfully and never sends events. To find a token’s pools, use GET /token/markets.Which trades you receive
- Every trade in each listed pool. The quote-token rule does not apply.
- Each trade is oriented to the pool’s base token:
data.tokenis the base anddata.tokenVsis the quote, matchingpairData.baseTokenandpairData.quoteToken.
Event data
data is a trade event with one extra field, pairData.
Address of the token the trade is viewed from, lowercase. All
token* fields describe this token and all *Vs fields describe the other side.Price of
token in the chain’s native coin (for example ETH): tokenPrice divided by the native coin’s USD price at the time of the trade. 0 when the native price is unknown.Direction from the point of view of
token. buy: token left the pool (the trader received token). sell: token entered the pool (the trader gave up token).Gas fee for this trade in USD: the transaction’s gas cost, split evenly across the swaps in that transaction.
null when unknown.The pool’s market data, in the same shape as the REST
GET /market/details response. null when it could not be loaded in time (see below).How pairData is built
-
Market data is built once per block for each pool and reused for every trade in that block. Reserves (
base.approximateReserveToken,quote.approximateReserveTokenand their raw values) are as of the end of the block. Windowed stats such as volume and trade counts come from the regularly refreshed pool stats, so they lag slightly behind the live trade. -
Each event re-prices the block’s data at the trade:
Other fields, including
priceTokenString,liquidityUSDand the windowed stats, are as built for the block. -
pairDataisnullwhen the pool is not found, the lookup fails, or it takes longer than 2 seconds. The trade fields are still sent. -
baseandquotecan each benullwhen that token’s details are not stored. -
Date fields such as
createdAtandlatestTradeDateare ISO 8601 strings.
Example
Related
GET /market/detailsand batch market details for the initial snapshotGET /token/marketsto find a token’s pools- token-details channel to follow tokens instead of pools