LaunchViewModule at 0xce83E3659251116d114Ec1CA729ffB49B99403c3. They are pure, free to call, and take local launch state as parameters. The pattern is: read launch state from the hook, pass it to the view module.
After bonding, use the Uniswap V4 Quoter at 0x3972C00f7ed4885e145823eb7C655375d275A1C5 instead.
previewBuyLocal
| Return field | Meaning |
|---|---|
tokensOut | Tokens you would receive at the current curve price |
cost | ETH actually consumed by the curve (may be less than ethIn if your buy would push past the bond target) |
refund | ETH that would be refunded (ethIn - cost, or zero if the curve absorbs all of it) |
tokensRemaining | Tokens left on the curve after the hypothetical buy |
refund is non zero, your buy would trigger the bond. Both the curve buy and the bond happen in the same transaction when you execute.
The local params come from getLaunchState(launchId):
saleSupply=state.saleSupplytargetRaise=state.targetRaisegainBps=state.gainBpssold=state.soldremaining=state.saleSupply - state.sold
previewSellLocal
| Return field | Meaning |
|---|---|
netPayout | ETH you would receive after fees |
protocolFee | ETH taken as the 1 percent protocol fee |
creatorFee | ETH credited to the creator from the variable fee |
buybackFee | ETH credited to the buyback module from the variable fee |
netPayout + protocolFee + creatorFee + buybackFee equals the gross curve payout for tokenAmount.
Local params come from getLaunchState(launchId) plus the protocol constants (PROTOCOL_FEE_BPS = 100, VARIABLE_FEE_BPS = 100, BPS_DENOMINATOR = 10000).
previewSaleSplit
| Return field | Meaning |
|---|---|
saleSupply | Tokens sold through the curve |
liquiditySupply | Tokens paired with ETH in the V4 pool at bond |
salePortionBps | saleSupply as bps of total supply |
marginalPrice | Price of the last token on the curve |
poolPrice | Opening price of the V4 pool |
marginalPrice and poolPrice are equal by design. The split is chosen so the curve hands off to the pool without a price gap.
previewSaleSplit is also callable on the hook (the hook delegates to the view module’s previewSaleSplit selector for this read).
Off chain reading
The simplest way to call these from JavaScript:cast from Foundry:
Post bond quotes
After a token bonds, the preview functions on the view module no longer reflect tradable price. Use the Uniswap V4 Quoter instead:eth_call rather than called directly. Most viem and ethers clients handle this transparently.