DocimasyDocimasy
Curve

There is exactly one reserve a supply can produce.

The key that takes supply from k to k+1 costs k² / 16,000 SOL. Sum that staircase and the reserve after n keys is fixed. Because 1e9 / 16,000 is 62,500 exactly, the whole thing stays in integers — there is no rounding to argue about.

reserve(n) = 62,500 · (n−1)·n·(2n−1) / 6      lamports

n is the supply before a sale, so the first key costs 0² / 16,000 — nothing. The reference protocol's documentation says after. Anyone implementing from that sentence over-quotes every trade by one full step of the staircase, and would never see it: the shape is right, the units are right, only the answer is wrong.

The staircase

Supply nNext key costsReserve at nIn lamports
10.000062 SOL0.0000 SOL0
20.000250 SOL0.0000 SOL62,500
30.000562 SOL0.0003 SOL312,500
100.006250 SOL0.0178 SOL17,812,500
250.039062 SOL0.3062 SOL306,250,000
500.156250 SOL2.5265 SOL2,526,562,500
1000.625000 SOL20.5218 SOL20,521,875,000
2554.064062 SOL343.4159 SOL343,415,937,500
1,00062.500000 SOL20,802.0937 SOL20,802,093,750,000

The fee has to add up

7% each way, split three ways. Rounding each share on its own leaves lamports on the floor, so the shares are apportioned by largest remainder and the identity holders + subject + protocol = fee holds for every input, including a fee of ten lamports.

Buying five keys at supply 250
curve takes19.8456 SOL
fee, 7%1.3891 SOL
→ holders, 2.5%0.4961
→ subject, 3%0.5953
→ protocol, 1.5%0.2976
the three add up1,389,193,750 = 1,389,193,750 lamports

Check it yourself: POST /api/quote returns the same split with a conserves field, and GET /api/curve?supply=250 returns the ladder above.