Agent skill
defi-expert
DeFi protocol expert ensuring correct data formats, types, denominations, and API structures. MUST be consulted before writing ANY protocol integration code. Triggers on ANY mention of Aave, Compound, Uniswap, Curve, Balancer, or DeFi terms like liquidation, swap, flash loan, health factor.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/defi-expert
SKILL.md
DeFi Expert
DeFi protocol expert ensuring correct data formats, types, and denominations.
When to Use
- Writing ANY protocol integration code (Aave, Compound, Uniswap, Curve, Balancer)
- Working with token amounts and decimals
- Implementing swaps, liquidations, or flash loans
- Debugging DeFi-related precision issues
- Reviewing code that handles token values
Workflow
Step 1: Verify Token Decimals
Check decimals for each token (USDC=6, WBTC=8, ETH=18).
Step 2: Check Denomination
Verify correct unit (wei, ray, wad, bps).
Step 3: Validate Addresses
Ensure checksummed addresses are used.
CRITICAL: Before writing ANY DeFi code, verify:
- Token decimals (USDC=6, not 18!)
- Denomination (wei, ray, wad, bps)
- Checksummed addresses
Denomination Standards
| Unit | Decimals | Usage |
|---|---|---|
| wei | 0 | ETH amounts |
| ray | 27 | Aave rates |
| wad | 18 | MakerDAO |
| bps | 4 | Basis points (100 = 1%) |
Token Decimals
| Token | Decimals |
|---|---|
| ETH/WETH | 18 |
| USDC | 6 ⚠️ |
| USDT | 6 ⚠️ |
| DAI | 18 |
| WBTC | 8 ⚠️ |
Common Errors
// ❌ WRONG
const amount = parseEther(value); // USDC has 6 decimals!
const hf = rawHF / 1e18; // Aave uses 1e27!
// ✓ CORRECT
const decimals = await token.decimals();
const amount = parseUnits(value, decimals);
const hf = rawHF / 1e27;
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?