Deposit & Withdrawal Flow

All Liquidity Providers must pass KYC verification before interacting with lending pools. All amounts are denominated in USDC.

Deposit Flow

1. Deposit Request

The Liquidity Provider calls LendingPoolManager.requestDeposit() (or requestDepositWithKYC() for KYC-gated deposits), specifying the lending pool and preferred tranche.

  • The Lending Pool Manager routes the USDC to the corresponding Pending Pool

  • The Pending Pool mints a non-transferable D-NFT to the user with: epoch number, USDC amount, and preferred tranche

  • If the LP submits another deposit in the same epoch, the existing D-NFT is reused and the amount is increased

  • LPs can cancel their deposit request before clearing via LendingPoolManager.cancelDepositRequest(), which burns the D-NFT and returns the USDC

  • Manually allowlisted LPs (bypassing KYC) use LendingPoolManager.requestDeposit()

2. Clearing (Deposits)

During clearing, the system processes all pending D-NFTs:

  1. Requests are sorted by loyalty level (highest first) within each tranche

  2. Accepted deposits are allocated to tranches, with overflow to lower-risk tranches when oversubscribed

  3. For accepted deposits: USDC moves to the lending pool, the tranche mints shares 1:1, USDC-IOUs are minted in the tranche, and the D-NFT is burned

  4. For rejected deposits: USDC is returned to the LP and the D-NFT is burned

  5. Partially accepted deposits split the amount — the accepted portion goes to tranche(s), the rejected portion is returned

3. Draw

After clearing, USDC is sent to the configured Draw Recipient address. The Pool Funds Manager deploys these funds into off-chain loans.

4. Repayment

The Pool Funds Manager calls LendingPoolManager.repayOwedFunds() to return capital to the pool. Any amount can be repaid at any time (outside clearing periods). Owed Fees are deducted from the repayment before crediting the pool. Repaid funds become excess funds available for withdrawal.

Withdrawal Flow

1. Withdrawal Request

The Liquidity Provider calls LendingPoolManager.requestWithdrawal(), specifying the lending pool, tranche, and amount of tranche shares to withdraw.

  • Tranche shares are transferred to the Pending Pool

  • The Pending Pool mints a non-transferable W-NFT with: epoch number, tranche share amount, and tranche address

  • LPs can cancel before clearing via LendingPoolManager.cancelWithdrawalRequest(), which returns shares and burns the W-NFT

2. Clearing (Withdrawals)

During clearing, withdrawal requests are processed from excess funds:

  1. Force Withdrawals are processed first (highest priority)

  2. Then Loyalty Level 2, then Level 1, then Level 0

  3. Requests outstanding for 5+ epochs automatically receive Loyalty Level 2

  4. When accepted: tranche shares return to the lending pool, a proportional share of USDC is sent to the LP, and the W-NFT is burned

  5. Partial fulfillment: the W-NFT is updated with the remaining amount, to be processed in future clearings

If excess funds are insufficient to cover all withdrawal requests, unfulfilled requests remain outstanding.

3. Cancellation

  • Deposit requests: Can be canceled in the same epoch before clearing begins, or any time if they were partially accepted in a previous epoch

  • Withdrawal requests: Can be canceled before clearing begins for the current epoch

  • The Pool Manager can force-cancel both deposit and withdrawal requests on behalf of any LP

Last updated