Trade
#
Imported typesTrade#
TradeOptions#
TradeType#
#
Query schemas#
tokenEqualsChecks if the current instance is equal to another (has an identical chainId and address).
#
createTradeCreates a new trade.
#
tradeExecutionPriceCalculates the average price that the trade would execute at.
#
tradeNextMidPriceWhat the new mid price would be if the trade were to execute.
#
tradeSlippageThe slippage incurred by the trade. (strictly > 0.30%) result is a percent like 100.0%
#
tradeMinimumAmountOutTrades the minimum amount out.
#
tradeMaximumAmountInTrades the maximum amount out.
#
bestTradeExactInGiven a list of pairs, a fixed amount in, and token amount out, this method returns the best maxNumResults trades that swap an input token amount to an output token, making at most maxHops hops. The returned trades are sorted by output amount, in decreasing order, and all share the given input amount.
#
bestTradeExactOutSimilar to the above method, but targets a fixed output token amount. The returned trades are sorted by input amount, in increasing order, and all share the given output amount.