Configuration
LidoConfig
Initialization
Available Actions
stake
stake
Description: Stake ETH to receive wstETH shares.Parameters:Mechanics:Effects:
amount(u128): Amount of ETH to stake (e18)
- Deducts
amountETH from wallet - Credits
shareswstETH to wallet
unstake
unstake
Description: Burn wstETH shares to receive ETH.Parameters:Mechanics:Effects:
shares(u128): Amount of wstETH shares to burn
- Deducts
shareswstETH from wallet - Credits
amountETH to wallet
wrap
wrap
Description: Convert stETH to wstETH (simplified 1:1 in this model).Parameters:Gas: ~80,000
amount(u128): Amount to wrap
This is a simplified action for compatibility. In production Lido, wrapping uses exchange rate.
Exchange Rate Growth
The exchange rate compounds per tick:View Methods
view_user
Returns user shares and equivalent underlying:view_market
Returns protocol state:Usage Examples
Simple Stake
Lido → Aave Leverage Loop
Sync wstETH Price to Aave
Cross-Protocol Integration
Lido wstETH is typically used as collateral in Aave:Protocol-Specific Behavior
Non-Rebasing Shares
wstETH uses a share-based model (not rebasing):- User receives fixed
shareson stake - Underlying value grows via
exchange_rate_ray - No balance updates required per tick
Exchange Rate Formula
Reward Accrual
Rewards accrue linearly per tick (simplified from real beacon chain rewards):Limitations
Advanced: Deleverage Strategy
When LTV exceeds threshold, unwind position:See Also
- Aave V3 Protocol - Collateral integration
- Protocol Overview - Cross-protocol strategies
- Source:
source/protocols/lido/src/lib.rs