How it actually works
TOKEN mint curve
How realised losses become token supply. The supply starts at zero on a flat-then-decaying curve; once the owner switches it over, each dollar of loss mints a fixed share of the current supply.
Two phases
The token’s supply starts at zero, so it cannot begin as a share of itself. Minting therefore runs in two phases:
- The launch curve (below): a flat rate, then a decaying tail.
- The supply-share rule, from the moment the owner switches it on through the timelock. The switch happens once and cannot be undone; at that moment the constant of the new rule is set so that the marginal mint per dollar carries on unchanged.
The launch curve
The curve has two regions and three parameters in the Tokenomics contract: the flat threshold F = $2,000,000, the flat rate R = 100 TOKEN per dollar, and the tail scale S = $120,000,000. It follows two state variables:
T, the tracked LP (Solvency & queue), which can be negative;H, the tail progress: the total mint basis priced on the tail so far. It only grows.
rate = R while T < F (the flat region, including any negative T)
rate = R · (S / (S + H))² otherwise (the tail)
The mint basis is the eligible part of your realised loss (see below), which is not always the amount credited to the tracked LP. A settlement splits its basis between the regions and mints the integral of the rate, so splitting a loss into pieces cannot mint more than a few wei of rounding:
T −= wins paid in the batch
flat = T < F ? min(basis, F − T) : 0 (a negative T leaves more flat room)
tail = basis − flat
r1 = S · 1e18 / (S + H)
r2 = S · 1e18 / (S + H + tail)
minted = flat · R / 1e18 + ((R · r1 / 1e18) · r2 / 1e18) · tail / 1e18
H += tail
T += what the LP received
One-way tail progress
H is a high-water mark that never falls. When distributions pass LP value above $10,000,000 to stakers, T drops back, but H stays where it is. Once the tail has advanced, the rate stays lower by that amount for good: after tail losses equal to S, the rate is a quarter of R, however often the LP was drained to stakers in between. That is why the curve above is drawn against H, not against the LP.
Early traders therefore mint at far higher rates than later ones. That is deliberate.
After the switch: a share of the supply
After the switch, every eligible loss mints a fixed share of the token supply per dollar of mint basis, whatever the tracked LP is:
c36 = R_now · 1e36 / supply_at_switch fixed once (R_now: the curve's marginal rate)
x = c36 · g / 1e36 g: the effective basis, below
minted = supply · (e^x / (1 + 1e−15) − 1) supply: the token supply before this mint
e^x is evaluated as a wad (18 decimals), and the result is shaded down by a margin of 1000 wei of a wad, about one part in 1e15. H stops growing. Because each dollar mints the same share of whatever supply exists, the supply has no ceiling: it grows with cumulative losses, and existing holdings are diluted in the same proportion.
Insolvency bonus
After the switch, a loss that refills a tracked LP below zero counts more:
g_below0 = min(credit, −T) the part of what the loss adds to T that lands below zero
m = 1 + 4u(2 − u), u = min(1, t / 3 days)
g = basis + (m − 1) · g_below0
t is the time since the tracked LP went below zero. m rises from one to 5× over 3 days, then stays there while T stays below zero. The clock starts when a settlement leaves T below zero and clears when one leaves it at or above zero, so the next time T goes below zero the bonus starts again from one. The rest of the loss counts once.
What counts as “loss”
- Losing close, position funded from your balance, queue empty: the loss minus the loss fee of 2%, and minus the builder fee when the closing key names an approved builder, both carved out of what the LP receives. The tracked LP rises by the same amount.
- Losing close, claims queued: no fee is charged and the loss goes to the side bucket; the basis is the whole loss, and the tracked LP rises by the whole loss. The side bucket only decides that this cash pays queued winners first.
- Liquidation: the whole lost margin, whatever the queue’s state. The tracked LP rises by the margin minus the liquidation fee when one is charged. A close that executes at or past the bust price settles as a liquidation, on the same basis.
- Positions funded from queued claims: a losing close mints on the destroyed part of the claim, minus the loss fee when one is charged; a liquidation destroys the whole claim, charges no fee and mints on all of it. The tracked LP moves by the same amounts.
Batches and deferred mints
A close of several positions mints once for the batch; the minted amount is shared out over the positions in proportion to their basis, by largest remainder, ties to the earlier position. A liquidation mints per position.
The Exchange calls Tokenomics with a fixed gas allowance. If that call fails, the close still completes, the mint’s inputs are stored, and every later mint waits behind it, so that replaying them in the original order mints exactly what the direct path would have. Anyone can trigger the replay, and our keeper does.