Quote gross debt, reserve, upfront fee and usable proceeds
V2 borrowing cost is a time-based contract calculation, not a fixed 20%/1% teaching model.
Start with the operation type
- New proposal: pays an irrevocable
OPENING_FEEof 1,000 local units (1000 × 1e18raw), then any mint uses the upfront reserve/fee calculation below. - Clone accepted terms: does not pay the opening fee, but its mandatory initial mint still uses reserve and upfront fee arithmetic with the child's expiration.
- Existing-position mint: has no new opening fee; reserve, fee, capacity, backing and eligibility still apply.
Annual interest has two components
annualInterestPPM = hub.rate.currentRatePPM + riskPremiumPPM. In V2, the hub's rate contract is the currency's Savings contract. The current leadrate is therefore the baseline for both savings ticks and position minting fees. The risk premium is immutable for the position family; the leadrate can change through the separate proposal and applyChange process.
The exact forward quote
quoteTime = max(blockTimestamp, start)
seconds = expirationForQuote − quoteTime
feePPM = min(1,000,000, floor(seconds × annualInterestPPM / 365 days))
usable = floor(gross × (1,000,000 − reserveContributionPPM − feePPM) / 1,000,000)gross and usable are 18-decimal local amounts; rates are ppm and times are seconds. The fee calculation requires an expiration at or after quoteTime to avoid underflow, while actual minting separately requires now < expiration. Reserve plus fee must be at most 1,000,000 ppm or the allocation arithmetic is invalid and reverts. A positive usable amount generally requires their sum to be below 1,000,000 ppm and enough gross amount to survive integer rounding.
Use the correct expiration
calculateCurrentFee() always uses the position's own stored expiration. For an existing mint, that is the relevant quote. For a custom-expiration child, call parent.calculateFee(childExpiration); the parent's current-expiration getter is the wrong input. The eventual child mint uses the child expiration and the leadrate at execution.
Pre-opening quotes contain assumptions
Before a new position exists, a planner can only combine the current hub leadrate read with proposed risk premium, reserve and assumed block/start/expiration timestamps. It must label those assumptions and source block. Initialization and later rate changes can produce a different execution fee. This read/plan output is not transaction simulation, an allowance check by itself or a guaranteed executable quote.
The inverse is rounded up
To target usable proceeds, V2 computes the corresponding gross amount without the family limit:
usableTarget = 0 → gross = 0
otherwise gross = floor((usableTarget × 1,000,000 − 1)
/ (1,000,000 − reserveContributionPPM − feePPM)) + 1This is the rounded-up inverse, not a rounded-down division. Recompute the forward usable amount and check the denominator before using the result. In the illustrative figure, targeting 74,000 usable units returns 100,000 gross under the same assumptions.
A quote never proves mint eligibility
Separately verify owner-or-roller caller rights, challengedAmount == 0, not closed, now > cooldown, now < expiration, available family capacity and collateral backing. Original and clone family capacity differ in how unused original potential is reserved. availableForMinting() intentionally does not check challenge, closure or cooldown. Unknown or stale inputs make the plan unknown, not zero-cost or eligible.
Next: repay wallet currency against gross debt or review expiration and rolling.