Protocol Overview

Interest Rates

How interest rate curves, compounding, and APR vs APY work on Project 0.

Banks are configured to charge progressively higher interest as the utilization rate increases. The utilization rate (UR) for a Bank is simply borrows/deposits. Interest typically climbs slowly until the "optimal utilization rate," which for most assets is around 80-90%. Beyond that level, interest grows rapidly. At 100% UR, lenders cannot withdraw because all funds have been borrowed out. High interest rates at 90%+ UR drive borrowers to repay their debts.

Interest Rate Curves

Each Bank has a piecewise linear interest rate curve defined by:

  • A rate at 0% utilization (zero_util_rate)
  • Up to 5 intermediate points at specific utilization levels
  • A rate at 100% utilization (hundred_util_rate)

The majority of Banks use only 2 points: zero at 0 UR, one intermediate point, and a value at 100 UR.

The base rate r is linearly interpolated between the two nearest points (x0, y0) and (x1, y1):

r = (UR - x0) / (x1 - x0) * (y1 - y0) + y0

Example 1: zero_util_rate = 10%, a point at (50%, 100%), current UR = 25%:

r = (25 - 0) / (50 - 0) * (100 - 10) + 10 = 55%

Example 2: A point at (50%, 100%) and (80%, 150%), current UR = 60%:

r = (60 - 50) / (80 - 50) * (150 - 100) + 100 = 116.67%

Derived Rates

From the base rate r, two other rates follow (these are also reported in the bank cache):

Lending Rate = r * UR
Borrow Rate  = r * IR Fees + Fixed Fees

Fees include insurance and protocol fees. Borrowers always pay more than lenders receive, because there are fees, and more importantly because there are more lenders than borrowers (UR < 100%), so the same interest is distributed across a larger deposit base.

The difference between what borrowers pay and lenders receive is called the spread. When lending interest on one venue exceeds the borrow rate for the same asset on another venue, this creates an interest arbitrage (or "arb" for short).

You can read a Bank's last spot interest rate from bank.cache. This updates any time a Bank has a balance change. You can also send a permissionless accrue_interest instruction to force it to update.

APR vs APY

The rates described above are the Annual Percentage Rate (APR): simple interest, as if charged once per year. The Annual Percentage Yield (APY) uses compounding: interest on previously accrued interest.

On P0, interest is computed just before any balance change, so the rate at which different Banks compound varies. Popular Banks like SOL may compound every few seconds during active periods. Less active Banks might compound just a few times per week, but these typically have very few borrows (and thus a low APR to compound). Since interest compounds based on usage, the more popular the protocol becomes, the more often interest compounds for everyone.

In practice, Banks with meaningful borrows typically yield within 1% of continuously compounded APY. The exceptions are rare cases where an asset has a high APR but not much activity.

How different rates are displayed:

  • Rates on app.0.xyz assume approximately hourly compounding for native Banks.
  • Some integrated venues generate on-chain APY compounded every 400ms (one Solana slot) using a Taylor series approximation, so they may have no APR to compare against.
  • When comparing rates across venues, be aware that APR and APY conversions vary by source.

Interest and Position Management

Because interest accrues just before any balance-changing transaction:

  • The actual amount withdrawn may be slightly more than previewed (you earned interest since the preview).
  • The actual repayment amount may be slightly more than previewed (your debt grew since the preview).
  • To fully close a position, use the "withdraw all" or "repay all" flags, which account for interest accrued up to the moment of execution.

On this page