Dynamic collateral factor
A loan is sized by what its collateral would fetch in a stressed sale. The factor shrinks as a market lends more against the same depth, and the market's limits apply to the whole side.
Updated Nov 15, 2026
A large sale pays price impact. If collateral were valued at a quoted price, borrowing against a large position could skip that cost: draw the other token now, default later and leave the market holding collateral it can only sell lower. So collateral is valued at what selling it would return, and the factor applied to it moves with the market.
The shadow curve
Public borrowing is judged on a shadow curve: a constant-product tail rebuilt at the pessimistic price from the double EMA and scaled to conservative depth. is the lower of the collateral token's symmetric and directional averages, so a fall reaches borrowing power at once and a rise only after it has held. Before any curve math, amounts are counted in the larger of twelve decimals and the two tokens' own decimals.
With the depth of the prepared curve at its centre, only the tail is scaled:
The impact-aware value of units of collateral is what selling all of it into those reserves would return:
rounds down. Its inverse, the collateral a sale needs to raise , rounds up, so both round against the borrower:
Twice the collateral is worth less than twice as much. Only the full-range tail underwrites debt, because concentrated depth can leave with the next recentering and the tail cannot. For a Token-2022 collateral mint with a transfer fee, is what the vault could deliver after the fee, at the current rate or at a newer one the mint has already scheduled, whichever leaves less.
Depth that leaves counts at once, because pessimistic depth reads the current depth. Depth that arrives counts only as its average catches up, and the depth average, like the price averages, moves at most once per slot.
The factor
Write for the debt every other position already holds on the same side, and for the collateral the shadow curve would have to sell to cover it. The liquidation collateral factor is what this position's collateral still fetches after that sale, as a share of its own value:
The program floors it to whole basis points. With no other debt on the side the factor is the 85% cap, and it falls as that debt grows.
starts from , the side's public debt minus this position's own. Counting the position's own debt would make a second draw from one position cost more than the same draw from a second position. When the market holds more collateral than its debt needs, the other debt is discounted by the side's market health after this borrow:
Worked example
Take a shadow curve at quote per base with , so base and quote. A position posts base, worth 40,000 quote at the linear price and in a sale.
| Factor | Borrow limit | |||
|---|---|---|---|---|
| 0 | 0 | 38,781.2 | 85.00% (cap) | 31,315.8 |
| 150,000 | 85,019.7 | 30,287.8 | 78.09% | 28,767.9 |
| 400,000 | 291,659.8 | 18,412.3 | 47.47% | 17,486.5 |
Suppose the other debt is 150,000 and this borrow adds 10,000. Covering 160,000 takes base. If every position's contribution sits at the 150% cap, the side holds base of contributions, so and . The factor rises to 83.06% and the limit to 30,598.4.
Two limits and a stored factor
A successful borrow stores the factor for that debt side; if it would fall below the minimum the borrower passed in the instruction, the borrow is rejected. The borrow limit is times 95% of the factor, with the 95% figure floored to whole basis points:
borrow checks, in order:
- The position has no open liquidation session (
LiquidationSessionActive) and the amount is nonzero (AmountZero). - The collateral the vault could deliver after transfer fees is nonzero (
InsufficientMarketHealth). - Current health on every side that carries public debt is at or above the floor (
InsufficientMarketHealth), even when the borrow is on the other side. - The position's debt after the borrow fits the limit (
InsufficientMarketHealth). - The fresh factor is at least
min_liquidation_cf_bps(SlippageExceeded). - The borrowing side's health after the borrow is at or above the floor (
InsufficientMarketHealth). - The side has the cash (
InsufficientBorrowHeadroom). - The daily bucket below has room (
DailyLimitExceeded).
After the transfer, the borrower must have received at least min_debt_amount_out (SlippageExceeded).
Liquidation applies the same stored factor to the collateral's linear value at the symmetric average, without price impact; see Internal unwind.
A new borrow replaces the stored factor with a fresh one. Deposits, partial repayments, partial liquidations and interest leave it unchanged, and full repayment or a full liquidation clears it.
A collateral withdrawal, withdraw_collateral, computes a fresh factor for the collateral left behind, keeps the greater of it and the stored one, and requires the debt to fit for the remaining collateral (InsufficientMarketHealth); it then stores that greater factor. Other people's actions therefore cannot lower a position's terms. A withdrawal that would leave debt behind no deliverable collateral fails outright. Withdrawals test the position alone and do not re-run the market health floor.
Market health
Each debt side is secured by the position's collateral in the opposite asset only. The public-borrow book also keeps debt-capped aggregate global-health contributions, which improve underwriting for new borrows without locking anyone else's idle collateral or changing existing terms.
A position with debt and collateral contributes , where is the market's contribution cap. Market health is a side's contributions divided by the collateral the shadow curve would need to sell to cover all of that side's public debt :
The cap is applied again when the contributions are read, so collateral that has risen in price cannot stretch an old contribution past it. A side whose debt reaches has health zero. New borrows are refused when they would push health below the market's floor, which is set at creation and cannot change.
On the shadow curve , so and . When every contribution sits at the cap, health is therefore
Health falls linearly as public debt fills the shadow curve's reserve. With the SDK's default 150% cap and 110% floor, new borrowing on a side stops once its public debt reaches of the shadow curve's reserve of that token: 339,411 quote on the curve above.
The daily bucket
Each debt asset has one leaky 24-hour bucket for gross new public borrowing, sized from conservative depth:
is the shadow curve's reserve of the token, the side's executable reserve and the market's bucket rate, 20% by default and at most 30%. The size is recomputed from current depth at every borrow.
The bucket drains continuously and keeps no trailing window. After the borrowed total falls by , with the remainder carried to the next drain, and a borrow of needs . Time is counted in slots at the nominal 200 ms. It refills at its full size per day, so lending out one side takes days. On the curve above, with 2,000,000 quote of executable reserve, the quote bucket holds 254,558.4 per day; a side that used all of it has 63,639.6 of room six hours later.
Only new public principal consumes it, and repayments and exits do not refund it. hLP funding and isolated leverage do not draw on it because they do not lend cash out, though both face their own checks and count toward utilization.
Splitting collateral
Spreading collateral over many positions does not escape these limits. Every position's factor counts the debt of every other position on its side, and the health floor and the daily bucket apply to the whole side, however the collateral is spread.
Parameters
| Parameter | Value | Set by | How it changes |
|---|---|---|---|
| Factor cap | 85% | Program | Fixed |
| Borrow buffer | 5% of the factor | Program | Fixed |
| Contribution cap | 150% in the SDK's launch defaults; at least 100% and at least the floor | Market creator | Creation only |
| Health floor | 110% in the SDK's launch defaults; at least 100% | Market creator | Creation only |
| Bucket rate | 20% by default; 0% to 30% | Market creator, then the operator or manager | A DailyBorrowLimit bundle after the full notice; refill already elapsed closes at the old rate |
| Average half-lives | See Double EMA | Market creator, then the operator or manager | An EmaHalfLives bundle after the full notice |
An out-of-range cap, floor or bucket rate fails market creation with InvalidMarketConfig, and a bucket rate above 30% in a bundle fails with InvalidParameterUpdate.