Formation market
Distribution against a refundable reserve curve, with separate creator revenue and reserve fees.
Opening and inventory
The immutable opensAt timestamp gates trading, target synchronization, and graduation. Merely passing that timestamp does not submit any transaction. Quotes can be read beforehand, but they do not grant permission to trade early.
Formation starts with 500M SHOOK of inventory. circulatingSupply tracks tokens distributed through formation minus tokens sold back. It is an accounting position on the curve, not necessarily the ERC-20 balance held by all external wallets; normal transfers and burns do not update it.
Buy accounting
For a requested token output, calculate the increase in refundable curve reserve, ΔR. Formation gross is ceil(ΔR / 0.90). The creator contribution is gross minus ΔR. A trading fee of floor(gross × 1%) is added on top of gross. The creator trading share is floor(gross × 0.5%); the remaining trading fee goes to ReserveVault.
reserve principal = R(supplyAfter) − R(supplyBefore)
formation gross = ceil(reserve principal × 10,000 / 9,000)
creator contribution = formation gross − reserve principal
trading fee = floor(formation gross × 100 / 10,000)
creator trading fee = floor(formation gross × 50 / 10,000)
reserve fee = trading fee − creator trading fee
total ETH paid = formation gross + trading feeSell accounting
A sell removes the full curve reserve decrease from reservePrincipal. Both creator contribution and reserve fee are deducted from that curve value. Returned SHOOK goes back into formation inventory.
gross curve value = R(supplyBefore) − R(supplyAfter)
creator contribution = floor(gross curve value × 10%)
reserve fee = floor(gross curve value × 1%)
seller refund = gross curve value − contribution − reserve feeSolvency accounting
After each completed formation trade, reservePrincipal must equal FormationMath.reserveAt(circulatingSupply). The ETH retained in FormationMarket must cover reservePrincipal plus creatorAccrued minus creatorClaimed. Creator revenue remains payable independently of the current curve position.
Ordinary empty-calldata ETH transfers to FormationMarket revert. Use the named trade methods; direct token transfers are not purchases and do not create a curve claim.
Boundary behavior
An exact ETH input buy binary-searches the largest affordable output within the current target. It sends unspent ETH back to msg.sender. An exact SHOOK output buy must fit within the remaining target and the caller’s ETH cap. Reaching the target on a buy atomically invokes graduation.
If a target reduction makes existing circulation sufficient to graduate, anyone can call syncFormation. A buy in that state reverts FormationReady. The target review itself is described in Adaptive target.
Source reference
Checked against the source shipped with this documentation. Contract calls and units are detailed in the contract reference.
Imported source files 47
Supporting contracts, interfaces, and libraries imported by the sources above, including their dependencies.