Comment on page
Represents a trade where a proportion of the trade can be routed via similar pair pools which consist of the input and output token. A Trade instance is created on the assumption that trade simulation has been correctly carried out elsewhere.
Creates a Trade instance with a single hop. Does not validate the result of swapping through the route and is meant to be used when trade simulation has been done elsewhere.
Returns the mid price of the route.
Returns the amount of input tokens for the trade assuming no slippage.
Returns the amount of output tokens resulting from the trade assuming no slippage.
The price which the trade is executed at denoted in
Returns the percentage price difference between the route's mid price and the executed price (i.e. the price impact).
Given a slippage tolerance value, returns the minimum amount of output tokens resulting from this trade.
Given a slippage tolerance value, returns the maximum amount of input tokens that the trade requires to be executed successfully.
Given a slippage tolerance value, returns the worst price that the trade can be executed at.