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
Phases at a Glance
RaisingFunds
Vault is open for investor deposits — junior first, then senior once lock_junior is called
Manager, Investors
AwaitingApproval
Fully funded (both tranches at target), waiting for manager to approve and disburse
Pool Manager
Active
Loan is live — borrower makes payments through the waterfall, investors claim yield per tranche
Borrower, Investors, Manager
FullyRepaid
Both tranches' outstanding reached zero — investors claim remaining yield, borrower withdraws remaining cash. Terminal transition target via finalize.
Investors, Borrower
Cancelled
The vault never reached disbursement (funding or approval deadline missed) — manager collateral and any borrower pledge are released once, and each investor pulls their own claim_refund
Anyone, then each Investor
Finalized
Terminal state — reached from FullyRepaid, Defaulted, or Cancelled once all claims/refunds are settled
—
Renegotiation
Terms are being renegotiated (from Active only)
Pool Manager, Borrower
Defaulted
Borrower failed to repay within the grace period. Terminal (manager collateral is slashed, any borrower pledge seized, recovery distributed senior-first).
Anyone (trigger), then Investors
Transition Rules
RaisingFunds → AwaitingApproval: Automatic once
junior_raised + senior_raised == principal(both tranches at their targets)RaisingFunds → Cancelled: Funding deadline expired (permissionless call,
check_funding_expiry)AwaitingApproval → Active: Manager calls
approve_and_disburse(with a pledge id, if the vault requires borrower collateral)AwaitingApproval → Cancelled: Approval deadline expired (permissionless call,
check_approval_expiry)Cancelled → Finalized: Every investor has pulled their own
claim_refund; anyone then callsfinalize()Active → FullyRepaid: Automatic when both
outstanding_sandoutstanding_jreach zero (investors claim remaining yield here; the borrower withdraws remaining cash pool)FullyRepaid → Finalized: Once every investor has claimed their tranche pool in full and the cash pool is empty, anyone calls
finalize()Active → Renegotiation: Manager proposes new terms
Active → Defaulted: Grace period expired after a missed payment (permissionless call; terminal)
Renegotiation → Active: Manager and borrower both authorize
approve_renegotiation(EMI recalculated) — or the manager rejects it, which restores ActiveDefaulted → Finalized: Once
distribute_recoveryhas run and every tranche pool is fully claimed, anyone callsfinalize()
(Defaulted, FullyRepaid, and Cancelled all resolve into Finalized — the only true terminal state — once every party has claimed. Renegotiation is only reachable from — and returns to — Active; a defaulted loan cannot be renegotiated because the manager's collateral has already been slashed.)
As of September 2026.
Last updated