Skip to main content
The preview functions live on the 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

If 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.saleSupply
  • targetRaise = state.targetRaise
  • gainBps = state.gainBps
  • sold = state.sold
  • remaining = state.saleSupply - state.sold

previewSellLocal

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

Use this before launch to see how the supply will be split between the bonding curve and the post bond 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:
Using 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:
The V4 Quoter is non view (it uses revert-data for the answer), so it has to be simulated through eth_call rather than called directly. Most viem and ethers clients handle this transparently.