Optional
amountOptional
amountOptional
options?: { Promise resolving to the transaction object representing the market order with the result of the order.
import { marketOrder } from '@clober/v2-sdk'
import { privateKeyToAccount } from 'viem/accounts'
const transaction = await marketOrder({
chainId: 421614,
userAddress: '0xF8c1869Ecd4df136693C45EcE1b67f85B6bDaE69
inputToken: '0x00bfd44e79fb7f6dd5887a9426c8ef85a0cd23e0',
outputToken: '0x0000000000000000000000000000000000000000',
amount: '100.123', // 100.123 USDC
options: { erc20PermitParam }
})
Executes a market order on the specified chain for trading tokens. If only
amountIn
is provided, spend the specified amount of input tokens. If onlyamountOut
is provided, take the specified amount of output tokens.