Finding The Best Quote
Introduction
Finding the optimal quote for a givien tokens path can be obtained through the LBQuoter
contract. This contract will find the best combinations of swaps accross the V1, V2, V2.1 and V2.2 pairs in order to optimise cost.
The rest of the document describes:
Which functions to call to get the optimal quote from an input and output amount.
Code examples that illustrate use cases.
Find The Best Quote From Amount In
This function retrieves the best route of swaps for a given input amount.
The output of this function is quite substantial. Here are the specifications to understand it better:
Code Example
In this example, we want to swap 10 USDC to USDT. A possible route is to go through the WSEI route in between:
Find The Best Quote From Amount Out
This function retrieves the best route of swaps for a given output amount.
Code Example
In this example, we want to own 10 USDC and we would like to know how many USDT is required to perform the if we want to go through the WSEI route:
Last updated