What problem does it solve?
Silent decimal mismatches are a common, hard-to-debug issue that causes EVM token balances and their fiat values to be off by orders of magnitude without throwing any runtime errors, leading to financial loss or incorrect user-facing data.
Core Features & Use Cases
- Runtime Decimal Lookup: Queries the on-chain decimals() function for every token at runtime instead of relying on hardcoded values.
- Chain-Aware Caching: Caches decimal values keyed by chain ID and token address to reduce unnecessary RPC calls.
- Bridged Token Support: Handles precision drift for wrapped and bridged assets that may have different decimals across chains.
- Use Case: Ideal for developers building DeFi tools, portfolio trackers, trading bots, or dashboards that display token balances or calculate fiat values.
Quick Start
Use the evm-token-decimals skill to safely calculate the correct USD value of an ERC-20 token balance on any EVM chain, accounting for the token's actual on-chain decimal precision.