Returns the percent difference between the mid price and the execution price, i.e. price impact.
@param midPrice mid price before the trade
@param inputAmount the input amount of the trade
@param outputAmount the output amount of the trade
comparator function that allows sorting trades by their output amounts, in decreasing order, and then input amounts
in increasing order. i.e. the best trades have the most outputs for the least inputs and are sorted first
Given a currency amount and a chain ID, returns the equivalent representation as the token amount.
In other words, if the currency is ETHER, returns the WETH token amount for the given chain. Otherwise, returns
the input currency amount.