Optimizing Staking Rewards
Overview
Analyze staking opportunities across PoS blockchains and liquid staking protocols. Compares APY/APR, calculates net yields after fees, assesses protocol risks, and recommends optimal allocations.
Prerequisites
- Python 3.8+ installed
- Dependencies:
pip install requests
- Network access to DeFiLlama APIs
- Optional: CoinGecko API key for higher rate limits
Instructions
Compare staking options for a specific asset:
python ${CLAUDE_SKILL_DIR}/scripts/staking_optimizer.py --asset ETH
Shows protocol name, type (native vs liquid), gross/net APY, risk score, TVL, and lock-up period.
Analyze with position size for gas-adjusted yields:
python ${CLAUDE_SKILL_DIR}/scripts/staking_optimizer.py --asset ETH --amount 10
Calculates effective APY accounting for gas costs and projects returns at 1M, 3M, 6M, and 1Y.
Optimize existing portfolio with current positions:
python ${CLAUDE_SKILL_DIR}/scripts/staking_optimizer.py --optimize \
--positions "10 ETH @ lido 4.0%, 100 ATOM @ native 18%, 50 DOT @ native 14%"
Suggests higher-yield alternatives with projected improvement and switching costs.
Compare protocols or run risk assessment:
python ${CLAUDE_SKILL_DIR}/scripts/staking_optimizer.py --compare --protocols lido,rocket-pool,frax-ether
python ${CLAUDE_SKILL_DIR}/scripts/staking_optimizer.py --asset ETH --detailed
Export results in JSON or CSV:
python ${CLAUDE_SKILL_DIR}/scripts/staking_optimizer.py --asset ETH --format json --output staking.json
Output
Comparison table ranked by risk-adjusted return (Net APY multiplied by Risk Score / 10), showing native and liquid staking options:
STAKING OPTIONS FOR ETH 2025-01-15 15:30 UTC # 2025 timestamp
Protocol Type Gross APY Net APY Risk TVL Unbond
Frax (sfrxETH) liquid 5.10% 4.59% 7/10 $450M instant
Lido (stETH) liquid 4.00% 3.60% 9/10 $15B instant
Rocket Pool liquid 4.20% 3.61% 8/10 $3B instant
Coinbase cbETH liquid 3.80% 3.42% 9/10 $2B instant
ETH Native native 4.00% 4.00% 10/10 $50B variable
Error Handling
| Error |
Cause |
Solution |
| API timeout |
DeFiLlama unreachable |
Cached data used with warning |
| Invalid asset |
Unknown staking asset |
Lists supported assets |
| Rate limited |
Too many API calls |
Automatic retry with backoff |
| No data found |
Protocol not indexed |
Falls back to known protocol list |
See ${CLAUDE_SKILL_DIR}/references/errors.md for comprehensive error handling.
Examples
Common staking analysis workflows from single-asset comparison to full portfolio optimization:
# Quick ETH staking comparison
python ${CLAUDE_SKILL_DIR}/scripts/staking_optimizer.py --asset ETH
# Large position with full risk analysis
python ${CLAUDE_SKILL_DIR}/scripts/staking_optimizer.py --asset ETH --amount 100 --detailed
# Multi-asset comparison exported to CSV
python ${CLAUDE_SKILL_DIR}/scripts/staking_optimizer.py --assets ETH,SOL,ATOM --format csv
# Portfolio optimization with current positions
python ${CLAUDE_SKILL_DIR}/scripts/staking_optimizer.py --optimize \
--positions "50 ETH @ lido 3.6%, 500 SOL @ marinade 7.5%" # 500 - minimum stake amount in tokens
Resources
1---
2name: optimizing-staking-rewards
3description: |
4 Compare and optimize staking rewards across validators, protocols, and blockchains with risk assessment.
5 Use when analyzing staking opportunities, comparing validators, calculating staking rewards, or optimizing PoS yields.
6 Trigger with phrases like "optimize staking", "compare staking", "best staking APY", "liquid staking", "validator comparison", "staking rewards", or "ETH staking options".
7
8allowed-tools: Read, Write, Edit, Grep, Glob, Bash(crypto:staking-*)
9version: 2.0.0
10author: Jeremy Longshore <jeremy@intentsolutions.io>
11license: MIT
12compatible-with: claude-code, codex, openclaw
13metadata:
14 source: https://skillmd.com/skills/micsapp/optimizing-staking-rewards
15---
16
17# Optimizing Staking Rewards
18
19## Overview
20
21Analyze staking opportunities across PoS blockchains and liquid staking protocols. Compares APY/APR, calculates net yields after fees, assesses protocol risks, and recommends optimal allocations.
22
23## Prerequisites
24
251. **Python 3.8+** installed
262. **Dependencies**: `pip install requests`
273. Network access to DeFiLlama APIs
284. Optional: CoinGecko API key for higher rate limits
29
30## Instructions
31
321. **Compare staking options** for a specific asset:
33 ```bash
34 python ${CLAUDE_SKILL_DIR}/scripts/staking_optimizer.py --asset ETH
35 ```
36 Shows protocol name, type (native vs liquid), gross/net APY, risk score, TVL, and lock-up period.
37
382. **Analyze with position size** for gas-adjusted yields:
39 ```bash
40 python ${CLAUDE_SKILL_DIR}/scripts/staking_optimizer.py --asset ETH --amount 10
41 ```
42 Calculates effective APY accounting for gas costs and projects returns at 1M, 3M, 6M, and 1Y.
43
443. **Optimize existing portfolio** with current positions:
45 ```bash
46 python ${CLAUDE_SKILL_DIR}/scripts/staking_optimizer.py --optimize \
47 --positions "10 ETH @ lido 4.0%, 100 ATOM @ native 18%, 50 DOT @ native 14%"
48 ```
49 Suggests higher-yield alternatives with projected improvement and switching costs.
50
514. **Compare protocols or run risk assessment**:
52 ```bash
53 python ${CLAUDE_SKILL_DIR}/scripts/staking_optimizer.py --compare --protocols lido,rocket-pool,frax-ether
54 python ${CLAUDE_SKILL_DIR}/scripts/staking_optimizer.py --asset ETH --detailed
55 ```
56
575. **Export results** in JSON or CSV:
58 ```bash
59 python ${CLAUDE_SKILL_DIR}/scripts/staking_optimizer.py --asset ETH --format json --output staking.json
60 ```
61
62## Output
63
64Comparison table ranked by risk-adjusted return (Net APY multiplied by Risk Score / 10), showing native and liquid staking options:
65
66```
67 STAKING OPTIONS FOR ETH 2025-01-15 15:30 UTC # 2025 timestamp
68 Protocol Type Gross APY Net APY Risk TVL Unbond
69 Frax (sfrxETH) liquid 5.10% 4.59% 7/10 $450M instant
70 Lido (stETH) liquid 4.00% 3.60% 9/10 $15B instant
71 Rocket Pool liquid 4.20% 3.61% 8/10 $3B instant
72 Coinbase cbETH liquid 3.80% 3.42% 9/10 $2B instant
73 ETH Native native 4.00% 4.00% 10/10 $50B variable
74```
75
76## Error Handling
77
78| Error | Cause | Solution |
79|-------|-------|----------|
80| API timeout | DeFiLlama unreachable | Cached data used with warning |
81| Invalid asset | Unknown staking asset | Lists supported assets |
82| Rate limited | Too many API calls | Automatic retry with backoff |
83| No data found | Protocol not indexed | Falls back to known protocol list |
84
85See `${CLAUDE_SKILL_DIR}/references/errors.md` for comprehensive error handling.
86
87## Examples
88
89Common staking analysis workflows from single-asset comparison to full portfolio optimization:
90
91```bash
92# Quick ETH staking comparison
93python ${CLAUDE_SKILL_DIR}/scripts/staking_optimizer.py --asset ETH
94
95# Large position with full risk analysis
96python ${CLAUDE_SKILL_DIR}/scripts/staking_optimizer.py --asset ETH --amount 100 --detailed
97
98# Multi-asset comparison exported to CSV
99python ${CLAUDE_SKILL_DIR}/scripts/staking_optimizer.py --assets ETH,SOL,ATOM --format csv
100
101# Portfolio optimization with current positions
102python ${CLAUDE_SKILL_DIR}/scripts/staking_optimizer.py --optimize \
103 --positions "50 ETH @ lido 3.6%, 500 SOL @ marinade 7.5%" # 500 - minimum stake amount in tokens
104```
105
106## Resources
107
108- `${CLAUDE_SKILL_DIR}/references/implementation.md` - Optimization reports, risk assessment details, disclaimers
109- `${CLAUDE_SKILL_DIR}/references/errors.md` - Comprehensive error handling
110- DeFiLlama Yields: https://defillama.com/yields
111- StakingRewards: https://www.stakingrewards.com
112- Lido: https://lido.fi | Rocket Pool: https://rocketpool.net