> 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/awaiting-approval.md).

# AwaitingApproval

The **AwaitingApproval** phase begins automatically when the vault reaches full funding in both tranches. The Pool Manager must now review and approve the loan for disbursement.

## What Happens

* The vault holds the full principal amount deposited across both tranches
* The Pool Manager reviews the vault and confirms readiness
* The manager calls `approve_and_disburse(caller, pledge_id)` to release funds to the borrower

## Approval & Disbursement

When the manager calls `approve_and_disburse`:

1. If the vault requires borrower collateral (`collateral_escrow` set), the supplied `pledge_id` is verified against the escrow — controller, token, borrower, and amount (at least `min_borrower_coll_ratio_bps` of principal) must all check out. A collateral-backed vault called without a valid pledge id fails with `CollateralPledgeRequired`
2. If the protocol's compliance gate is set, it is checked for the borrower (`Borrow` action)
3. The full funded amount is transferred to the **borrower's address**
4. The shared installment schedule is calculated based on principal, interest rate, and loan term
5. The first **payment due date** is set (one `period_seconds` from disbursement)
6. Both tranches' outstanding principal (`outstanding_s`, `outstanding_j`) are initialised
7. The **missed payments counter** is set to 0
8. The vault transitions to **Active**

{% hint style="info" %}
Only the vault's Pool Manager can call `approve_and_disburse`. This is verified on-chain through the manager address stored in the vault configuration.
{% endhint %}

## Approval Deadline

If the vault was created with an `approval_deadline`, the vault can be cancelled if the manager fails to approve by the deadline.

* Anyone can call `check_approval_expiry()` after the deadline passes
* The manager's locked collateral and any borrower pledge are released once (O(1))
* The vault transitions to **Cancelled**
* Each investor then calls `claim_refund(investor, tranche)` to retrieve their own deposit

This protects investors from having their capital locked indefinitely in a funded but unapproved vault.

## Relevant Functions

| Function                                  | Caller   | Description                                                 |
| ----------------------------------------- | -------- | ----------------------------------------------------------- |
| `approve_and_disburse(caller, pledge_id)` | Manager  | Approve loan and disburse to borrower                       |
| `check_approval_expiry()`                 | Anyone   | Move the vault to Cancelled if the approval deadline passed |
| `claim_refund(investor, tranche)`         | Investor | Pull your own refund after a Cancelled approval expiry      |

*As of September 2026.*
