The bonding curve
Constant product against a phantom quote reserve. The phantom reserve sets the first buyer's price and is never real money; the creator puts up no counter-capital.
quoteReserve = phantomQuote + realQuotetokensOut = (in × (10000 − fee) × tokenReserve) / (quoteReserve × 10000 + in × (10000 − fee))
- The reserved allocation. The curve never sells
supply × phantomQuote / (phantomQuote + graduationThreshold)tokens. They pass to the factory at graduation, so every launch opens its pool with the same amounts at the same price. - Graduation trigger.
readyToGraduate()is true oncesellableTokens() == 0. -
Partial fills. A buy that would cross the allocation is filled up to it, charged only for
what it received, and refunded the rest (
CurveBuyRefunded). For a partial fill,minTokensOutbounds the price rather than the quantity. - Fees are always in the quote asset. On a buy they come off the input; on a sell, off the output.
- Selling closes with the allocation. Once the sellable tokens run out,
sellcloses too; anyone can then graduate the token and trade in the pool.