Explore the mechanics behind GridPad
Experiment with GridPad’s bonding curve, floor reserve and redemption mechanics. Change the inputs, follow the calculations, and compare the model with verified on-chain data.
The pool
Start from an example or enter your own pool. Each example is replayed from an empty pool with the hub’s math, so it is a state the hub can reach. All of them are hypothetical: no token on the hub is any of them.
hypothetical An empty pool after one buy of 0.01 ETH.
01 Purchase allocation
hypothetical Example pool: after a buyA hypothetical purchase: the hub splits it 75/25, mints on the curve, caps the mint where it would dilute the floor, and sweeps whatever the mint does not use into the floor reserve.
- Tokens minted
- 6,902 tokens6,902.613504603754094059 tokens
- Dilution guard
- does not bindcap 14,142.135623730944831162 · curve mint 6,902.613504603754094059 tokens
- Supply after
- 148,323 tokens148,323.969741913258974227 tokens
- Curve reserve after
- 0.008250 ETH8,249,999,999,999,999 wei
- Floor reserve after
- 0.002750 ETH2,750,000,000,000,001 weinothing swept from the curve share
- Floor
- 0.0000000176777 ETH → 0.0000000185405 ETH17,677,669,529 → 18,540,496,217 wei per token
- Spot
- 0.000000106066 ETH → 0.000000111243 ETH106,066,017,177 → 111,242,977,306 wei per token
How this was calculated
- Split the purchase 75 / 25
toCurve = ⌊3x ÷ 4⌋, toFloor = x − toCurve- x
- 1,000,000,000,000,000 wei (0.001 ETH)
⌊3 × 1,000,000,000,000,000 ÷ 4⌋ = 750,000,000,000,000; 1,000,000,000,000,000 − 750,000,000,000,000 = 250,000,000,000,000toCurve = 0.00075 ETH, toFloor = 0.00025 ETHRounded down, so any remainder of the division goes to the floor share. This is the initial split: the guard and the rounding below decide what each reserve finally keeps.GridPadMath.buy() - Mint on the curve
curve mint = ⌊√(S² + ⌊toCurve × 2 · 10⁵⁴ ÷ k⌋)⌋ − S- S
- 141,421,356,237,309,504,880,168 token-wei
- toCurve
- 750,000,000,000,000 wei
- k
- 750,000,000,000,000,000,000,000
⌊√(141,421,356,237,309,504,880,168² + ⌊750,000,000,000,000 × 2 · 10⁵⁴ ÷ 750,000,000,000,000,000,000,000⌋)⌋ − 141,421,356,237,309,504,880,168 = 6,902,613,504,603,754,094,059curve mint = 6,902.613504603754094059 tokensThe integer square root rounds down, so the pool never mints more than the curve share pays for.GridPadMath.buy() - The dilution guard
cap = ⌊toFloor × S ÷ Rf⌋, minted = min(curve mint, cap)- toFloor
- 250,000,000,000,000 wei
- S
- 141,421,356,237,309,504,880,168 token-wei
- Rf
- 2,500,000,000,000,001 wei
⌊250,000,000,000,000 × 141,421,356,237,309,504,880,168 ÷ 2,500,000,000,000,001⌋ = 14,142,135,623,730,944,831,162The cap (14,142.135623730944831162 tokens) is not below the curve mint: 6,902.613504603754094059 tokens minted.The floor share has to back every new token at the current floor, so no buy lowers the floor.GridPadMath.buy() - Settle the curve
S′ = S + minted, Rc′ = ⌊k × S′² ÷ 2 · 10⁵⁴⌋, sweep = Rc + toCurve − Rc′- S + minted
- 148,323,969,741,913,258,974,227 token-wei
- Rc
- 7,499,999,999,999,999 wei
- toCurve
- 750,000,000,000,000 wei
Rc′ = ⌊750,000,000,000,000,000,000,000 × 148,323,969,741,913,258,974,227² ÷ 2 · 10⁵⁴⌋ = 8,249,999,999,999,999; sweep = 7,499,999,999,999,999 + 750,000,000,000,000 − 8,249,999,999,999,999 = 0Rc′ = 0.008249999999999999 ETH; 0 ETH of the curve share moves to the floor reserveThe sweep is the rounding the integer curve could not absorb: a few wei at most when the guard does not bind.GridPadMath.buy() - Fill the floor reserve
Rf′ = Rf + toFloor + sweep- Rf
- 2,500,000,000,000,001 wei
- toFloor
- 250,000,000,000,000 wei
- sweep
- 0 wei
2,500,000,000,000,001 + 250,000,000,000,000 + 0 = 2,750,000,000,000,001Rf′ = 0.002750000000000001 ETHGridPadMath.buy() - The new floor
P_floor′ = ⌊Rf′ × 10¹⁸ ÷ S′⌋- Rf′
- 2,750,000,000,000,001 wei
- S′
- 148,323,969,741,913,258,974,227 token-wei
⌊2,750,000,000,000,001 × 10¹⁸ ÷ 148,323,969,741,913,258,974,227⌋ = 18,540,496,21718,540,496,217 wei (0.000000018540496217 ETH) per token; before: 17,677,669,529 wei (0.000000017677669529 ETH) per tokenThe guard makes Rf′ × S ≥ Rf × S′, so the floor after a buy is never below the floor before it.GridPadMath.floorPrice() - Every wei is accounted for
(Rc′ + Rf′) − (Rc + Rf) = x- Rc′ + Rf′
- 11,000,000,000,000,000 wei
- Rc + Rf
- 10,000,000,000,000,000 wei
11,000,000,000,000,000 − 10,000,000,000,000,000 = 1,000,000,000,000,0000.001 ETH, the purchaseGridPadMath.buy()
The hub also refuses buys while they are paused and after a transaction’s deadline, and a buyer sets a minimum of tokens; the lab models none of these.
02 Floor & supply
hypothetical Example pool: after a buyFour numbers describe a pool. The floor is the floor reserve shared over the supply; spot is what the curve charges for the next token. They come from two different mechanisms, and the chart draws both reserves to scale.
- Circulating supply
- 141,421 tokens141,421.356237309504880168 tokens
- Curve reserve
- 0.007500 ETH7,499,999,999,999,999 wei
- Floor reserve
- 0.002500 ETH2,500,000,000,000,001 wei
- Spot price
- 0.000000106066 ETH106,066,017,177 wei per token
- Redemption floor
- 0.0000000176777 ETH17,677,669,529 wei per tokenin ETH, not a dollar price
- Floor ÷ spot
- 0.166never below a sixth, up to rounding
- Spot − floor
- 0.0000000883883 ETH88,388,347,648 wei per token
- Passed: The slope is K0k = 750,000,000,000,000,000,000,000 (7.5 × 10⁻¹³ ETH per token², scaled by 10³⁶): since hub 1.1.0 no pool's slope changes, and an emptied pool restarts at K0.
- Passed: The curve reserve is ½·k·S²curveValue(S, k) = ⌊k · S² ÷ (2 · 10⁵⁴)⌋ = 7,499,999,999,999,999 wei, the curve reserve: every token can be sold back to the curve.
- Passed: The supply is within the capThe hub refuses any buy that would take the supply past 1,000,000,000,000,000 tokens (MAX_SUPPLY = 10³³ token-wei).
- Passed: A pool with holders has a floor reserveEvery buy puts at least a quarter of its ETH into the floor reserve, and no exit empties it while tokens remain.
- Passed: The floor reserve is at least a third of the curve reserve3 × 2,500,000,000,000,001 ≥ 7,499,999,999,999,999 wei. Each buy sends at least a third as much to the floor as to the curve, and sales, ragequits and rent only raise that share, so a reachable pool’s floor is at least a sixth of its spot price, up to rounding.
How this was calculated
- Redemption floor
P_floor = ⌊Rf × 10¹⁸ ÷ S⌋- Rf
- 2,500,000,000,000,001 wei
- S
- 141,421,356,237,309,504,880,168 token-wei
⌊2,500,000,000,000,001 × 10¹⁸ ÷ 141,421,356,237,309,504,880,168⌋ = 17,677,669,52917,677,669,529 wei (0.000000017677669529 ETH) per tokenEach token’s share of the floor reserve: what a ragequit of one whole token pays, in ETH. It is not a promised dollar price.GridPadMath.floorPrice() - Spot price
P_spot = ⌊k × S ÷ 10³⁶⌋- k
- 750,000,000,000,000,000,000,000
- S
- 141,421,356,237,309,504,880,168 token-wei
⌊750,000,000,000,000,000,000,000 × 141,421,356,237,309,504,880,168 ÷ 10³⁶⌋ = 106,066,017,177106,066,017,177 wei (0.000000106066017177 ETH) per tokenWhat the curve charges for the next token. It moves with every buy and sale; the floor moves only up.GridPadMath.spotPrice() - Curve reserve
Rc = ⌊k × S² ÷ 2 · 10⁵⁴⌋ (½ · k · S²)- k
- 750,000,000,000,000,000,000,000
- S
- 141,421,356,237,309,504,880,168 token-wei
⌊750,000,000,000,000,000,000,000 × 141,421,356,237,309,504,880,168² ÷ 2 · 10⁵⁴⌋ = 7,499,999,999,999,9990.007499999999999999 ETHThe area under the price line from 0 to S: enough to buy every token back on the curve.GridPadMath.curveValue() - Floor against spot
floor ÷ spot, spot − floor- floor
- 17,677,669,529 wei
- spot
- 106,066,017,177 wei
17,677,669,529 ÷ 106,066,017,177 = 0.166; 106,066,017,177 − 17,677,669,529 = 88,388,347,648floor = 0.166 × spot; spot is 88,388,347,648 wei (0.000000088388347648 ETH) per token above the floorRent and sales raise the floor without raising spot, so the floor can sit above spot. It never falls below a sixth of spot, up to rounding.GridPadMath.floorPrice(), spotPrice()
03 Ragequit
hypothetical Example pool: after a buyBurn tokens for exactly their share of the floor reserve. The payout does not depend on spot, and the burned tokens’ curve value stays behind for the holders who remain.
- Payout
- 0.000250 ETH250,000,000,000,000 weiin ETH
- Tokens burned
- 14,142 tokens14,142.135623730950488016 tokens
- Supply after
- 127,279 tokens127,279.220613578554392152 tokens
- Floor reserve after
- 0.003675 ETH3,675,000,000,000,000 wei
- Curve value left to the floor
- 0.001425 ETH1,424,999,999,999,999 wei
- Floor
- 0.0000000176777 ETH → 0.0000000288735 ETH17,677,669,529 → 28,873,526,898 wei per token+63.33% for the holders who stay
How this was calculated
- The floor before
P_floor = ⌊Rf × 10¹⁸ ÷ S⌋- Rf
- 2,500,000,000,000,001 wei
- S
- 141,421,356,237,309,504,880,168 token-wei
⌊2,500,000,000,000,001 × 10¹⁸ ÷ 141,421,356,237,309,504,880,168⌋ = 17,677,669,52917,677,669,529 wei (0.000000017677669529 ETH) per tokenGridPadMath.floorPrice() - The payout
out = ⌊b × Rf ÷ S⌋- b
- 14,142,135,623,730,950,488,016 token-wei
- Rf
- 2,500,000,000,000,001 wei
- S
- 141,421,356,237,309,504,880,168 token-wei
⌊14,142,135,623,730,950,488,016 × 2,500,000,000,000,001 ÷ 141,421,356,237,309,504,880,168⌋ = 250,000,000,000,000out = 0.00025 ETHThe contract multiplies before it divides, so the payout is b’s exact share of the floor reserve rounded down once, not b times the rounded floor price.GridPadMath.ragequit() - The burned tokens’ curve value stays
release = Rc − ⌊k × (S − b)² ÷ 2 · 10⁵⁴⌋ (½ · k · b · (2S − b))- Rc
- 7,499,999,999,999,999 wei
- S − b
- 127,279,220,613,578,554,392,152 token-wei
7,499,999,999,999,999 − 6,075,000,000,000,000 = 1,424,999,999,999,9990.001424999999999999 ETH moves from the curve reserve to the floor reserveThe curve no longer owes anything for the burned tokens, so their curve value backs the holders who remain.GridPadMath.ragequit() - The pool after
S′ = S − b, Rf′ = Rf − out + release- Rf
- 2,500,000,000,000,001 wei
- out
- 250,000,000,000,000 wei
- release
- 1,424,999,999,999,999 wei
2,500,000,000,000,001 − 250,000,000,000,000 + 1,424,999,999,999,999 = 3,675,000,000,000,000S′ = 127,279.220613578554392152 tokens, Rf′ = 0.003675 ETHGridPadMath.ragequit() - The floor after
P_floor′ = ⌊Rf′ × 10¹⁸ ÷ S′⌋- Rf′
- 3,675,000,000,000,000 wei
- S′
- 127,279,220,613,578,554,392,152 token-wei
⌊3,675,000,000,000,000 × 10¹⁸ ÷ 127,279,220,613,578,554,392,152⌋ = 28,873,526,89828,873,526,898 wei (0.000000028873526898 ETH) per token; before: 17,677,669,529 wei (0.000000017677669529 ETH) per tokenout × S ≤ b × Rf, so Rf′ ÷ S′ ≥ Rf ÷ S: a ragequit never lowers the floor for those who stay.GridPadMath.ragequit()
- Not a transaction: the lab only calculates, and nothing is sent.
- The payout is in ETH, and ETH’s dollar value changes.
- Nothing here promises a profit or a fixed dollar value.
- A real ragequit pays from the token’s state when it executes, which can differ from the state used here.
04 Protocol reference
The rules
- Split
toCurve = ⌊3x ÷ 4⌋, the rest to the floor reserve- Slope
K0 = 750,000,000,000,000,000,000,000(7.5 × 10⁻¹³ ETH per token², × 10³⁶), the same for every pool since v1.1.0- Smallest buy
MIN_BUY = 10⁹ wei(0.000000001 ETH)- Supply cap
MAX_SUPPLY = 10³³ token-wei(1,000,000,000,000,000 tokens)- Precision
- 18 decimals for ETH and for tokens; every division rounds down, in the pool’s favour
Where they live
GridPadMath.sol: buy, sell, ragequit, curveValue, spotPrice, floorPriceGridPadHub.sol: the refusals (MIN_BUY, a zero payout, the supply cap) and the restart of an emptied pool at K0src/lib/protocol/hub-math.ts: the exact mirror the lab runs, held to the wei against a local hub, a fork of the mainnet hub and the mainnet hub’s recorded trades- The ratchet math, formulas 1 to 9, and token analytics
The deployed contract
- Network
- Robinhood Chain Mainnet · chain 4663
- Implementation
- 0x0115…5111 ↗ · v1.1.0 · verified source ↗
- Verified
- against the live hub on 17 October 2026 at block 90,882,978 (deployment record)