DeFi Overview
# DeFi Overview This Claude Code skill generates a narrative analysis of decentralized finance market conditions rather than raw data tables. It fetches TVL, trading volumes, yields, and fee data across chains and protocols, then surfaces only the most significant changes and fundamental drivers, explicitly distinguishing sustainable yields from incentive-driven APYs to help readers identify real returns versus speculative rewards. Use this when you need a DeFi market verdict with context on why specific movements matter, whether analyzing the full market or focusing on a particular chain or protocol.
git clone --depth 1 https://github.com/aaronjmars/aeon /tmp/defi-overview && cp -r /tmp/defi-overview/skills/defi-overview ~/.claude/skills/defi-overviewSKILL.md
<!-- autoresearch: variation B — sharper output via regime verdict + sustainable-vs-incentive yield split + fees fundamentals + per-mover "why it matters" -->
> **${var}** — Chain or protocol to focus on (e.g. `solana`, `aave`, `arbitrum`). If empty, full market overview.
Read `memory/MEMORY.md` for context. Read the last 2 days of `memory/logs/` to avoid repeating numbers and to cite yesterday's figure when flagging today's change.
## Thesis
The original produced a table of numbers. This version produces a **read of the market**: one verdict line at the top, then only items that *changed* or *matter*, each with a one-line reason a reader should care. TVL alone is lagging and emission-subsidized — we pair it with fees/revenue (real fundamentals) and split yields into sustainable (`apyBase`) vs incentive-driven (`apyReward`) so readers stop chasing scam-tier APYs.
## Focus mode
- `var` empty → full market overview.
- `var` matches a chain name in `/v2/chains` (case-insensitive) → chain focus: scope DEX volume, fees, and yields to that chain; keep a 2-line market header for context.
- `var` matches a protocol slug in `/protocols` → protocol focus: pull `/protocol/{slug}`, `/summary/fees/{slug}`, `/summary/dexs/{slug}` if DEX; compare against its chain and its 30-day self.
- `var` matches neither → proceed as full overview and note `var unresolved: ${var}` in the footer.
## Steps
### 1. Fetch (public, no auth — use WebFetch if curl fails)
```bash
# TVL
curl -fsS "https://api.llama.fi/v2/chains" > .tmp/chains.json
curl -fsS "https://api.llama.fi/protocols" > .tmp/protocols.json
# Volumes & fundamentals (these are the endpoints the old version was missing)
curl -fsS "https://api.llama.fi/overview/dexs?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true" > .tmp/dexs.json
curl -fsS "https://api.llama.fi/overview/fees?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true" > .tmp/fees.json
# Stablecoins
curl -fsS "https://stablecoins.llama.fi/stablecoins?includePrices=false" > .tmp/stables.json
# Yields
curl -fsS "https://yields.llama.fi/pools" > .tmp/pools.json
```
For each endpoint, if curl fails or returns non-JSON, retry once with **WebFetch** against the same URL. Mark the source `ok` or `fail` — carry this into the footer. Never block the whole run on a single source.
`/protocols` and `/v2/chains` already include `change_1d` / `change_7d` / `tvl` — use these directly, do not diff manually. `/overview/dexs` and `/overview/fees` return `total24h`, `total7d`, `change_1d`, `change_7d`, `change_1m`, `protocols[]`.
If `var` is a chain, additionally fetch `/overview/dexs/{chain}` and `/overview/fees/{chain}` and filter pools by `chain == var`.
### 2. Compute the verdict (ONE line, leads the message)
Score three dimensions from the last 24h:
- `tvl_d = overall TVL change_1d` (sum across `/v2/chains`)
- `vol_d = DEX volume change_1d` (from `/overview/dexs`)
- `stable_d = stablecoin supply change_1d` (sum from `/stablecoins`)
Verdict rules (pick the first that matches):
- All three > +2% → **Risk-on** — capital flowing in across TVL, volume, and stables.
- Two of three < −2% → **Risk-off** — capital unwinding.
- `|tvl_d| < 1% AND |vol_d| < 5%` → **Sideways** — no conviction; grind day.
- Otherwise → **Mixed** — describe the split in ≤12 words (e.g. "TVL drifting up on steady volume, stables flat").
### 3. Pick what goes in the message
Each section caps at 3 items. **Drop any section whose best item fails its inclusion rule** — don't pad.
**Top chains** (3 items): rank by TVL; show `change_1d` only if `|change_1d| >= 1%`, otherwise suppress the delta.
**Movers — chains** (1 up, 1 down): filter `|change_1d| >= 5% AND tvl >= $500M`. Require a ≤15-word "why" grounded in what you observed (unlock, points program, bridge activity, depeg, exploit, launch). If you can't name a cause from the data or memory, write `"no obvious catalyst"` — do not invent one.
**Movers — protocols** (1 up, 1 down): filter `|change_1d| >= 10% AND tvl >= $100M`. Same "why" rule.
**Fundamentals — fees leaders** (top 3 by 24h fees from `/overview/fees`): include `change_1d` in fees vs 7d average. This replaces the old "top protocols by TVL" padding — fees > TVL for real demand.
**Fundamentals — fees-beating-TVL** (up to 2): protocols where `fees change_7d > +20% AND TVL change_7d < +5%`. These are where real demand is outpacing emission-subsidized capital. Skip section if none.
**DEX volume**: 24h total + top 3 DEXes with `change_1d`.
**Stablecoins**: total supply + any single stablecoin with `|change_1d| >= 1%` (usually only notable shifts survive).
**Yields** — split into two sub-sections, **each with a hard filter**:
- **Real yield (sustainable)** — 3 pools max. Filter:
`apyBase > 0 AND apyReward_share < 0.5 AND outlier == false AND predictions.binnedConfidence >= 2 AND apyMean30d >= apy * 0.5 AND tvlUsd >= $10M`.
Rank by `apyBase` descending.
- **Incentive yield (points / emissions)** — 2 pools max. Filter:
`apyReward > 0 AND outlier == false AND tvlUsd >= $25M`. Tag with the reward token symbol. Rank by `apy` descending.
If zero pools survive either filter, omit that sub-section and note it in the footer (`real_yield=0` etc.) — this is itself a signal.
### 4. Compare against yesterday's log
Read `memory/logs/${yesterday}.md`. If a mover appears today whose direction flipped (e.g. chain was top gainer yesterday, now top loser), prepend `↔` and note the reversal in its "why" line. If a yield pool from yesterday's Real-yield list is missing today, check whether it failed a filter (outlier flipped, APY collapsed) — this is worth one line under Yields.
### 5. Notify
Send via `./notify` (single call, under 4000 chars, plain markdown). Template:
```
*DeFi — ${today}* — <Verdict>: <≤12-word regime read>
*TVL:* $X.XXT (+X.X% 24h, +X.X% 7d)
*Top chains*
1. Ethereum — $XXXB (+X.X%)
2. Solana — $XXB (+X.Mention/keyword sweep on social platforms for [REPLACE: KEYWORDS] — trends, sentiment, top posts
5 concrete real-life actions, leverage-scored against open loops with specificity and anti-fluff gates
Curated AI-agent tweets, clustered into narratives with insight summaries
Tracker of AI agent substitution signals — which roles, companies, and industries show real headcount displacement. Named roles + real deployments only.
Competitive-intelligence digest on the AI agent framework space — momentum, releases, breaking changes across a curated watchlist
Cross-domain market pulse from AIXBT's free grounding endpoint — crypto, macro, tradfi, geopolitics. Refreshes taxonomy references (clusters, chains) as a bonus.
Pre-batch API provider health check — detects credit exhaustion or auth failure for every configured provider key before the scheduled batch runs, giving the operator a window to act before skills degrade
List a wallet's live ERC-20 token approvals on Base and flag unlimited / risky spender grants. Keyless via Base RPC (eth_getLogs + eth_call) — no explorer key needed.