# Active

The **Active** phase is the core operating state of the vault. The loan has been disbursed to the borrower, and periodic repayments are expected.

## What Happens

* The **Borrower** makes periodic repayments via `receive_payment`
* Each payment is split between the **EMI pool** (investor yield) and the **Cash pool** (borrower operating capital)
* **Investors** can claim their pro-rata share of accumulated yield at any time
* The **Borrower** can withdraw from the cash pool at any time
* The **Pool Manager** monitors repayment health and enforces late fees if necessary

## Payment Processing

When a payment is received:

1. A **0.5% protocol fee** is deducted and sent to the treasury
2. The remainder is split by the vault's `split_ratio`:
   * EMI pool portion (e.g. 80%) → available for investor claims
   * Cash pool portion (e.g. 20%) → available for borrower withdrawal
3. The **outstanding principal** is amortised (reduced by the principal component of the EMI)
4. The **payment counter** advances
5. The **next due date** is set to 30 days forward
6. The **missed payments counter** resets to 0

## Yield Claims

Investors call `claim_yield(investor)` to claim their share of the EMI pool:

$$
\text{claimable} = \frac{\text{balance}}{\text{total\_supply}} \times \text{emi\_pool} - \text{already\_claimed}
$$

Claims are available during both the **Active** and **FullyRepaid** phases.

## Cash Withdrawals

The borrower can call `withdraw_cash(amount)` to withdraw available funds from the cash pool. This represents the borrower's portion of incoming repayments that they can use for operations.

## Transition Out

From Active, the vault can transition to:

* **FullyRepaid** — Automatically when all payments are made
* **Renegotiation** — When the manager proposes new terms
* **Defaulted** — When the grace period expires after a missed payment

## Relevant Functions

| Function                                    | Caller   | Description                             |
| ------------------------------------------- | -------- | --------------------------------------- |
| `receive_payment(payer, amount)`            | Anyone   | Submit a repayment                      |
| `claim_yield(investor)`                     | Investor | Claim pro-rata EMI pool share           |
| `withdraw_cash(amount)`                     | Borrower | Withdraw from cash pool                 |
| `apply_late_fee(caller)`                    | Manager  | Apply late fee penalty                  |
| `propose_renegotiation(caller, rate, term)` | Manager  | Propose new terms                       |
| `check_default()`                           | Anyone   | Trigger default if grace period expired |


---

# 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/active.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.
