Skip to content

Remove subgraph data corruption hotfix after reindex #39

Description

@ggonzalez94

Context

PR #38 added a temporary hotfix to filter corrupted volumeUSD and feesUSD data from the Taiko V3 subgraph. Two swap events on the USDC/TAIKO 0.3% pool (Feb 17 & Mar 2 2026) recorded ~$8.1e+32 in phantom volume due to a transient derivedETH price spike during low-liquidity conditions. This corrupted cumulative accumulators on the factory, pool, and token entities.

The root cause fix is in taikoxyz/uniswap-v3-subgraph#6 (volume sanity cap + raised MINIMUM_NATIVE_LOCKED). Once that PR is merged, the subgraph redeployed to Goldsky, and reindexing completes, the hotfix code should be removed.

Current accounting gap

The hotfix shows $32M total volume instead of the real ~$55M because the corrupted pool's legitimate ~$23M volume is zeroed along with the bad data. TAIKO and USDC tokens show "-" for volume instead of their real values. This resolves after reindex.

What to remove

All code marked with TODO: Remove after subgraph reindex:

src/graphql/taiko/TaikoTopPools.ts

  • Remove MAX_POOL_VOLUME_USD constant
  • Revert protocol stats query to read totalVolumeUSD and totalFeesUSD from the factory entity instead of summing individual pool volumes
  • Remove the zeroing logic in pool normalization (rawVolumeUSD > 1e9 ? 0 : rawVolumeUSD)

src/graphql/taiko/TaikoTopTokens.ts

  • Remove the volume cap in normalizeTokens() (rawVolumeUSD > 1e9 ? 0 : rawVolumeUSD)

How to verify the subgraph is clean

Query the subgraph directly after reindex:

{ factories(first: 1) { totalVolumeUSD totalFeesUSD } }

If totalVolumeUSD is a reasonable number (~$55M), the hotfix can be safely removed.

Subgraph deployment steps

  1. Merge fix: add volume sanity cap to prevent corrupted cumulative stats uniswap-v3-subgraph#6
  2. Build for taiko network
  3. Deploy to Goldsky: goldsky subgraph deploy uniswap-v3-taiko/<version> --path .
  4. Wait for full reindex from genesis (may take hours)
  5. Verify factory stats query returns clean data
  6. Update .env.production subgraph URLs to new version
  7. Remove hotfix code (this issue)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions