The price expressed in terms of output amount/input amount.
Fees paid to the pairs.
The input amount for the trade assuming no slippage.
The mid price after the trade executes assuming no slippage.
The output amount for the trade assuming no slippage.
The percent difference between the mid price before the trade and the trade execution price.
The route of the trade, i.e. which pairs the trade goes through.
Get the minimum amount that must be received from this trade for the given slippage tolerance
tolerance of unfavorable slippage from the execution price of this trade
Return the execution price after accounting for slippage tolerance
the allowed tolerated slippage
Given a list of pairs, and a fixed amount in, returns the top maxNumResults
trades that go from an input token
amount to an output token, making at most maxHops
hops.
Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting
the amount in among multiple routes.
the pairs to consider in finding the best trade
exact amount of the input token to spend
the desired token out
used in recursion; the current list of pairs
used in recursion; the current list of best trades
Generated using TypeDoc
Represents a trade executed against a list of pairs. Does not account for slippage, i.e. trades that front run this trade and move the price.