This is the simplest order type since it has very few required parameters. It's also the riskiest since it leaves the execution exposed to whatever the market price is for the tokens being swapped. Here is an example of a market order:

const mkt = new MarketSwap({
    amountIn:  units.inBNUnits("1", 18),
    tokenOut: matic,
    tokenIn: weth,
    slippage: new Slippage(.5, false)

That's it. The tokens, amount of input, and slippage are all that's needed to get a quote and submit for execution.

Last updated