Numbers and strings
ChainQuery uses two encodings for numeric values. JSON numbers (64-bit floats) for anything that is already human-scaled:- USD values:
priceUSD,liquidityUSD,marketCapUSD,volume24hUSD,tokenAmountUsd,balanceUSD, OHLCV volumev - Prices:
tokenPrice,priceToken, OHLCVo,h,l,c - Decimal-adjusted token amounts:
tokenAmount,tokenAmountVs,balance,approximateReserveToken - Percentages and counts:
priceChange24hPercentage,trades1h,buyers24h
To get a display value, divide by
10^decimals:
priceTokenString on market details is the pool price (base token in quote-token units) as a fixed-point decimal string with exactly 32 fractional digits, for example "3412.57000000000000000000000000000000". Use it when the float priceToken loses precision on very small or very large ratios. It is null when it cannot be computed.
blockNumber is a string in wallet holdings and a number everywhere else (trades, WebSocket events, multi-events swaps). WebSocket gap messages carry numeric fromBlock and toBlock.Percentages
Not every field named “percentage” uses the same scale.priceChange*Percentage is 0 when there is no earlier price to compare against. bondingPercentage is null when the token has no bonding curve; on token details a token that has already bonded reports 0, so check bonded first.
Timestamps
OHLCV buckets are aligned to UTC. Weekly (
1w) buckets start on Monday 00:00 UTC, and monthly (1M) buckets are UTC calendar months. Note the case: 1m is one minute, 1M is one month.
Booleans in query strings
Boolean query parameters (fill on GET /token/ohlcv and GET /market/ohlcv, filterSpam on wallet holdings) accept only the literal lowercase strings true and false. 1, 0, yes or TRUE return 400 INVALID_PARAMETERS.
JSON bodies and WebSocket messages use real JSON booleans ("excludeNoise": true).
Optional parameters
Leave an optional parameter out of the query string instead of sending it empty. Numeric parameters convert an empty value to0, so:
limit=becomes0and fails validation withToo small: expected number to be >=1.from=becomes0, which is a valid timestamp (1970-01-01) and silently widens your window.
Stats windows
Token, market and Pulse objects carry rolling stats for fixed windows. The window name is embedded in the field name.
Examples:
volume24hUSD, trades1h, buyers15min, priceChange5minPercentage. buyers, sellers and traders count distinct wallets. Stats default to 0 when there is no activity.
feesPaid{W}USD currently reflects the network gas fees traders paid for their swaps, converted to USD. It does not include DEX swap fees or LP fees. Treat this definition as provisional.Addresses and chain ids
All addresses in responses are lowercase. Chain ids are usually"evm:<id>" strings. See Chains and identifiers for the exceptions.