Skip to main content

Function: swapRouteFromQuote

swapRouteFromQuote(quote): SwapRoute

The route of a quote: its fee tier and pool, with tokenIn / tokenOut taken from tokenInIsToken0, nothing re-derived. Use it to swap in exactly the pool a quote priced:

Parameters​

ParameterType
quotePick<QuoteResult, "token0Symbol" | "token1Symbol" | "tokenInIsToken0" | "fee">

Returns​

SwapRoute

Example​

const route = swapRouteFromQuote(quote);
await swaps.swap(route.tokenIn, route.tokenOut, route.fee, { exactIn: '100' }, { pool: route.pool });