An AI agent skill for conducting DeFi on-chain analysis using direct JSON-RPC calls. No APIs, no indexers — raw RPC to verifiable insights.
npx skills add Omnis-Labs/defi-onchain-analyticsOr manually:
git clone https://github.com/Omnis-Labs/defi-onchain-analytics.git ~/.claude/skills/defi-onchain-analyticsGuides AI agents through a looped workflow for on-chain DeFi analysis — supporting scope amendments when discoveries change the question:
- Scoping Gate — Define objectives, unit of analysis, anchor policy, decision dependencies
- Discovery — Contract classification, proxy resolution, interface recovery (first-class step)
- Data Collection — Batch reads, event log scanning, adaptive chunking, traces, bulk scaffolds
- Interpretation — Classification-first analysis with multi-pass adversarial review
- Rescope Decision — New question emerged? Lightweight re-entry to Phase 0. Otherwise proceed.
- Sanity Check — Cross-validation, blind spot audit, gap logging
- Synthesis — Mode-specific output profiles (forensic, due diligence, monitoring, etc.)
- Wallet profiling — Balance snapshots, transfer history, entity clustering, funding trace
- Protocol analysis — TVL decomposition, admin risk, oracle health, governance participation
- DEX analytics — LP position analysis, owner resolution, market structure, bot detection
- CLAMM vault analytics — Rebalance decomposition, fee separation, share-price time series, HODL benchmarks
- Token metrics — Supply audit, holder concentration, vesting schedules
- Contract inspection — Proxy detection, storage layout, event decoding, ABI resolution
| Chain | Chain ID | Public RPC Endpoints | Benchmark Date |
|---|---|---|---|
| Ethereum | 1 | 24 | 2026-03-21 |
| Arbitrum One | 42161 | 14 | 2026-03-21 |
| Base | 8453 | 22 | 2026-03-21 |
| BSC | 56 | 26 | 2026-03-21 |
| Polygon PoS | 137 | 14 | 2026-03-21 |
| Katana | 747474 | 5 | 2026-03-21 |
108 verified endpoints with tier rankings, latency data, and getLogs support markers.
SKILL.md Main looped workflow (396 lines)
├── references/
│ ├── rpc-field-guide.md RPC methods, chunking, L2 guide, explorer APIs
│ ├── rpc-endpoints.ts 108 verified endpoints across 6 chains
│ ├── common-abis.md Objective router for ABI loading
│ ├── abis-core-tokens-vaults.md ERC-20/721/1155/4626 signatures and selectors
│ ├── abis-dex-v3-v4-clamm.md Uniswap V3/V4 and Algebra CLAMM state/events
│ ├── abis-proxy-and-multicall.md EIP-1967 proxy slots and Multicall3
│ ├── abi-fetching.md Proxy detection and ABI resolution
│ ├── scoping-guide.md Phase 0 detailed consultation guide
│ ├── investigation-discipline.md 7-layer anti-shortcutting defense
│ ├── data-collection-scaffold.ts Bulk RPC with rate limiting, endpoint rotation, checkpoint/resume
│ └── proxy-resolver-scaffold.ts Automated proxy chain resolution and selector extraction
└── patterns/
├── wallet-analytics.md Address clustering, funding trace, Sybil detection
├── protocol-analytics.md TVL, lending health, oracle monitoring
├── token-analytics.md Supply audit, holder analysis
├── dex-analytics.md V3 math, LP resolution, bot signals
├── clamm-vault-analytics.md Rebalance decomposition, fee separation, share-price, LVR
└── contract-inspection.md Storage layout, proxy patterns, event decoding
| Tier | Tag | Requires | Free Public RPC? |
|---|---|---|---|
| A | [CORE] |
Standard JSON-RPC | Yes |
| B | [ARCHIVE] |
Historical state >128 blocks | Rarely |
| C | [TRACE] |
debug/trace namespace | No |
| D | [ENRICH] |
External source (Etherscan, Sourcify) | Yes (not RPC) |
Every finding is tagged with its data source tier. Unavailable tiers are disclosed, never silently skipped.
Prevents AI agents from taking analytical shortcuts:
- Anti-Rationalization — Banned dismissal phrases that trigger deeper investigation
- Iterative Depth — Multi-pass analysis with adversarial re-examination
- Anti-Normalization — "Looks normal" is sophistication, not innocence
- Blind Spot Audit — Mandatory disclosure of what was NOT investigated
- Confidence Deepening — Low confidence on significant findings → must dig deeper
- Adversarial Self-Review — Devil's Advocate questions per finding
- Gap Logging — Every skipped method logged with impact
Production-ready eth_getLogs chunking with:
- Per-provider block range limit table (Alchemy, Infura, dRPC, etc.)
- Error code recognition (
-32005,-32602,-32614) - TypeScript + viem code template with bisection
- Block explorer API fallback (Blockscout, Etherscan)
- Uniswap V3/V4 — Full ABI reference, math formulas, position analytics
- Algebra CLAMM — Delta vs V3 (Camelot, QuickSwap, Katana DEX)
- ERC-4626 Vaults — Share/asset conversion, deposit/withdraw analysis
- L2 Chains — Block cadence, finality semantics, bridge tracing
Works with any agent that supports the skills format:
Contributions welcome. The most impactful contributions are:
- New chain endpoints — Add verified RPC endpoints to
references/rpc-endpoints.ts - Pattern expansions — Extend analytical methods in
patterns/files - ABI references — Add protocol ABIs to the appropriate split file in
references/(abis-core-tokens-vaults.md,abis-dex-v3-v4-clamm.md, orabis-proxy-and-multicall.md) - Bug reports — Real-world cases where the skill gave incorrect guidance