Each token uses a shifted constant-product curve with 18-decimal integer arithmetic.
Constants
Invariant
Let:
s be sold curve tokens in base units;
r be active ETH principal in wei;
Vt be the virtual token reserve;
Ve be the virtual ETH reserve;
K = Vt × Ve.
The virtual coordinates are:
The contract uses Solidity integer arithmetic. Outputs round down, while the post-trade virtual ETH coordinate uses ceiling division. Those rounding rules are part of the implementation.
For a nonterminal buy with net curve input Δr, the contract computes:
For a sell of Δs tokens:
The reported spot price is ceil((Ve + reserveCoordinate) × 1e18 / (Vt - s)) wei per whole token. Price rises as buys reduce virtual token inventory and add net reserve; sells reverse that movement before graduation.
The curve formula does not guarantee value, liquidity at a desired price, or graduation. Transaction ordering and slippage can materially change execution.