Overview
The Yield Calculator lets you model potential returns before investing. Input any amount of STX or sBTC, select a protocol, and see projected earnings across daily, weekly, monthly, and yearly timeframes with compound growth visualization.Key Features
Multi-Asset Support
Calculate yields for both STX and sBTC holdings
Live Protocol Data
APY rates pulled from DefiLlama every 5 minutes
Compound Modeling
Toggle compounding to see exponential growth over 12 months
Break-Even Analysis
See how long until your investment grows 10%
How It Works
Input Configuration
Set Investment Amount
Enter the amount you want to invest:Switch between STX and sBTC for automatic USD conversion:
- STX: Multiplied by current STX price (~$0.26)
- sBTC: Multiplied by Bitcoin price (~$68,000)
Select Protocol
Choose from all Stacks DeFi protocols:
- StackingDAO - 9.5% APY (Low Risk)
- Velar Finance - 12% APY (Medium Risk)
- Zest Protocol - 15% APY (High Risk)
- ALEX - 10% APY (Medium Risk)
- And more…
- Logo and name
- Risk badge (Low/Medium/High)
- Current APY from live data
Calculation Logic
Return Projections
The calculator uses precise compound interest formulas:Break-Even Time
Calculates months to reach 10% growth:Output Display
Return Grid
Four time periods with color-coded gains:- USD value in green (primary)
- Token equivalent in muted text (STX or BTC)
APY Summary Card
Highlights selected protocol:- Large APY percentage in Bitcoin orange
- Protocol name and type
- Risk badge (color-coded)
- 2x2 grid of return projections
Compound Growth Chart
12-month visualization using Recharts:- Bitcoin orange gradient fill
- Interactive tooltips with exact values
- Responsive to window size
- Month labels (M1-M12)
Risk Indicators
Risk badges help you evaluate protocol safety:
Low Risk (Green)
- Audited smart contracts
- Established protocols (StackingDAO)
- Conservative yields (5-10% APY)
- High TVL (Total Value Locked)
Medium Risk (Orange)
- Some audit coverage
- Growing protocols (Velar, ALEX)
- Moderate yields (10-15% APY)
- Medium TVL
High Risk (Red)
- New or unaudited contracts
- Experimental protocols
- High yields (15%+ APY)
- Lower TVL
Real-World Example
Scenario: 5,000 STX in StackingDAO
Input:- Amount:
5000 - Asset:
STX - Protocol:
StackingDAO - APY:
9.5% - Compound:
ON
Code Reference
Key implementation files:- Page:
src/pages/YieldCalculator.jsx- Main calculator UI - Hook:
src/hooks/useProtocolData.js- Live APY data - Service:
src/services/defiLlamaService.js- Protocol data fetching - Formulas:
src/pages/YieldCalculator.jsx:16-36- Return calculations
Advanced Usage
Comparing Multiple Protocols
Example comparison for 1,000 STX:| Protocol | APY | Yearly Return | Risk |
|---|---|---|---|
| StackingDAO | 9.5% | +95 STX | Low |
| Velar | 12% | +120 STX | Medium |
| Zest | 15% | +150 STX | High |
Impact of Compounding
Compounding dramatically increases returns over time: Without Compounding (Simple Interest):- 1 year: +5% more
- 5 years: +28% more
- 10 years: +69% more
Mobile Optimization
The calculator is fully responsive:- Input panel stacks on mobile (< 1024px)
- Chart adjusts to screen width
- Touch-friendly protocol selector buttons
- Readable font sizes on small screens
Data Accuracy
APY data is fetched from DefiLlama every 5 minutes and represents current protocol rates. Actual yields may vary based on:
- Market conditions
- Protocol utilization
- Asset price volatility
- Smart contract performance
… while fetching:
Troubleshooting
APY shows ”—” for some protocols:- Protocol may not report APY to DefiLlama
- Fallback to protocol’s published rate (marked with
~) - Check Protocol Comparison for manual verification
- Ensure amount > 0
- Check browser console for errors
- Try selecting a different protocol
- Recharts library must be loaded
- Verify compound toggle state
- USD conversion uses fixed prices (STX: 68,000)
- Large amounts may show rounding differences
- Calculator assumes constant APY (real yields fluctuate)
Best Practices
Start Small
Test with 10% of intended investment to verify yields
Diversify
Don’t put all funds in highest APY—balance risk
Monitor APY
Rates change—recalculate monthly or when markets shift
Account for Fees
Calculator shows gross yield—subtract gas fees and protocol fees
Next Steps
Protocol Comparison
Compare all protocols side-by-side with TVL and audit status
AI Copilot
Get AI-powered allocation recommendations