MCPcopy Index your code
hub / github.com/enviodev/uniswap-v4-indexer

github.com/enviodev/uniswap-v4-indexer @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
45 symbols 106 edges 17 files 1 documented · 2%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Uniswap V4 Indexer

Discord

A public, open-source multichain Uniswap V4 indexer built with Envio HyperIndex. Powers v4.xyz, the hub for Uniswap V4 data and hooks analytics.

Open to contributions.

v4.xyz Dashboard

What This Indexes

This indexer tracks all key events from Uniswap V4 PoolManager and PositionManager contracts across multiple chains:

Events indexed: - Initialize - pool creation with fee, tick spacing, and hooks - Swap - all swaps with amounts, price, liquidity, and transaction details - ModifyLiquidity - liquidity additions and removals - Donate - donations to pools - Transfer / Approval - ERC-6909 token transfers and approvals

Chains: Ethereum, Optimism, Base, Arbitrum, Polygon, Blast, Zora, Avalanche, BNB Chain, Unichain, World Chain, Soneium, Ink, Linea, Celo

What's Indexed

The GraphQL API exposes pool statistics, swap history, liquidity positions, and ERC-6909 token data across all supported chains. You can use this to power analytics dashboards, trading interfaces, liquidity trackers, hook monitors, and cross-chain Uniswap V4 data aggregations.

Prerequisites

Quick Start

# Install dependencies
pnpm i

# Run locally (starts indexer + GraphQL API at http://localhost:8080)
pnpm envio dev

The Hasura console is available at http://localhost:8080 where you can explore and query indexed data using GraphQL.

Regenerate Files

If you modify config.yaml or schema.graphql:

pnpm codegen

RPC Configuration

RPC endpoints for each chain can be customized via environment variables prefixed with ENVIO_. See .env.example for the full list:

ENVIO_MAINNET_RPC_URL=https://your-mainnet-node
ENVIO_ARBITRUM_RPC_URL=https://your-arbitrum-node

Querying the Data

Once running, query the GraphQL API to explore pool and swap data:

{
  Pool(limit: 10, order_by: {volumeUSD: desc}) {
    id
    token0 { symbol }
    token1 { symbol }
    volumeUSD
    totalValueLockedUSD
  }
}

Built With

Documentation

Contributing

This indexer is open to contributions. Open an issue or pull request on GitHub.

Support

Extension points exported contracts — how you extend this code

NativeTokenDetails (Interface)
(no doc)
src/utils/chains.ts
ChainConfig (Interface)
(no doc)
src/utils/chains.ts
StaticTokenDefinition (Interface)
(no doc)
src/utils/chains.ts

Core symbols most depended-on inside this repo

mulShift
called by 19
src/utils/liquidityMath/tickMath.ts
sanitizeBD
called by 10
src/utils/index.ts
safeDiv
called by 5
src/utils/index.ts
getChainConfig
called by 5
src/utils/chains.ts
findNativePerToken
called by 4
src/utils/pricing.ts
convertTokenToDecimal
called by 4
src/utils/index.ts
sanitizeString
called by 4
src/utils/tokenMetadata.ts
getSqrtRatioAtTick
called by 4
src/utils/liquidityMath/tickMath.ts

Shape

Function 28
Class 8
Method 5
Interface 3
Enum 1

Languages

TypeScript100%

Modules by API surface

test/fastExponentiation.test.ts7 symbols
src/utils/index.ts7 symbols
src/utils/pricing.ts5 symbols
src/utils/chains.ts5 symbols
src/utils/tokenMetadata.ts4 symbols
src/utils/liquidityMath/tickMath.ts4 symbols
src/utils/liquidityMath/sqrtPriceMath.ts4 symbols
src/utils/nativeTokenDetails.ts3 symbols
src/utils/liquidityMath/fullMath.ts3 symbols
src/utils/liquidityMath/liquidityAmounts.ts2 symbols
src/utils/tick.ts1 symbols

For agents

$ claude mcp add uniswap-v4-indexer \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact