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

# Anchor vaults

The per-asset vaults that hold inventory and quote both sides of each market.

One anchor vault is one market: a single Stock Token, USDG, and the LPs who fund both sides of it. Except during a halt, the vault always quotes a bid and an ask around the oracle mid, fills swaps up to its clip size, and passes the spread through to its LPs.

## Inventory model

Every vault targets a configured inventory mix (50/50 by value at launch) and operates within a hard band around that target.

| Parameter          | Meaning                                                             | Tier A initial value |
| ------------------ | ------------------------------------------------------------------- | -------------------- |
| `targetRatioBps`   | Share of vault value the vault aims to hold in the Stock Token      | 5,000 (50%)          |
| `inventoryBandBps` | How far the mix may drift from target before one side stops quoting | 2,000 (±20%)         |
| `maxClip`          | The largest single swap the vault will fill                         | 50,000 USDG          |
| `dailyVolumeCap`   | Volume ceiling per market during the guarded launch                 | 2,000,000 USDG       |

As traders buy the token, the vault's token inventory drops and its USDG grows; it is now short of target, and [skew pricing](/protocol/pricing-and-spreads.md) improves its bid while worsening its ask, which pays arbitrageurs and makers to push inventory back toward target. When flow is one-way enough to hit the edge of the band, the vault stops quoting that side altogether instead of accepting unbounded inventory risk. The opposite side continues to quote.

## Why inventory, not a curve

A constant-product pool holds inventory too, but its price is derived from that inventory, so each move in the reference price leaves it showing stale quotes that arbitrageurs collect. An anchor vault derives its price from the oracle; inventory only shifts the spread. The vault is never the last participant to learn what the asset is worth, so its LPs collect the spread rather than funding the arbitrage. The trade-off is stated plainly: the vault relies on the oracle, and every guard on that reliance is described in [Oracles and market sessions](/risk/oracles.md).

## Value accounting

Vault value equals `usdgBalance + tokenBalance × mid`, marked at the guarded oracle price. LP shares use ERC-4626-style accounting over that value: a deposit mints shares at the current value per share, spread revenue accrues into that value, and a withdrawal burns shares in exchange for a pro-rata, in-kind mix of both assets. Since withdrawals are in kind, an LP leaving never forces the vault to trade, and a pause can never trap LP funds. The details and the LP economics are covered in [Liquidity provision](/protocol/liquidity-provision.md).

## Lifecycle

| State       | Meaning                                                                                                                                                  |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ACTIVE`    | Both sides quoting, subject to the regime                                                                                                                |
| `ONE_SIDED` | Inventory at the band edge; only the rebalancing side quotes                                                                                             |
| `HALTED`    | No quotes: the oracle is stale, `oraclePaused()` is set, a corporate action is in progress, or a guardian has paused. Deposits and withdrawals stay open |
| `RETIRED`   | Delisted: quoting is off for good, withdrawals only                                                                                                      |

The `VaultFactory` deploys each vault from the parameters fixed at [listing](/assets/listing-framework.md), and each parameter is a `ParamController` value that can only change through the timelock.

## Invariants

These are the properties the contract enforces and the test suite proves:

* In any state and under any parameter set, no fill ever clears outside the oracle band.
* A swap never reduces value per share (spread revenue is non-negative by construction).
* Neither `HALTED` nor `RETIRED` ever restricts withdrawals.
* The vault's own quoting can never push 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 current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.miragefi.org/protocol/anchor-vaults.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
