evm-token-decimals

Fetch token decimals at runtime with chain-aware caching for EVM chains.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/thangvawn/agent_financial --skill evm-token-decimals-thangvawn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: evm-token-decimals
Source: https://github.com/thangvawn/agent_financial/tree/main/.cursor/skills/evm-token-decimals
Command: npx skills add https://github.com/thangvawn/agent_financial --skill evm-token-decimals-thangvawn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires web3.py, and includes scripts (resource) components.

What problem does it solve?

This Skill prevents silent decimal mismatch bugs across EVM chains, ensuring accurate financial calculations and avoiding costly errors.

Core Features & Use Cases

  • Runtime Decimal Lookup: Dynamically fetches token decimals at runtime to avoid hardcoded values.
  • Chain-Aware Caching: Caches decimals by chain and token address for efficient lookups.
  • Bridged-Token Precision Drift Handling: Mitigates precision drift when dealing with bridged tokens.
  • Safe Normalization: Ensures consistent normalization for bots, dashboards, and DeFi tools.

Quick Start

Use the evm-token-decimals skill to fetch the decimal value for a token on a specific chain.

Frequently Asked Questions about evm-token-decimals

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent silent EVM token decimal mismatches in DeFi calculations?

Preventing silent EVM token decimal mismatches requires fetching token decimals at runtime rather than hardcoding them. This approach ensures accurate financial calculations and mitigates costly errors across different EVM chains.

Why does bridged-token precision drift break my smart contract calculations?

Bridged-token precision drift breaks calculations because bridged tokens can have altered decimal values on destination chains. Handling this drift requires chain-aware caching and runtime decimal lookups to maintain normalization accuracy.

What's the best way to dynamically fetch token decimals across multiple EVM chains?

The best way to fetch token decimals across multiple EVM chains is using runtime lookups combined with chain-aware caching. This method caches decimals by chain and token address to ensure efficient and accurate lookups for DeFi tools.

Do I need web3.py to perform runtime decimal lookups for EVM tokens?

Yes, you need web3.py to interact with smart contracts and perform financial calculations. It provides the necessary infrastructure to query token contracts dynamically and retrieve accurate decimal values for normalization.

How does chain-aware caching improve token decimal normalization for DeFi bots?

Chain-aware caching improves token decimal normalization by storing decimal values indexed by chain and token address. This ensures DeFi bots and dashboards retrieve consistent precision data efficiently without repeated network calls.

Can I use hardcoded token decimals for EVM financial calculations on dashboards?

Using hardcoded token decimals for EVM financial calculations is unsafe due to potential precision drift and silent mismatches. Safe normalization requires dynamically querying decimals at runtime to ensure dashboard accuracy.