From everything-claude-trading
- Analyzing DeFi protocol mechanics for trading or yield opportunities
npx claudepluginhub brainbytes-dev/everything-claude-tradingThis skill uses the workspace's default tool permissions.
- Analyzing DeFi protocol mechanics for trading or yield opportunities
Provides Ktor server patterns for routing DSL, plugins (auth, CORS, serialization), Koin DI, WebSockets, services, and testApplication testing.
Conducts multi-source web research with firecrawl and exa MCPs: searches, scrapes pages, synthesizes cited reports. For deep dives, competitive analysis, tech evaluations, or due diligence.
Provides demand forecasting, safety stock optimization, replenishment planning, and promotional lift estimation for multi-location retailers managing 300-800 SKUs.
Constant Product (Uniswap v2):
Concentrated Liquidity (Uniswap v3):
Curve StableSwap:
Aave/Compound Mechanics:
Aave v3 Features:
Validator Economics (Ethereum PoS):
Liquid Staking:
1. Select pair and fee tier based on expected volatility
2. Analyze historical price distribution to determine range
- Tighter range = more fees when in range, more rebalancing when out
- Rule of thumb: set range to cover 1-2 standard deviations of expected price movement
3. Calculate expected fee income vs impermanent loss
4. Monitor position: rebalance when price exits range or when IL exceeds fee income
5. Account for gas costs — rebalancing on Ethereum mainnet costs $20-100+
1. Compare supply/borrow rates across protocols for the same asset
2. Check utilization rates — high utilization means withdrawal risk
3. Evaluate liquidation risk: model collateral drawdown scenarios
4. Consider recursive leverage: supply ETH, borrow stablecoin, buy more ETH
- Effective leverage = 1 / (1 - LTV); at 80% LTV = 5x effective leverage
- Risk: liquidation cascade if collateral drops sharply
5. Monitor governance proposals that could change parameters
Pool: 3pool (DAI/USDC/USDT)
A parameter: 2000
TVL: $500M
Daily volume: $50M
Fee: 0.01%
Analysis:
- Volume/TVL ratio: 10% daily — healthy utilization
- With A=2000, slippage on $1M trade: ~0.002%
- Base APY from fees: ~3.65% (10% * 0.01% * 365)
- CRV emissions add 5-15% depending on gauge weight and boost
- Risk: USDT depeg would break the amplification assumption
Strategy: Supply ETH, borrow USDC, buy ETH, repeat
ETH LTV on Aave v3: 82.5%
Liquidation threshold: 86%
3 loops:
- Deposit 10 ETH ($20,000)
- Borrow $16,500 USDC (82.5% LTV)
- Buy 8.25 ETH, deposit
- Borrow $13,612 USDC
- Buy 6.8 ETH, deposit
Effective position: ~25 ETH exposure on 10 ETH collateral (2.5x leverage)
Liquidation price: approximately 18% below entry
Borrow cost: ~3% APR on total borrowed
Net cost of leverage: ~3% * 1.5 (leverage ratio) = 4.5% annual drag
Risk: If ETH drops 15%+ rapidly, liquidation cascade. Health factor
must be monitored continuously. Consider using Aave's e-mode if
available for the pair.
Observation:
- stETH trading at 0.97 ETH on Curve
- Lido withdrawals enabled with 3-day queue
- Fair value: 1.0 ETH (minus small time value discount)
Trade:
- Buy stETH at 0.97 on Curve
- Submit withdrawal request to Lido
- Receive 1.0 ETH after withdrawal period
- Profit: 3% minus gas costs and opportunity cost of capital lockup
Risk factors:
- Withdrawal queue could extend during high demand
- Smart contract risk during withdrawal process
- stETH discount could widen further before withdrawal completes
Before deploying capital into DeFi protocols, verify: