Prerequisites
Before you begin, ensure that you’ve: These are required so any example below runs with a validkit and adapter.
Estimate swap amount
This example estimates how much EURC you’ll receive when swapping 1.00 USDC for EURC:TypeScript
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Arc Network is EVM compatible with some unique differences. Review EVM differences before building with Arc.
Get a pre-swap estimate of the amount to receive before swapping
kit and adapter.
const params = {
from: { adapter, chain: "Arc_Testnet" },
tokenIn: "USDC",
amountIn: "1.00",
tokenOut: "EURC",
config: {
kitKey: process.env.KIT_KEY as string,
},
};
// Estimate swap amount
const estimate = await kit.estimateSwap(params);
console.log(`Estimated output: ${estimate.estimatedOutput}`);
// Proceed to swap
const result = await kit.swap(params);
Was this page helpful?