A comprehensive API service for Axelar's blockchain data, providing TVL calculations, token information, cross-chain analytics, and real-time blockchain data management.
Before you begin, ensure you have the following installed:
Follow the instructions on its repo.
# Install the project's version
nvm use
# Verify installation
node --version # Should show v20.19.4
# Enable pnpm
corepack enable pnpmpnpm iThis project has TypeScript support configured:
# Build TypeScript files
pnpm run build
# Build and watch for changes
pnpm run build:watch
# Clean build output
pnpm run cleanThe built files are located in the dist directory.
For local development, refer to the local directory.
This project uses ESLint for linting and Prettier for code formatting:
# Check linting
pnpm run lint:check
# Fix linting issues automatically
pnpm run lint
# Check code formatting
pnpm run format:check
# Format code automatically
pnpm run format
# Run both linting and formatting
pnpm run lint:format- mainnet: https://api.axelarscan.io/api
- testnet: https://testnet.api.axelarscan.io/api
- AWS Lambda
- AWS API Gateway
- AWS EventBridge
- OpenSearch (for caching and indexing)
The TVL system is built using caching and background processing.
-
getTVLFunction (methods/tvl/getTVL.js)- Calculates TVL across all supported assets and chains
- Supports caching for fast response times
- Processes 31+ assets across 70+ blockchain networks
-
Background Update Service (
services/interval-update/updateTVL.js)- Runs periodically to pre-calculate TVL data
- Processes assets in batches to avoid timeouts
- Only runs on mainnet in production
-
OpenSearch Caching (
services/indexer/)- Stores calculated TVL data for fast retrieval
- Manages IBC channel data and token information
- Provides search and query capabilities
Production Behavior:
- Background job processes assets in 10 groups over 10-minute intervals
- Each asset is calculated individually and cached immediately
- API calls return cached data (sub-second response times)
- Only processes ~3 assets per 6-minute window
Cache Parameters:
forceCache: true- Forces fresh calculation, bypasses cacheisIntervalUpdate: true- Indicates background job executioncustomAssetsOnly: true- Processes only custom/contract assets
Cache Collections:
token_tvls- Individual asset TVL dataibc_channels- Inter-blockchain communication channel datatoken_prices- Token price informationtoken_infos- Token metadata and configuration
- Production: Sub-second response (cached data)
- Local Development: 5-10 minutes (full calculation)
- Background Processing: ~3 assets per 6-minute window
- Total Operations: 31 assets × 71 chains = 2,201 blockchain queries
For local development setup and usage instructions, see local/README.md.
Quick start:
# Setup OpenSearch indices and populate IBC data
node local/setup-indexer.js
# Pre-populate cache data (recommended)
node local/run-updates.js
# Run the dev server
pnpm devpnpm i
cd ./terraform/testnet
terraform init
terraform apply