dex-analysis
Installation
SKILL.md
DEX Analysis
The most common DEX-analysis mistake isn't a wrong table — it's treating a per-hop or per-side data model as if it were per-swap or per-trade. Check the grain of the table before aggregating.
Trade rows are often per-hop, not per-swap
Multi-hop routes (A→B→C) can produce 2-3 trade rows for what the user experienced as one swap. This inflates both volume and row counts — one real comparison found ~1.3x inflation vs. an external source on a specific chain purely from hop fan-out.
- Compare
COUNT(*)vs.COUNT(DISTINCT transaction_hash)on a trades table before trusting a volume/count total — a large gap between them is the signature of multi-hop fan-out. - When you need to compare volume against an external aggregator (DefiLlama, etc.),
either divide by the observed hop ratio or aggregate at
transaction_hashgrain first.