You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[QmZsgJLiLQKpb8hxTmQ5LWyrFVvfWzVaL4WK8dfFBn7EeK] handleInitialize drops the Pool when a currency's decimals() reverts #6705
Repo:Uniswap/v4-subgraph Deployment seen on:QmZsgJLiLQKpb8hxTmQ5LWyrFVvfWzVaL4WK8dfFBn7EeK (V4, Ethereum mainnet)
Problem
If a pool is initialized with a token whose decimals() reverts, handleInitializeHelper returns
early and never saves the Pool entity. The Initialize event is lost permanently, so the pool
and all of its swaps are missing from the subgraph.
constdecimals=fetchTokenDecimals(event.params.currency0,tokenOverrides,nativeTokenDetails)// bail if we couldn't figure out the decimalsif(decimals===null){log.debug('mybug the decimal on token 0 was null',[])return}
Same for currency1 at #L105-L110
(note: that branch logs "token 0" too, which is misleading).
fetchTokenDecimals
returns null whenever try_decimals() reverts. By contrast, fetchTokenSymbol
and fetchTokenName
already fall back to 'unknown'. Decimals is the only metadata call that aborts indexing instead of
degrading gracefully.
Initialize (logIndex 208) and the pool's first Swap (logIndex 211) are in the same
transaction, so the pool breaks immediately. Result in the store: no Pool row, no Token row,
no swaps - the pool simply does not exist.
constpool=Pool.load(poolId)if(!pool){log.warning('Pool not found: {}',[poolId])return}
So depending on the build:
Older builds (like the deployment above, which non-null-asserts the pool) abort the handler:
Mapping aborted at src/mappings/swap.ts, line 39, column 16, with message: unexpected null
With nonFatalErrors enabled the subgraph is then stuck unhealthy forever. The error is
deterministic, so it hits every indexer and cannot be repaired by rewinding or resyncing.
Current main logs a warning and returns - no error, but the pool's swaps, volume and TVL are
silently missing from all aggregates. Arguably worse, since nothing surfaces the gap.
Either way the underlying cause is the same: the Pool was never created.
Impact
Pools with any non-standard-decimals() currency are entirely absent from the subgraph.
Their swaps never contribute to PoolDayData / TokenDayData / UniswapDayData.
Not fixable operationally - only a mapping change and redeploy helps.
Activity
0x19dG87 commentedon Aug 10, 2026
Same error for subgraph
Qmd78a3BJf4TzD3H3QPQpBgUrzWZErSmJtFrsvUW6c3M6u