YieldCraft is a smart contract designed to aggregate multiple yield protocols, allowing users to efficiently manage and optimize their asset deposits across different DeFi platforms.
- Aggregate multiple yield protocols
- Automatic selection of best-yielding protocol
- Secure asset management
- Flexible protocol addition and management
- Reward calculation and claiming
- Platform fee mechanism
deposit-to-best-protocol
: Deposit assets into the highest-yielding protocolwithdraw-from-protocol
: Withdraw assets from a specific protocolclaim-rewards
: Claim accumulated rewardsadd-protocol
: Add new protocols to the aggregatorupdate-protocol-stats
: Update protocol rates and statistics
- Protocol management with active/inactive states
- User deposit tracking
- Dynamic APY and TVL calculation
- Token validation
- Platform fee calculation
The contract includes comprehensive error codes for scenarios like:
- Unauthorized actions
- Invalid protocols
- Insufficient balances
- Slippage limits
- Protocol activation status
- Minimum deposit: 1,000,000 smallest token units
- Maximum slippage: 0.5%
- Platform fee: 0.1%
- Maximum protocols: 50
- Owner-only protocol management
- Token and protocol address validation
- Deposit and withdrawal checks
- Rewards calculation safeguards
- Stacks blockchain environment
- SIP-010 compatible tokens
- Protocol trait implementation
- Add protocols
- Deposit assets
- Automatically get best yield
- Claim rewards
- Withdraw assets
- Lending protocols
- Staking platforms
- Yield farming strategies
- Limited to 50 protocols
- Requires ongoing manual protocol stats updates
- Protocol additions
- Performance optimizations
- Additional validation logic