// quoteExactIn() is a thin wrapper — same internal fetch/simulate/trim as swapExactIn(), just
// returns the quote without building instructions.
const quoteOutput = await pool.quoteExactIn({ xToY: true, amountIn: 1_000_000n, slippageToleranceBps: 50 });
const { quoteOutput: sameQuote, instructions } = await pool.swapExactIn(userSigner, {
xToY: true,
amountIn: 1_000_000n,
slippageToleranceBps: 50,
});
// swapExactOut()/quoteExactOut() fix the output amount instead — the trader specifies exactly
// what they want to receive, and pays whatever gross input that requires (capped by
// slippageToleranceBps via maxAmountIn on the quote output).
const { quoteOutput: exactOutQuote, instructions: exactOutInstructions } = await pool.swapExactOut(userSigner, {
xToY: true,
amountOut: 1_000_000n,
slippageToleranceBps: 50,
});