> For the complete documentation index, see [llms.txt](https://docs.trilobyte.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trilobyte.finance/protocol-mechanics/vault-lifecycle/active.md).

# 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 |
