Calculating prices and graduation progress
> V3 publication draft; not yet published. Economic terms follow the unfrozen specification v2 draft. {{待冻结}} means pending reconciliation with the final frozen specification. This page does not apply to V2 or existing tokens. Available actions depend on the verified release manifest.
Use inputs from the same authenticated release, project version and canonical block. Handle onchain amounts as integer raw units rather than floating-point values. OKB and these project tokens have 18 decimals; whole units equal raw / 10^18.
Exact curve arithmetic
Let C=curveSupply, VT=virtualToken, VQ=virtualQuote, T=target, I=current inventory and R=current reserve, all in raw units. Define ceilDiv(a,b)=ceil(a/b) and K=(C+VT)×VQ.
| Parameter | Whole units | Raw |
|---|---|---|
| C | 750 million tokens {{待冻结}} | 750000000000000000000000000 {{待冻结}} |
| VT | 375 million tokens {{待冻结}} | 375000000000000000000000000 {{待冻结}} |
| VQ | 35 OKB {{待冻结}} | 35000000000000000000 {{待冻结}} |
| T | 70 OKB {{待冻结}} | 70000000000000000000 {{待冻结}} |
Ordinary buys use total rate q=max(protocolBps+buyTax, Anti(r)); the opening purchase uses q=protocolBps+buyTax. For gross G:
protocol=floor(G×protocolBps/10000).base=floor(G×(protocolBps+tax)/10000),project=base−protocol.total=floor(G×q/10000),anti=total−base,N=G−total.- Buy output
A=I+VT−ceilDiv(K,R+VQ+N).
For exact token output A, calculate N=ceilDiv(K,I+VT−A)−(R+VQ), then G=floor((N−1)×10000/(10000−q))+1 for N>0. Gross is zero for N=0. Actual trades also check nonzero output, inventory, caps and slippage; these equations alone do not establish a valid transaction.
Selling A produces curve gross R+VQ−ceilDiv(K,I+VT+A). Apply fees at q=protocolBps+sellTax for net output and verify gross does not exceed real reserves. Use the contract’s quoteSellExactOutput for exact-output sells. Unreachable integer outputs are rejected rather than forced through a continuous approximation.
The bps denominator is 10000. Project tax is the rounded combined normal-fee difference, not a separately rounded multiplication. Revenue allocation also uses split3 and cumulative interval remainders. See launch protection for exact Anti examples. Spot price times amount does not replace integration.
Prices, USD and progress
Before graduation, marginal price is P=(R+VQ)/(I+VT), in OKB per token when decimals match. FDV=P×totalSupply; market cap requires a disclosed circulation measure. USD display equals OKB amount×OKB/USD reference price. Disclose source, timestamp and unavailable data, without changing graduation conditions.
Pre-graduation progress is R/T×100%, optionally clamped to 0%–100% for display. This is a ratio definition, not a new parameter. Sells can reduce it. When graduated=true, show 100% even though graduation clears Curve’s R. Rounded display progress does not trigger graduation; inventory must also be sold out.
After graduation, read the actual v4 pool. sqrtPriceX96 is the square root of the raw currency1/currency0 ratio times 2^96; the raw ratio is sqrtPriceX96²/2^192. Multiply by 10^(decimals0−decimals1) for whole-unit pricing, then invert if token/OKB ordering requires it. The v4 pool fee is 3000 / 1000000 = 0.30% {{待冻结}}, excluding Hook protocol fees and project tax. Execution also depends on active-range liquidity, route, Hook fees, gas and transaction bounds.