Skip to content

enviodev/uniswap-v3-indexer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Uniswap V3 Indexer

Discord

A multichain Uniswap V3 subgraph migration built with Envio HyperIndex. Migrated from The Graph subgraph to HyperIndex for faster data access and multichain support.

What's Indexed

The GraphQL API exposes pool statistics, swap history, liquidity positions, fee data, and token metadata across all active chains. You can use this to power analytics dashboards, trading interfaces, liquidity trackers, and cross-chain Uniswap V3 data aggregations.

Events Indexed

From UniswapV3Factory and UniswapV3Pool contracts:

  • PoolCreated - new pool deployments with token pair and fee tier
  • Initialize - pool initialization with price and tick
  • Mint - liquidity additions
  • Burn - liquidity removals
  • Collect - fee collection
  • Swap - all swaps with amounts, price, and liquidity

Active Chains

Ethereum Mainnet, Optimism

Additional chains (Arbitrum, Base, Polygon, BSC, Avalanche, Blast, Unichain) are available in the config and can be enabled.

Notes on Migration from Subgraph

  • All entity IDs that use EVM addresses are stored in lowercase
  • IDs are prefixed with the chain ID: <chainId>-<address> to avoid cross-chain clashes
  • Unlike the original subgraph, tokens do not have a totalSupply field (cannot be updated reliably via events)
  • GraphQL query structure differs from The Graph. See the query conversion guide

Prerequisites

Quick Start

# Install dependencies
pnpm install

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

The GraphQL Playground is available at http://localhost:8080. Local password: testing.

Regenerate Files

pnpm codegen

Sample Queries

# Get ETH price
{
  Bundle {
    ethPriceUSD
    id
  }
}
# Get pools with liquidity
{
  Pool(limit: 10, order_by: {totalValueLockedUSD: desc}) {
    id
    liquidity
    token0 { symbol decimals }
    token1 { symbol decimals }
    totalValueLockedUSD
    volumeUSD
  }
}
# Get whitelisted tokens
{
  Token(where: {isWhitelisted: {_eq: true}}) {
    id
    name
    symbol
    decimals
    poolCount
  }
}

Built With

Documentation

Support

About

Envio indexer for Uniswap V3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors