Skip to main content
ClaudeWave
Skill714 repo starsupdated 3d ago

defi-overview

One-pass crypto read - tracked-protocol positions and health plus macro context, with regime take, DeFi verdict, biggest movers, yields, fees, breadth, Fear & Greed, and prediction markets.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/aeonfun/aeon /tmp/defi-overview && cp -r /tmp/defi-overview/skills/defi-overview ~/.claude/skills/defi-overview
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

<!-- autoresearch: variation B — sharper output via regime verdict + Market Take + sustainable-vs-incentive yield split + fees fundamentals + per-mover "why it matters". Consolidated: folds in defi-monitor (tracked-protocol positions/health) and market-context (broad crypto macro + memory/topics/market-context.md refresh) so one run covers positions + macro in a single pass. -->

> **${var}** — Scope selector. **Empty → full combined overview** (tracked-protocol positions + macro context). `positions` → positions facet only (all watched positions); `positions:<label>` → a single tracked position by label. `macro` → macro facet only. **Any other value** → treat as a chain or protocol focus (e.g. `solana`, `aave`, `arbitrum`) applied to the macro read; positions are filtered to that chain when applicable.

Read `memory/MEMORY.md` for context. Read the last 2 days of `memory/logs/` to avoid repeating numbers, to diff position values over time, and to cite yesterday's figure when flagging today's change. Read `memory/on-chain-watches.yml` (tracked positions) and the existing `memory/topics/market-context.md` (prior macro snapshot) — both are inputs below.

## 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. On top of the market read this skill also (a) checks the operator's **tracked-protocol positions** for health/liquidation/yield-drift risk, and (b) refreshes the **decision-ready macro context** file that downstream skills (token-pick, narrative-tracker) consume — all in one pass.

## Facets & var routing

The skill has two facets. `${var}` selects which run and how to scope them:

- **Empty** → run **both** facets: Positions **and** Macro. This is the comprehensive default.
- `positions` → **Positions facet only**, all watched positions.
- `positions:<label>` → Positions facet only, restricted to the position whose `label` matches `<label>`.
- `macro` → **Macro facet only** (DeFi market read + broad crypto context + `market-context.md` refresh).
- **Any other value** → Macro facet, run in **focus mode**:
  - 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; filter positions (if the Positions facet also runs) to that chain.
  - matches a protocol slug in `/protocols` → protocol focus: pull `/protocol/{slug}`, `/summary/fees/{slug}`, `/summary/dexs/{slug}` if it is a DEX; compare against its chain and its 30-day self.
  - matches neither → proceed as a full macro overview and note `var unresolved: ${var}` in the footer.

When both facets run (empty var), send **one** combined notification (Take → position alerts if any → DeFi read → macro snapshot) and still write `memory/topics/market-context.md`.

---

# FACET A — Positions (tracked-protocol health)

*(Runs when `${var}` is empty, `positions`, `positions:<label>`, or a chain focus. Skip entirely for `macro`.)*

## Position config

Watched contracts and positions live **entirely** in `memory/on-chain-watches.yml` — no protocols are hardcoded in this skill. If the file is missing or has no `type: pool` / `type: position` entries, log `DEFI_MONITOR_NO_CONFIG` for this facet and skip it cleanly (no notification — an empty config is not an error; the Macro facet still runs when applicable).

```yaml
# memory/on-chain-watches.yml
watches:
  - label: My Wallet
    address: "0x1234...abcd"
    chain: ethereum
    rpc_url: https://eth.llamarpc.com
    type: wallet
    threshold: 0.1  # ETH — alert on balance changes above this

  - label: Uniswap Pool
    address: "0xabcd...5678"
    chain: ethereum
    rpc_url: https://eth.llamarpc.com
    type: contract
```

## Steps — Positions

### A1. Query each DeFi position

For each DeFi position in `memory/on-chain-watches.yml` (`type: pool` or `type: position`), filtered by `${var}` if a label (`positions:<label>`) or chain focus is set:

- Query the contract for current state using `eth_call`:
  ```bash
  # Example: read slot0 from a Uniswap-style pool
  curl -s -X POST "${rpc_url}" \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_call","params":[{"to":"'"$address"'","data":"'"$calldata"'"},"latest"],"id":1}'
  ```
- For known protocols, query standard view functions:
  - Liquidity pools: `totalSupply`, reserves, current tick/price
  - Lending: `supplyRate`, `borrowRate`, utilization
  - Staking: earned rewards, APR

### A2. Compare against last logged values

Compare current values against the last logged values for each position (grep prior runs in `memory/logs/`).

### A3. Flag anything noteworthy

- Yield rate change > 20%
- Pool TVL drop > 10%
- Position approaching liquidation
- Impermanent loss exceeding threshold

### A4. Positions output

- **`positions` / `positions:<label>` run:** notify via `./notify` (under 4000 chars) **only if** at least one position produced a noteworthy flag; otherwise log `DEFI_MONITOR_OK` and end (no notification on a quiet run).
- **Combined (empty var) run:** the positions block is included in the single combined notification **only when there is at least one flag**; a quiet positions check contributes nothing to the message (but still logs its per-position values).

Positions block template:

```
*DeFi Monitor — ${today}*

*Pool/Protocol Label* (chain)
TVL: $X | APR: Y%
Your position: details
Change since last check: summary
```

---

# FACET B — Macro (DeFi market read + crypto context)

*(Runs when `${var}` is empty, `macro`, or a chain/protocol focus. Skip entirely for `positions` / `positions:<label>`.)*

## Steps — Macro

### B0. Load
aeonSkill

Set up and run an Aeon agent instance — get started from scratch, pick which skills to turn on or install more from packs, reschedule or change what runs, edit what an existing skill does, fix a skill that isn't firing, set the STRATEGY.md north star and soul/ voice, turn a coding-agent chat into a scheduled Aeon skill, and mine past coding-agent conversations for recurring work worth automating as a skill. Use when the user mentions Aeon, aeon.yml, an Aeon skill / instance / routine / pack, asks to schedule, enable, edit, or debug an agent that runs on a cron, or asks what of their repeated/manual work Aeon could take over.

[REPLACE: SKILL_NAME]Skill

Mention/keyword sweep on social platforms for [REPLACE: KEYWORDS] — trends, sentiment, top posts

action-converterSkill

5 concrete real-life actions, leverage-scored against open loops with specificity and anti-fluff gates

aeon-doctorSkill

Static config-correctness linter for this instance - catches the silent-failure class (unquoted schedules, duplicate keys, unconfigured skills, mode typos, broken requires/MCP refs) that no run-based health skill can see. Notifies only on problems.

aeon-updateSkill

Pull framework updates from the upstream Aeon repo into this instance - 3-way merges canon's new commits into a PR, never clobbering operator config.

articleSkill

Write a publication-ready article in one of three angles - a trending long-form piece, a watched-repo thesis, or a project-through-a-lens essay. Optional Replicate hero image with --visual.

auto-mergeSkill

Automatically merge open PRs that have passing CI, no blocking reviews, and no conflicts

auto-workflowSkill

Two-mode aeon.yml workflow builder - analyze inspects URLs and emits a tiered, signal-verified skill-enablement plan plus an aeon.yml diff; enable flips slugs to enabled:true and opens a PR.