# Flow of funds

> How money enters, moves through and leaves a Truss vault, which function runs each step, who must call it, and when it needs a fresh NAV.

Source: https://docs.trusslabs.io/vaults/flow-of-funds

Deposits and redemptions in a Truss vault are requests. A holder opens one, a settler fills it later at one price
for the whole batch, and the holder then claims the result. The one exception is an instant withdrawal, which opens
a redemption and pays it in the same call. This section follows the money through each flow: which contract and
function runs each step, who must call it, and which steps need a fresh NAV (net asset value, what everything the
vault holds is worth in USDC).

> **Key points**
>
> - A holder opens and claims requests. A settler decides which requests fill, and when.
> - Only the steps that price something need a fresh NAV: settling, instant withdrawals and turning fees into shares.
> - Opening, claiming, cancelling and transferring a request need no fresh NAV, so they keep working when a price feed lapses.
> - Every fee is paid in vault shares. No fee moves USDC out of the vault.

## Who is who

| Who | What they do |
|---|---|
| Owner | The address whose USDC or shares a request takes |
| Controller | Controls the request: claims the result, and can cancel or transfer it while it is pending. Usually the owner |
| Operator | An address a controller has approved with `setOperator` to act for it on every request |
| Receiver | The address a claim pays |
| Settler | The profile that fills requests. The VaultManager and the VaultAdmin can settle too |
| Allocator and Traders | The Allocator sends idle USDC to sub-accounts. Traders work the capital in the sub-accounts that name them, and bring it back |
| Fee recipient | The address that receives the fee shares |

## The flows at a glance

| Flow | Opened by | Settled or executed by | Claimed by | Page |
|---|---|---|---|---|
| Deposit | The owner or its operator | A Settler, VaultManager or the VaultAdmin | The controller or its operator; anyone, for the controller | [Deposits](https://docs.trusslabs.io/vaults/flow-of-funds/deposits.md) |
| Redemption | The owner or its operator | A Settler, VaultManager or the VaultAdmin | The controller or its operator; anyone, for the controller | [Withdrawals](https://docs.trusslabs.io/vaults/flow-of-funds/withdrawals.md) |
| Instant withdrawal | The owner and the controller, or their operators | The same call | Paid in the same call | [Instant withdrawals](https://docs.trusslabs.io/vaults/flow-of-funds/instant-withdrawals.md) |
| Fees | Charged inside the flows above | Turned into shares at settlements and fee changes | Redeemed by the fee recipient like any holder | [Fees in the flow of funds](https://docs.trusslabs.io/vaults/flow-of-funds/fees.md) |

A pending request can also change hands before it settles. See [Selling a pending request](https://docs.trusslabs.io/vaults/flow-of-funds/selling-a-pending-request.md).

## What needs a fresh NAV, and what a pause stops

A NAV is stale when a price feed is past its allowed age, an attestation is late, or a price cannot be read. A
stale NAV stops the steps that price. A vault pause stops the steps that start something new.

| Step | Needs a fresh NAV | While the NAV is stale | While the vault is paused |
|---|---|---|---|
| Opening a deposit | No | Works | Refused |
| Opening a redemption | No; its minimum is checked at the last price, and skipped while stale | Works | Refused |
| Settling | Yes | Reverts | Works |
| Instant withdrawal | Yes, and its oldest input must be within the freshness gate | Reverts | Refused |
| Claiming | No | Works | Works |
| Cancelling or transferring a request | No | Works | Works |
| Turning fees into shares, and any fee change | Yes | Reverts | Works |

While the NAV is stale, a pending request waits. Its holder can still cancel it for free.

## Where to read more

| Page | What it covers |
|---|---|
| [Deposits](https://docs.trusslabs.io/vaults/flow-of-funds/deposits.md) | Request, settle and claim a deposit |
| [Withdrawals](https://docs.trusslabs.io/vaults/flow-of-funds/withdrawals.md) | Request, fund, settle and claim a redemption |
| [Instant withdrawals](https://docs.trusslabs.io/vaults/flow-of-funds/instant-withdrawals.md) | Redeeming and being paid in one call |
| [Fees in the flow of funds](https://docs.trusslabs.io/vaults/flow-of-funds/fees.md) | Where each fee is taken, and how the recipient is paid |
| [Architecture](https://docs.trusslabs.io/vaults/architecture.md) | The contracts these flows run through |
