For the complete documentation index, see llms.txt. This page is also available as Markdown.

Trading Integration

Choose a V4 router that supports MemeHookV2's returned fee adjustment. Read the Factory and Hook to identify the launch and pool; the selected router provides swap encoding, quotes and settlement.

Build and submit a swap

  1. Read the Pro Factory record and confirm graduation status PoolCreated.

  2. Read the official pool ID and active configuration from the Hook proxy. Confirm the Quote, sorted currencies and tick spacing.

  3. Select Exact Input or Exact Output. Derive direction from the input currency's position in the PoolKey.

  4. Supply optional Partner hookData; see Partner and HookData.

  5. Follow the router's ERC20/Permit2 approval flow for the actual input asset and spender.

  6. Quote and simulate the complete calldata with the sending wallet, balances, fees, deadline and final amount limits.

  7. Submit and confirm the successful receipt, then display actual asset transfers and fees.

For Exact Input, the user specifies input and accepts a minimum final output. For Exact Output, the user requests output and accepts a maximum total input. A token buy or sell can use either mode.

Enforce final amounts

Hook fees reduce output for Exact Input and increase input for Exact Output. Include the base Hook fee and Creator Tax in the router's final checks. These fees can be denominated in Quote or launch tokens; use the fee-asset table and formulas.

A price limit can produce a partial fill. Display actual input spent and output received instead of assuming the request was fully filled. Gas is a separate network cost; see Fees and Claims.

PoolManager invokes Hook callbacks as part of execution; wallets call the router rather than afterSwap or other callbacks directly.

If the token is still Swept, use Graduation to create or retry its pool. If timed recovery is available, Emergency Exit is a different path from a swap.

Last updated

Was this helpful?