Juice Lending Pool

JuiceLendingPool

Lending Pool is configured with an interest rate strategy and uses Blast's USDB as the lending token. USDB yield is configured as claimable.

Lenders deposit and withdraw USDB to/from the lending pool to add/remove liquidity.

Flash loans of the underlying lending token balance are supported.

  • The flash loan fee goes to the protocol.

Owner of JuiceGovernor can:

  • Set deposit caps.

  • Set a new interest rate strategy

Managers can borrow and repay loans via the Lending Pool on behalf of arbitrary addresses. They are trusted to generate loans responsibly so that any funds lent out are sufficiently collateralized and can be repaid.

Lending Pool is not responsible for managing loan health.

The protocol takes a cut out of the borrow yield that lenders earn. If the borrow rate is 20%, utilization rate is 50%, and the protocol fee is 10%, then the lenders would earn 10%, but instead the protocol takes 1% of the yield and the lenders get 9%. Fees are automatically collected after each user interaction, given that some minimum amount has been exceeded. These funds are sent to the feeCollector address configured in JuiceGovernor.

To avoid stealth deposits, the Lending Pool uses a separate value for tracking its current USDB balance. This means that the actual USDB balance of the lending token should always be greater than or equal to this state balance.

The USDB balance state should only change due to the following:

ActionOutcome

Lender deposits

Increase

Lender withdraw

Decrease

Manager borrow

Decrease

Manager repay

Increase

USDB yield claimed

Increase

Yield and debt accrued are accounted by the liquidityIndex and borrowIndex variables. Before every action, these indices are recomputed to account for yield and debt accrued since the last time they were updated. After every action, accrual rates are recalculated based off the end state of the Lending Pool.

When USDB yield is claimed, a usdbRate is calculated based off the USDB yield claimed and the total supply of liquidity tokens at the time of the yield being claimed. This is accrued into the liquidityIndex. There are two sources for this yield:

  • Idle USDB un-utilized in the Lending Pool.

  • USDB yield forwarded from a Strategy.

Excess USDB tokens can accrue in the Lending Pool as a result of the OmegaLiquidityToken not accounting for a portion of the internal USDB balance. This excess is claimable as protocol fees.

The JuiceGovernor should be able to claim accumulated gas fees from the JuiceLendingPool.

Last updated