# Vault Lifecycle

Every Trilobyte vault goes through a series of phases that represent the state of the loan. Transitions between phases are triggered by on-chain actions — deposits, approvals, payments, or enforcement calls.

## Phase Diagram

```
RaisingFunds → AwaitingApproval → Active → FullyRepaid → Finalized
                                    ↕           ↗
                               Renegotiation
                                    ↕           ↘
                                 Defaulted
```

## Phases at a Glance

| Phase                | Description                                                   | Who Acts                            |
| -------------------- | ------------------------------------------------------------- | ----------------------------------- |
| **RaisingFunds**     | Vault is open for investor deposits                           | Investors                           |
| **AwaitingApproval** | Fully funded, waiting for manager to approve and disburse     | Pool Manager                        |
| **Active**           | Loan is live — borrower makes payments, investors claim yield | Borrower, Investors, Manager        |
| **FullyRepaid**      | All payments received — investors claim remaining yield       | Investors, Borrower                 |
| **Finalized**        | Terminal state — vault is closed                              | —                                   |
| **Renegotiation**    | Terms are being renegotiated (from Active or Defaulted)       | Pool Manager                        |
| **Defaulted**        | Borrower failed to repay within the grace period              | Anyone (trigger), Manager (resolve) |

## Transition Rules

* **RaisingFunds → AwaitingApproval**: Automatic when total deposits equal the principal
* **RaisingFunds → Finalized**: Funding deadline expired (permissionless call)
* **AwaitingApproval → Active**: Manager calls `approve_and_disburse`
* **AwaitingApproval → Finalized**: Approval deadline expired (permissionless call)
* **Active → FullyRepaid**: Automatic when all payments are made
* **Active → Renegotiation**: Manager proposes new terms
* **Active → Defaulted**: Grace period expired after missed payment (permissionless call)
* **Defaulted → Renegotiation**: Manager proposes new terms
* **Renegotiation → Active**: Manager approves the proposal (EMI recalculated)
* **Renegotiation → previous phase**: Manager rejects the proposal (restores Active or Defaulted)
* **FullyRepaid → Finalized**: All claims settled

{% hint style="info" %}
Explore each phase in detail using the sub-pages below.
{% endhint %}


---

# 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.trilobyte.finance/protocol-mechanics/vault-lifecycle.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.
