$npx -y skills add sendaifun/solana-new --skill defillama-researchResearch DeFi protocols and market opportunities using DefiLlama data. Use when a user says "show me TVL data", "which protocols are growing", "DeFi market research", "what should I build in DeFi", "find DeFi opportunities", "analyze protocol TVL", or "which chains are trending".
| 1 | ## Preamble (run first) |
| 2 | |
| 3 | ```bash |
| 4 | _TEL_TIER=$(cat ~/.superstack/config.json 2>/dev/null | grep -o '"telemetryTier": *"[^"]*"' | head -1 | sed 's/.*"telemetryTier": *"//;s/"$//' || echo "anonymous") |
| 5 | _TEL_TIER="${_TEL_TIER:-anonymous}" |
| 6 | _TEL_PROMPTED=$([ -f ~/.superstack/.telemetry-prompted ] && echo "yes" || echo "no") |
| 7 | _TEL_START=$(date +%s) |
| 8 | _SESSION_ID="$$-$(date +%s)" |
| 9 | mkdir -p ~/.superstack |
| 10 | echo "TELEMETRY: $_TEL_TIER" |
| 11 | echo "TEL_PROMPTED: $_TEL_PROMPTED" |
| 12 | if [ "$_TEL_TIER" != "off" ]; then |
| 13 | _TEL_EVENT='{"skill":"defillama-research","phase":"idea","event":"started","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"}' |
| 14 | echo "$_TEL_EVENT" >> ~/.superstack/telemetry.jsonl 2>/dev/null || true |
| 15 | _CONVEX_URL=$(cat ~/.superstack/config.json 2>/dev/null | grep -o '"convexUrl":"[^"]*"' | head -1 | cut -d'"' -f4 || echo "") |
| 16 | [ -n "$_CONVEX_URL" ] && curl -s -X POST "$_CONVEX_URL/api/mutation" -H "Content-Type: application/json" -d '{"path":"telemetry:track","args":{"skill":"defillama-research","phase":"idea","status":"success","version":"0.2.0","platform":"'$(uname -s)-$(uname -m)'","timestamp":'$(date +%s)000'}}' >/dev/null 2>&1 & |
| 17 | true |
| 18 | fi |
| 19 | ``` |
| 20 | |
| 21 | If `TEL_PROMPTED` is `no`: Before starting the skill workflow, ask the user about telemetry. |
| 22 | Use AskUserQuestion: |
| 23 | |
| 24 | > Help superstack get better! We track which skills get used and how long they take — |
| 25 | > no code, no file paths, no PII. Change anytime in `~/.superstack/config.json`. |
| 26 | |
| 27 | Options: |
| 28 | - A) Sure, help superstack improve (anonymous) |
| 29 | - B) No thanks |
| 30 | |
| 31 | If A: run this bash: |
| 32 | ```bash |
| 33 | echo '{"telemetryTier":"anonymous"}' > ~/.superstack/config.json |
| 34 | _TEL_TIER="anonymous" |
| 35 | touch ~/.superstack/.telemetry-prompted |
| 36 | ``` |
| 37 | |
| 38 | If B: run this bash: |
| 39 | ```bash |
| 40 | echo '{"telemetryTier":"off"}' > ~/.superstack/config.json |
| 41 | _TEL_TIER="off" |
| 42 | touch ~/.superstack/.telemetry-prompted |
| 43 | ``` |
| 44 | |
| 45 | This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely and proceed to the skill workflow. |
| 46 | |
| 47 | > **Wrong skill?** See [SKILL_ROUTER.md](../../SKILL_ROUTER.md) for all available skills. |
| 48 | |
| 49 | # DefiLlama Research |
| 50 | |
| 51 | ## Overview |
| 52 | |
| 53 | Use DefiLlama's API to research the DeFi landscape on Solana and across chains. TVL (Total Value Locked) is the primary trust metric — protocols with real TVL have real users with real money at stake. Use this data to identify what's working, what's growing, and where the gaps are. |
| 54 | |
| 55 | ## Workflow |
| 56 | |
| 57 | 1. Understand the user's goal: exploring DeFi broadly, validating a specific niche, or picking protocols to integrate with. |
| 58 | 2. Read [references/defillama-api-guide.md](references/defillama-api-guide.md) for the available endpoints and how to query them. |
| 59 | 3. Read [references/tvl-as-trust-metric.md](references/tvl-as-trust-metric.md) to understand how to interpret TVL data. |
| 60 | 4. Read [references/defi-opportunity-framework.md](references/defi-opportunity-framework.md) for spotting opportunities from the data. |
| 61 | 5. Query the DefiLlama API to pull relevant data: |
| 62 | - `/protocols` for all protocols with TVL |
| 63 | - `/v2/chains` for chain-level TVL |
| 64 | - `/overview/dexs` for DEX volume data |
| 65 | - `/overview/fees` for fee/revenue data |
| 66 | - `/pools` for yield data (base URL: `https://yields.llama.fi`) |
| 67 | - `/stablecoins` for stablecoin flow data (base URL: `https://stablecoins.llama.fi`) |
| 68 | 6. Analyze and present findings with concrete recommendations. |
| 69 | |
| 70 | ## Non-Negotiables |
| 71 | |
| 72 | - Always use real-time DefiLlama data, not stale numbers. The API is free and fast. |
| 73 | - TVL alone is not enough. Cross-reference with fees/revenue, user count, and growth trends. |
| 74 | - When recommending protocols to build on, check if they have an SDK, open API, or composable contracts. |
| 75 | - Distinguish between "high TVL = trusted" and "high TVL = opportunity". A $10B protocol is trusted but hard to compete with. A $10M protocol growing 50% monthly is the opportunity. |
| 76 | - Always filter for Solana data when the user is building on Solana, unless they ask for cross-chain. |
| 77 | - Flag protocols with declining TVL — they may be losing trust or users. |
| 78 | - Present data in tables with clear rankings. |
| 79 | |
| 80 | ## Phase Handoff |
| 81 | |
| 82 | This skill is **Phase 1 (Idea)** in the Idea → Build → Launch journey. |
| 83 | |
| 84 | After research, write/update `.superstack/idea-context.md` (create if missing) with a `defi_research` field containing: |
| 85 | - `top_protocols`: array of { name, tvl, tvl_change_7d, category, chain } |
| 86 | - `opportunities`: array of identified gaps or underserved niches |
| 87 | - `recommended_integrations`: protocols with SDKs/APIs worth building on |
| 88 | - `market_snapshot`: { total_solana_tvl, top_category, fastest_growing_category } |
| 89 | |
| 90 | See `../../../data/specs/phase-handoff.md` for the full JSON contract. |
| 91 | |
| 92 | ## Resources |
| 93 | |
| 94 | ### refere |