Skip to content

velodrome-finance/indexer

Repository files navigation

Multi-chain indexer for Velodrome V2 and Aerodrome

This repo contains the indexer for Velodrome V2 and Aerodrome across multiple chains. The indexer is written in TypeScript using the Envio indexing platform.

Project Structure

  • config.yaml - Defines contracts to index and events to track across multiple chains
  • schema.graphql - Defines the entity structure for the database
  • src/EventHandlers/*.ts - Contains the business logic for processing blockchain events
  • src/cache.ts - Implements caching for blockchain data to reduce RPC calls
  • .env - Contains configuration variables (copy from .env.example and customize)

Key Files in src/

  • Constants.ts - Contains chain-specific constants and configurations
  • Erc20.ts - Helpers for working with ERC20 tokens
  • PriceOracle.ts - Functions for fetching and managing token prices
  • Store.ts - Functions for managing pool address mappings

Installation

Make sure you have pnpm installed (version 9.x+ recommended).

pnpm install

Running the Indexer

Envio provides a simple development workflow:

# Generate code based on your schema and config
pnpm envio codegen

# Start the indexer (eg. inside the existing running container) ...
pnpm envio start
# Or, automatically sets up docker containers and starts indexing
pnpm dev

To stop the indexer:

pnpm envio stop

Testing / QA

# Runs any linters/formatters, use pnpm qa --write to apply changes
pnpm qa
# Runs tests
pnpm test

Documentation

For comprehensive documentation on the Envio indexing platform, please refer to:

About

Envio indexer for Velodrome and Aerodrome

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 10