> 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/fully-repaid.md).

# FullyRepaid

The **FullyRepaid** phase is reached when both the senior and junior tranches' outstanding principal have been fully amortised. The loan is complete, and all that remains is for investors and the borrower to collect their funds before the vault is finalized.

## What Happens

* The vault transitions here **automatically** when `outstanding_s == 0 && outstanding_j == 0` after a payment
* The **Pool Manager's collateral** is released (unlocked via cross-contract call to Globals)
* The manager's and borrower's **outstanding principal** are decremented in Globals
* If the vault held a borrower collateral pledge, it is **released** back to the borrower
* **Investors** can continue to claim any unclaimed interest/principal from their own tranche's pool
* The **Borrower** can withdraw any remaining funds from the cash pool (the current-on-payments covenant no longer applies once the loan is fully repaid)

## What's Available

| Pool                            | Who Can Access            | Function                         |
| ------------------------------- | ------------------------- | -------------------------------- |
| **Senior / Junior yield pools** | Investors in that tranche | `claim_yield(investor, tranche)` |
| **Cash pool**                   | Borrower                  | `withdraw_cash(amount)`          |

## Transition to Finalized

Once the cash pool is empty and every investor has claimed their tranche's full entitlement, **anyone** can call `finalize()`. The vault transitions to **Finalized** — the terminal state. Calling `finalize()` before both conditions are met fails with `CashPoolNotEmpty` or `EmiPoolNotFullyClaimed`.

{% hint style="success" %}
A vault reaching FullyRepaid is the ideal outcome. The borrower has fulfilled their obligations, both tranches of investors have earned their yield, and the manager's collateral is returned.
{% endhint %}

*As of September 2026.*
