Contract Overview
InterestRatePool
The central state and accounting contract.
| Area | Main functions |
|---|---|
| Discovery | getPool, protocolFees, seriesFees, loanToken, seriesKey, borrowerPosition, legOf, legsOf, bookState, expiryState |
| Preview | previewMintFRT, previewBurnFRT, previewSupplyPrepaid, reserveRequirement, effectiveAssets, freeAssets, currentTick, riskPending |
| Creation | createPool, createSeries |
| Settlement | settle, settlePosition, claimSpreadFees |
| FRT | mintFRT, burnFRT, exitFRT, rollFRT, moveFRT, approveFRT |
| VRT | depositVRT, withdrawVRT, approveVRT |
| Prepaid | supplyPrepaid, withdrawPrepaid |
| Authorization | setOperator, isOperator |
| Admin | setFeeRecipient, setProtocolFees, setAdapterAllowed |
Each pool has a rate grid (fixedRateSpacing ticks strictly below the cap, at most 16,383) and expiries. A borrower holds one position per expiry: several fixed-rate legs sharing one prepaid funding. A backer book holds liquidity at one rate of one expiry; its VRT uses in-contract ERC-6909-style balances. There is no separate FRT/VRT token contract.
Liquidation is grouped and loop-free. Positions sit in a (column, funding tick) cell, where the column is the position's average rate rounded up to the grid. settle(poolId, expiry, budget, recipient) sweeps broke cells found by a 4-ary kinetic tree over the columns, each sweep closing every position in the cell, within budget work units; the sweeper fee goes to recipient. settlePosition claims a swept position's refund.
Protocol fees are owner-controlled within hard maxima and snapshot into each expiry when it is created. A fee update advances the series-key epoch; an existing expiry keeps its snapshot and epoch.
QuoteMarket
Verifies maker-signed EIP-712 quotes and performs atomic two-sided fills.
previewTakeQuoteandtakeQuoteopen exact-notional FRT.previewTakeRollQuoteandtakeRollQuoteroll exact notional; the FRT owner and funding payer are distinct so KeeperBundler can fund a borrower-owned roll.cancelQuoteinvalidates one hash.raiseNonceinvalidates all older maker-nonce quotes.
Execution is restricted to the immutable Bundler3. takeQuote uses Bundler3's initiator as the taker and enforces the wallet-provided maxCost.
KeeperBundler
Stores direct or Bundler3-initiated KeeperConfig values and executes keepTopUp, keepAutoRepay, and quote-backed, full-leg keepRollover. Third-party actions are limited by the user's configured thresholds, bands, and maximum keeper fee (hard-capped at 5%). Configs are keyed by (user, poolId, expiry). A keeper can atomically create the backer-selected series and consume its signed quote in one Bundler3 transaction; a roll moves one whole leg, and a roll to another expiry moves the policy with it.
Adapters
ICoreAdapter connects settlement and keeper debt operations to a lending market. Pools can only be created with owner-allowlisted adapters, and each pool pins its loan token at creation.
Approval Boundaries
| Permission | Spender/operator | Purpose |
|---|---|---|
| Maker ERC-20 allowance | QuoteMarket | Pull vrtAmount when a quote fills |
| Taker ERC-20 allowance | QuoteMarket | Pull bond, fee, and initial prepaid up to maxCost |
| Borrower pool operator | QuoteMarket | Mint or roll FRT on behalf of the taker |
| Optional prepaid allowance | InterestRatePool | Pull extra prepaid supplied to an expiry position |
| Optional keeper operator | KeeperBundler | Run configured maintenance actions |
Bundler3 itself does not need a loan-token allowance or pool operator approval.
