A lightweight, high-performance Prometheus exporter that monitors ERC-20 token balances and gas (native token) balances across multiple EVM-compatible chains.
The exporter:
- polls one or more wallet addresses
- queries all configured ERC-20 tokens per chain
- fetches gas/native-asset balances
- exposes all results as Prometheus metrics
- supports custom RPC providers (Alchemy by default)
- Multi-chain support (Base, Base Sepolia, XMTP Ropsten, etc.)
- ERC-20 token balance monitoring
- Gas/native token monitoring
- Prometheus-native metrics
git clone https://github.com/xmtp/tokenexporter
cd tokenexporter
go build ./cmd/tokenexporter
Or run it directly:
go run ./cmd/tokenexporter
Example:
{
"chains": [
{
"name": "base",
"chainid": 84532,
"root": "base-sepolia.g.alchemy.com",
"gas": { "decimals": 18 },
"tokens": [
{
"address": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"symbol": "USDC",
"decimal": 6
}
]
}
]
}
alice:0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
bob:0xBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
Each line is: name:0xAddress
export APIKEY=your-alchemy-key
export PORT=9102
Basic usage
./tokenexporter --apikey YOUR_KEY
Full CLI
./tokenexporter \
--apikey <alchemy-key> \
--port 9102 \
--addresses ./addresses.txt \
--tokens ./tokens-list.json
The exporter exposes only custom metrics thanks to a custom Prometheus registry (no Go runtime metrics).
ERC-20 token balance
token_balance{
name="alice",
symbol="USDC",
contract="0x....",
address="0x....",
chain="base"
} 123.45
Native gas balance
gas_balance{
name="alice",
address="0x....",
chain="base"
} 0.0023