> For the complete documentation index, see [llms.txt](https://qiro.gitbook.io/qiro-vaults/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://qiro.gitbook.io/qiro-vaults/technical-overview/protocol/flow-of-funds.md).

# Flow of Funds

The path capital takes from an investor to a borrower, and back again.

Deposited capital passes through four contracts before it reaches a borrower, and returns along the same path.

```mermaid
flowchart TD
    I(["Investor"])
    V["StakedVault"]
    VSM["VaultStrategyManager"]
    PM["SubaccountPositionManager"]
    SA["Subaccount wallet"]
    B(["Borrower or<br/>liquid strategy"])

    I -- deposit --> V
    V -- allocate --> VSM
    VSM -- deploy --> PM
    PM -- invest --> SA
    SA -- fund --> B

    B -. repay .-> SA
    SA -. redeem .-> PM
    PM -. return .-> VSM
    VSM -. return .-> V
    V -. claim .-> I

    classDef onchain fill:#6B56F1,stroke:#6B56F1,stroke-width:0px,color:#FFFFFF;
    classDef edge fill:#4C33D9,stroke:#4C33D9,stroke-width:0px,color:#FFFFFF;
    classDef offchain fill:#1E1B3A,stroke:#6B56F1,stroke-width:2px,color:#FFFFFF;
    classDef actor fill:#0F766E,stroke:#0F766E,stroke-width:0px,color:#FFFFFF;

    class V,VSM onchain;
    class PM edge;
    class SA offchain;
    class I,B actor;

    linkStyle 0,1,2,3,4 stroke:#6B56F1,stroke-width:2px;
    linkStyle 5,6,7,8,9 stroke:#0D9488,stroke-width:2px;
```

Solid arrows are deployment, dotted arrows are repayment.

### Investment and Deployment

An investor deposits and receives shares. The curator calls `invest()` on the position manager, which draws the capital from the vault through the Vault Strategy Manager and transfers it to a whitelisted subaccount wallet. From there it funds a credit facility through a Deal SPV, or sits in a liquid strategy as the vault's liquidity buffer.

Capital is **pulled by the position manager**, not pushed by the vault. See [Smart Contract Architecture](/qiro-vaults/technical-overview/protocol/smart-contract-architecture.md#vaultstrategymanager).

### Repayment and Redemption

A borrower repays into the subaccount. The curator calls `redeem()`, which pulls the capital back through the position manager and the Vault Strategy Manager into the vault, where it becomes **idle cash**.

Idle cash is what the redemption queue is serviced from. A request becomes claimable because capital came back, not because a timer elapsed.

***

For how an investor requests and claims, see [Redemptions](/qiro-vaults/stakeholders/investors/redemptions.md). For each contract in detail, see [Smart Contract Architecture](/qiro-vaults/technical-overview/protocol/smart-contract-architecture.md).
