Bonding curves
Every term has one vault per registered bonding curve. A curve is a pricing contract. It converts assets to shares and back for one vault, given that vault's total shares and total assets. MultiVault holds the principal, and the curve only does the math. The bonding curves concept explains why the choice of curve matters. This page lists the contracts.
The registry
BondingCurveRegistry maps curve IDs to curve contracts and forwards every price calculation to the right one. It holds no economic state.
| Behavior | Detail |
|---|---|
| IDs | The owner adds a curve with addBondingCurve(address). IDs are assigned in order, 1, 2, 3 and so on. ID 0 is never valid. |
| Append-only | There is no function to remove or replace a curve. A registered ID always points to the same proxy address. |
| Unique names | A curve must have a non-empty name() that no other registered curve uses. |
| Ownership | The registry is Ownable2Step. On Intuition mainnet the owner is the admin multisig. The proxy's upgrades go through the upgrades timelock. |
Read count(), curveAddresses(id), getCurveName(id) and isCurveIdValid(id) to discover curves. BondingCurveAdded indexes the curve name as a hash, so read the name with getCurveName rather than from the log. BondingCurveRegistry
Registered curves
Values were read from each network's registry at Intuition mainnet block 12,026,592. Check count() before assuming the list is complete.
| ID | Mainnet curve | Testnet curve | Pricing |
|---|---|---|---|
| 1 | Linear Curve | Linear Curve | Constant price. Share value grows only from fees. |
| 2 | Offset Progressive Curve | Offset Progressive Curve | Each share costs more than the last, starting from an offset. |
| 3 | — | Dynamic Fee Flat Price Curve | Constant price, with tiered fees paid to earlier holders. |
Curve 1 is the default curve on both networks. Atom and triple creation always mint on the default curve. A new vault on the default curve can only be opened through a create call. Entry fees, exit fees and the atom deposit fraction are paid into default-curve vaults only. MultiVault rejects a default curve that has fee hooks. The timelock sets the default with setBondingCurveConfig. Default curve checks
Pricing formulas
In the formulas, S is the vault's total shares and A its total assets. Deposits and conversions round down. previewMint and previewWithdraw round up. Prices are scaled by 10^18.
Linear Curve
Share value grows through pro-rata fee accumulation, not through supply. The curve takes no parameters.
| Operation | Result |
|---|---|
Shares for assets | assets if S is 0, otherwise ⌊assets · S / A⌋ |
Assets for shares | shares if S is 0, otherwise ⌊shares · A / S⌋ |
| Current price | 10^18 if S is 0, otherwise 10^18 · A / S |
Offset Progressive Curve
The price rises linearly with supply: price = m · (S + o), where m is the slope and o the offset. The offset sets the starting price. Deposits and redemptions integrate under that line.
| Operation | Result |
|---|---|
Shares for a assets | √((S + o)² + 2a / m) − (S + o) |
Assets for Δs shares | (m / 2) · ((S + o)² − (S + o − Δs)²) |
On mainnet, curve 2 has a slope of 0.1 and an offset of 30 shares. A vault with no shares prices the first share at 3 TRUST. At 100 shares the price is 13 TRUST. A 10 TRUST deposit into an empty vault buys about 3.17 shares on this curve, compared with 10 shares on the linear curve. Total assets are used only for bounds checks, never in the price. The slope and offset are set once at initialization and have no setters. OffsetProgressiveCurve
The source also contains ProgressiveCurve, which is the same formula without an offset. It is not registered on either network. ProgressiveCurve
Dynamic Fee Flat Price Curve
This curve prices shares exactly like the linear curve. In addition, it charges a deposit fee and a redemption fee that it pays to the vault's earlier holders, not to the protocol. It is registered as curve 3 on Intuition testnet only.
- Tiers. Each vault's cumulative net stake is divided into tiers whose width grows geometrically. Rates rise with each tier up to a cap.
- Deposit fee. The same for every account. It depends only on how far the deposit pushes the vault through the tiers. Each band's fee goes to holders in lower tiers.
- Redemption fee. Specific to the account. Each holding is a lot that keeps the tier it entered at. A redemption draws from the account's highest-tier lots first, and each lot pays that tier's rate to the other holders.
- Earnings. Fees accrue in the curve contract as native TRUST. Holders pull them with
claim(termIds). MultiVault does not pay them.
The testnet configuration has 16 tiers. The first tier is 2,000 TRUST wide and each tier is 35% wider than the one before. Deposit rates start at 1.00% and rise by 0.45% per tier to a 5.50% cap. Redemption rates start at 1.50% and rise by 0.35% per tier to a 4.50% cap. The contract limits any cap to 20%. The owner can change the configuration and set per-tier overrides directly, without a timelock. Upgrades still go through the upgrades timelock. DynamicFeeFlatPriceCurve · Call-flow walkthrough
Integrate a fee-hook curve
- Pass the curve ID explicitly to
depositorredeem. A term cannot be created on this curve, because creation always uses the default curve. - Make the first deposit into a new vault on this curve large enough to cover the minimum-share cost.
- Use
MultiVault.previewDepositas usual. It already includes the curve's deposit fee. - Do not rely on
MultiVault.previewRedeemfor a holder. It prices at the vault's current tier. Call the curve'spreviewRedeemFor(termId, account, shares)to get the holder's curve fee, then combine it with MultiVault's preview to setminAssets. - Show holders their earnings with
claimableAcross(account, termIds), which returns exactly whatclaim(termIds)would pay.claimable(account, termId)includes the account's settled balance, so it is not additive across terms.
Related
- MultiVault lists the vault functions that take a curve ID.
- Curves package computes the same math locally from a state snapshot.
- Configuration shows how to read the registry and default curve.
Applies to V2 · @0xintuition/curves 0.1.1 · @0xintuition/protocol 4.1.0