DEX Trade Indexing
Index every swap, liquidity event, and pool state change across Uniswap, Curve, Balancer, and 50+ DEXs with sub-second query latency.
A DEX aggregator needs to know the exact state of every pool across every chain -- right now. A trading bot needs the full history of a pair's price action. An analytics dashboard needs to show volume by protocol, by chain, by hour. All of this starts with indexed trade data.
The Challenge
Decentralized exchanges emit swap events at massive scale. Uniswap V3 alone produces thousands of events per hour on Ethereum mainnet. Multiply that across Curve, Balancer, PancakeSwap, and protocol forks on 20+ EVM chains, and you're looking at millions of events per day that need to be captured, decoded, and stored in a queryable format.
Raw RPC polling can't keep up. Subgraph indexing works for single protocols on single chains but breaks down when you need cross-chain, cross-protocol coverage with custom data shapes. And hosted indexing services introduce dependency on third-party uptime and query limits.
How It Works
-
Source: Define which DEX contracts to monitor across your target chains. Indexing Co supports factory-pattern discovery -- when a new Uniswap V3 pool is deployed, it's automatically added to your pipeline.
-
Transform: Write TypeScript handlers that decode swap events into your schema. Extract price, volume, fees, router address, and wallet. Enrich with token metadata from on-chain registries.
-
Deliver: Query via GraphQL API, stream to your PostgreSQL database, or push to a webhook. Median latency from block confirmation to queryable data: 2.54 seconds.
Technical Details
A typical DEX indexing pipeline monitors:
- Swap(address,address,int256,int256,uint160,uint128,int24) events on Uniswap V3 pools
- TokenExchange(address,int128,uint256,int128,uint256) on Curve pools
- Swap(bytes32,address,address,uint256,uint256) on Balancer V2 vaults
Each event is decoded, enriched with pool metadata (token pair, fee tier, TVL), and written to your target. The pipeline handles chain reorgs by maintaining a confirmation depth buffer -- trades are provisional until confirmed.
For cross-chain aggregation, a single pipeline definition can target the same factory contract across Ethereum, Base, Arbitrum, and Optimism. The output schema is unified regardless of source chain.
Results
Teams using Indexing Co for DEX data typically see:
- 10x faster backfill compared to subgraph redeployments -- replay a full year of Uniswap V3 history in under 4 hours
- Sub-3s freshness from block to queryable trade data
- Zero maintenance on new pool discovery -- factory watchers handle it automatically
- Single API for cross-chain, cross-protocol trade queries
Related Content
Start Building
Index your first DEX trades in under 10 minutes. Pick a chain, define your event sources, and start querying.