> For the complete documentation index, see [llms.txt](https://docs.iridius.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.iridius.xyz/protocol/anchor-vaults.md).

# Anchor vaults

Per-asset contracts that hold inventory and keep a two-sided quote live in each market.

Every market is a vault. It holds a single Stock Token and USDG, backed by LPs who fund both sides. As long as it is not halted, the vault keeps a bid and an ask posted around the oracle mid, fills swaps up to its clip size, and passes the spread it collects back to its funders.

## Inventory model

Each vault steers towards a configured mix (initially an even split by value) and never strays outside a hard band drawn around that target.

| Parameter          | Meaning                                                                      | Tier A initial value |
| ------------------ | ---------------------------------------------------------------------------- | -------------------- |
| `targetRatioBps`   | The share of vault value meant to sit in the Stock Token                     | 5,000 (50%)          |
| `inventoryBandBps` | How far from target the mix can drift before one side of the quote turns off | 2,000 (±20%)         |
| `maxClip`          | The largest single swap the vault accepts                                    | 50,000 USDG          |
| `dailyVolumeCap`   | Ceiling on volume per market while the guarded launch lasts                  | 2,000,000 USDG       |

When buyers keep arriving, token inventory runs down and USDG accumulates, so the vault ends up short of the asset. At that point [skew pricing](/protocol/pricing-and-spreads.md) improves the bid and worsens the ask, in effect paying makers and arbitrageurs to restore the balance. If the one-way flow persists all the way to the band edge, the vault stops quoting that side instead of taking on unlimited inventory risk. The opposite side keeps quoting the whole time.

## Holding inventory instead of a curve

A constant-product pool also holds inventory, yet it derives its price from that inventory, so each move in the reference price leaves it quoting a stale figure that arbitrageurs then harvest. An anchor vault takes its price from the oracle and lets inventory shape only the spread around it. As a result the vault is never the last party to learn what an asset is worth, and its LPs keep the spread rather than subsidising someone else's arbitrage. The trade-off is acknowledged plainly: the vault depends on the oracle, and [Oracles and market sessions](/risk/oracles.md) lists every guard that protects that dependency.

## Value accounting

Vault value is `usdgBalance + tokenBalance × mid`, with the mid taken from the guarded oracle price. On top of that total sits ERC-4626-style accounting: a deposit mints shares at the current value per share, spread income raises that value, and a redemption burns shares in exchange for a proportional in-kind portion of both assets. Since redemptions are paid in kind, an LP leaving never forces the vault into a trade, and a pause cannot trap LP capital. The mechanics and economics are covered in [Liquidity provision](/protocol/liquidity-provision.md).

## Lifecycle

| State       | Meaning                                                                                                                                            |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ACTIVE`    | Both sides quoting, subject to what the regime permits                                                                                             |
| `ONE_SIDED` | At the band edge, so only the corrective side quotes                                                                                               |
| `HALTED`    | No quoting, because of a stale oracle, an `oraclePaused()` flag, a pending corporate action or a guardian pause. Deposits and withdrawals carry on |
| `RETIRED`   | Delisted: quoting has stopped for good and withdrawals are all that is left                                                                        |

`VaultFactory` deploys each vault with the parameters set at [listing](/assets/listing-framework.md), and each of those parameters is a `ParamController` value that can change only through the timelock.

## Invariants

The contract maintains the following properties, and the test suite proves each of them:

* Whatever the state or parameter set, no fill settles outside the oracle band.
* A swap can never reduce value per share, because spread revenue is non-negative by design.
* Withdrawals remain available in both `HALTED` and `RETIRED`.
* The vault cannot quote its own inventory beyond the band.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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 following URL with the `ask` and `goal` query parameters:

```
GET https://docs.iridius.xyz/protocol/anchor-vaults.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

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.
