Trading guide
Choose the right market, protect your quote, and understand what leaves your wallet.
Check the lifecycle first
Before opening, formation trade transactions revert. While formation is open, trade against FormationMarket. After graduation, use the permanent ETH/SHOOK pool and PermanentMarketRouter. A quote is a view of a particular state, not a guarantee that the state will still exist when your transaction lands.
Read graduated and currentTarget, then refresh your quote immediately before submitting. The target can fall as timestamp epochs elapse. If a quote crosses the remaining formation inventory, request a smaller exact output or use an exact ETH input buy that can clamp and refund.
Four ways to trade
| Intent | Protection | Payment and approval |
|---|---|---|
| Buy with exact ETH input | minShookOut and deadline | Send ETH as msg.value; unused ETH returns to the payer. |
| Buy exact SHOOK output | maxETHIn and deadline | Supply sufficient msg.value; excess ETH returns to the payer. |
| Sell exact SHOOK input | minETHOut and deadline | Approve the active market spender for shookIn. |
| Sell for exact ETH output | maxShookIn and deadline | Approve the active spender up to the maximum input. |
Buying during formation
- Confirm the chain, token, FormationMarket address, and immutable opening time against the published deployment manifest.
- Call quoteBuyExactInput or quoteBuyExactOutput. Include every returned fee in the ETH budget.
- Choose a receiver and a short deadline in Unix seconds. Set output or input protection from your accepted slippage.
- Simulate the transaction, then submit it. The payer needs ETH for both the trade and gas.
- Wait for a successful receipt and reconcile FormationBuy. A boundary buy can graduate the market in the same transaction.
Selling during formation
Approve FormationMarket to transfer the SHOOK you intend to sell. A formation sell reduces the curve reserve by its gross curve value; approximately 89% is paid to the seller, 10% accrues to the creator, and 1% goes to the reserve vault. These percentages are applied to the curve value, not the prior purchase cost.
For an exact ETH output sell, the contract finds the smallest sufficient SHOOK input. Integer rounding above the requested ETH output goes to the reserve vault. It never sends that rounding surplus to the seller.
After graduation
Refresh the pool quote through the configured v4 quoter. The canonical pool uses native ETH, not a WETH currency address. The permanent router exposes the same four user intents, but the underlying pricing now comes from v4 liquidity rather than FormationMath.
Approvals to FormationMarket do not authorize PermanentMarketRouter. Review the spender when changing stages. The pool charges a static 1% LP fee in the input asset, and execution can move the market price.
If a transaction fails
A reverted transaction rolls back contract changes but can still consume gas. Common causes include a passed deadline, stale slippage bounds, insufficient allowance or funds, an unopened market, and graduation between quote and execution. A contract receiver or payer must also accept native ETH when a payout or refund is due. See Errors and recovery.
Source reference
Checked against the source shipped with this documentation. Contract calls and units are detailed in the contract reference.
Imported source files 60
Supporting contracts, interfaces, and libraries imported by the sources above, including their dependencies.