# 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. &#x20;

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.

<figure><img src="/files/s6YunTlwdmodmGweARqQ" alt=""><figcaption><p>Progress bar tracking the remaining time until the cycle will advance.</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sherpa.trade/sherpaearn-vault/cycles.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
