Cycles
Core Purpose
Cycles are approximately 24-hour periods that provide a structured framework for all state changes within the SherpaEarn vault. Think of cycles as the vault's "heartbeat" - each representing one complete sequence of vault operations. The settling of deposits and withdrawals, the synchronizing of global vault states, and modulating the shUSD pricing mechanism at the core of the vault.
Fairly paying back USDC to prior depositors who want to withdraw and delegating new shares to users who want to deposit is essential. Such values must be calculated both carefully and economically. Instead of updating the price of shUSD continuously (which would be expensive, complex, and introduce technical vulnerabilities, the vault:
Collects all deposits and withdrawal requests during a round
Processes them together when the round ends
Updates the price based on actual yield earned
This ensures everyone gets the same fair price for the same round.
Timeframe & Lifespan Limitations
A cycle's duration does not have hardcoded timeframes. They rely on an offchain keeper bot to maintain a steady rhythm and advance the vault approximately every 24 hours. Note that there can be yield reporting delays which may interfere with this consistent rhythm for short periods of time. If one cycle runs longer, the next will be adjusted to run shorter to keep the 24 hour average consistent. The vault can run for 65,535 cycles (equal to roughly 180 years) before its service life is consumed.

Last updated

