# Lifecycle Model

### Vault States

![State transition model for a single vault](/files/Plp3uZnn1shwpLY2LaxI)

The vault goes through several main states in its operation:

* **Uninitialized** – The vault is deployed but the underlying Balancer Managed Vault has not been funded yet. We distinguish the vault in this state because an unfunded Balancer fund needs to be funded with all assets (once it is live then, liquidity can be added per token)
* **Live** – The vault has been funded with initial capital and is actively controlled by the Vault Guardian. We further distinguish the vault with trading enabled, which means that the underlying Balancer pool is accepting swap trades and not-trading which means that the underlying Balancer pool is not accepting trades
* **Finalizing** – The notice period for finalization has been initiated. Final funds are held until finalizaiton. *Note: initial deployments will have a negligible or 0 notice period*
* **Finalized** – The vault has returned all capital to the treasury owner and no further actions are available

### Vault Functions

![Lifecycle model for a single vault](/files/uwzBMB4Ub4Q8fylAWfWM)

The above chart describes what functions are available during the vault's operation. The functions are as follows:

* **`initialDeposit`**, needs to be called by the owner to provide initial funding for the Aera vault,
* **`deposit`**, allows owner to make additional deposits at any time while preserving existing pool spot price. Should generally not be called if trading is enabled,
* **`depositIfBalanceUnchanged`**, a deposit operation that checks if the underlying Balancer pool balance hasn’t changed in the current block as a form of simple MEV protection,
* **`withdraw`**, request by the owner to return a given amount of each token back to the protocol treasury (owner) while preserving existing pool spot price. Should generally not be called if trading is enabled,
* **`withdrawIfBalanceUnchanged`**, similar to depositIfBalanceUnchanged,
* **`enableTradingRiskingArbitrage`**, enable trading with current spot prices between pool assets. Vulnerable to arbitrage if spot prices do not agree with current market prices,
* **`enableTradingWithWeights`**, enable trading with a specific set of weights to control spot prices and limit arbitrage,
* **`initiateFinalization`**, request by the owner or Guardian to initiate notice period for vault termination,
* **`finalize`**, confirms vault finalization after notice period has expired,
* **`setGuardian`**, allows owner to change Guardian,
* **`sweep`**, allows owner to recover tokens sent in error,
* **`claimRewards`**, claim underlying Balancer pool rewards,
* **`disableTrading`**, disable trading in an emergency or prior to a deposit/withdraw action,
* **`updateWeightsGradually`**, controls the target Balancer weight by specifying the target weights of tokens, start and end time of weight transition schedule,
* **`cancelWeightUpdates`**, cancels active weight update,
* **`setSwapFee`**, allows Guardian to change current swap fee,
* **`claimGuardianFees`**, allows Guardian to claim pool fees if enabled and earned.

See [Operating the Vault](/v1-archive/guides/treasuries/operating-the-vault.md) for further guidance on when to use each function as a vault owner.


---

# 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.aera.finance/v1-archive/concepts/lifecycle-model.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.
