Skip to main content

Function: swapRouteFromQuote()

gSwap SDK 2.0.0-rc.4


gSwap SDK 2.0.0-rc.4 / swapRouteFromQuote

Function: swapRouteFromQuote()

swapRouteFromQuote(quote): SwapRoute

Defined in: packages/gswap-sdk/dist/index.d.ts:3216

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​

quote​

Pick<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 });