Docs/Core concepts

Pool

The Pool is the market's shared lending pool: lenders put USDC in and receive shares; borrowers draw from it at a floating rate.

Shares#

deposit adds USDC and returns a PoolShare sized to the pool's book value. redeem burns a whole share for its USDC, limited by the cash the pool holds right now: when the pool is fully lent, shares pay out as loans come back. Shares can be split and joined.

Book value is the cash plus the debt owed to the pool, rounded down.

Rate#

The rate follows a curve over utilization (debt out as a share of cash plus debt out), with a kink at 80%.

Text
 rate
  |                                        /
  |                                      /   slope2
  |                                    /
  |                        ___________/  <- kink at 80% utilization
  |            ___________/   slope1
  | base _____/
  +---------------------------------------- utilization
  0%                                  80%   100%

Below the kink the rate is base + slope1 × u / 80%; above it, base + slope1 + slope2 × (u − 80%) / 20%. The testnet pool's curve is base 4.00%, slope1 12.00%, slope2 40.00%, so it tops out at 56.00% a year.

Floating loans#

Every pool loan floats on one borrow index. Each time the pool is touched, the index first grows at the rate the pool held since the last touch, so a rate is never changed after the fact inside the same transaction. A pool loan owes its principal times the index now over the index when it opened, rounded up.

quote_bps(amount) returns the rate right after a draw of that size; it is not fixed for the loan.

Losses#

When a pool loan is closed for less than it owed, the shortfall lowers the share price: the loss stays in that pool.