Skip to main content

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 volume v
  • Prices: tokenPrice, priceToken, OHLCV o, h, l, c
  • Decimal-adjusted token amounts: tokenAmount, tokenAmountVs, balance, approximateReserveToken
  • Percentages and counts: priceChange24hPercentage, trades1h, buyers24h
Decimal strings for raw on-chain integers in the token’s base units (no decimals applied). These can exceed the range a float represents exactly, so parse them with a big-integer type: 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

from and to must be milliseconds. A value in seconds such as 1764720000 is accepted without error but read as a date in January 1970, so you get an empty or wrong window. Use Date.now() in JavaScript or int(time.time() * 1000) in Python.
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 to 0, so:
  • limit= becomes 0 and fails validation with Too small: expected number to be >=1.
  • from= becomes 0, which is a valid timestamp (1970-01-01) and silently widens your window.
Unknown query parameters are ignored.

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.