Skip to content
DegenX Docs
Arc mainnetOpen app

Buy, sell & quote

Use the Launchpad ABI for writes and the Gauge ABI for quotes. Check chain ID 5042, resolve tokenToGauge(token), and read the launch phase before choosing a route.

function buyExactQuote(address token, uint256 quoteIn, uint256 minAmountOut)
external payable returns (uint256 tokensOut, uint256 quoteSpent);
function buyExactTokens(address token, uint256 amountOut, uint256 maxQuoteIn)
external payable returns (uint256 tokensOut, uint256 quoteSpent);
function sellExactTokens(address token, uint256 amountIn, uint256 minAmountOut, bool unwrap)
external returns (uint256 quoteOut);
function sellExactQuote(address token, uint256 quoteOut, uint256 maxAmountIn, bool unwrap)
external returns (uint256 tokensIn);

On Arc, use msg.value = 0 for buys and unwrap = false for sells. Native and ERC-20 USDC share a balance, but the deployed trade entry points pull ERC-20 USDC using allowance.

function quoteBuyExactQuote(uint256 quoteIn, address buyer) external view
returns (uint256 tokensOut, uint256 net, uint256 fee, uint256 tax, uint256 snipe);
function quoteBuyExactTokens(uint256 amount, address buyer) external view
returns (uint256 gross, uint256 net, uint256 fee, uint256 tax, uint256 snipe);
function quoteSellExactTokens(uint256 amount) external view
returns (uint256 net, uint256 gross, uint256 fee, uint256 tax);
function quoteSellExactQuote(uint256 quoteOut) external view
returns (uint256 tokensIn, uint256 gross, uint256 fee, uint256 tax);

Quotes are public reads. The buyer must match the address that will call the launchpad: it determines anti-snipe treatment. Fees use the launch’s quote asset, while token amounts use 18-decimal token units.

  1. Confirm gaugeActive() and that the curve is not complete/refunding.
  2. Check AccessRegistry.isAccessible(wallet).
  3. Read the current buy quote using the actual caller.
  4. Approve USDC to the launchpad for the intended spend; wait for success.
  5. Refresh the quote and choose a non-zero minimum token output.
  6. Simulate the exact transaction from that wallet, then sign and wait for the receipt.
  7. Read the gauge’s Buy event for actual input, token output and fees. A final buy may partially fill.

For 0.10 USDC, quoteIn = 100000. For 1 token, amountIn = 1000000000000000000. Never pass a native 18-decimal USDC amount into a six-decimal ERC-20 quote field.

Approve the launch token, not USDC, to the launchpad. Quote the exact token amount, choose a non-zero minimum USDC output, simulate sellExactTokens(token, amountIn, minQuoteOut, false), sign, and verify the gauge’s Sell event.

Slippage is a user-selected protection against state changes. The protocol’s 3% internal price-impact cap is not a universal 3% user-trade slippage setting.

Curve quote and trade functions are not a pool router. Resolve gauge.adapter() and gauge.poolId(), then obtain poolKeyOf(token) from that adapter. Use the deployed Universal Router, Permit2, and a pool-aware quoter listed in contracts.

Arc’s deployed router integration uses an ExactInputSingleParams tuple containing minHopPriceX36 between amountOutMinimum and hookData. Omitting that field produces incorrectly encoded calldata. Use the maintained DegenX frontend encoder rather than copying an older tuple from another network.

Approvals and Permit2 authorizations should be limited to the actual input, router and intended duration. The same launch token continues to trade after graduation, but the routing and pool fee calculation change.

The fresh-wallet mainnet test exercised an approval, buy, token approval and sell using these direct calls. The wallet was not in either allowlist.