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:
swap route token in out is token0
Parameters
| Parameter | Type |
|---|---|
quote | Pick<QuoteResult, "token0Symbol" | "token1Symbol" | "tokenInIsToken0" | "fee"> |
quote result token0 symbol token1 token in is
Returns
swap route
Example
const route = swapRouteFromQuote(quote);
await swaps.swap(route.tokenIn, route.tokenOut, route.fee, { exactIn: '100' }, { pool: route.pool });