I have quite hard time to understand how to use this. I'm playing with testing account, and succeeded to "buy" xrp with my usdt like this: NOTE: I use binance, and my orders is based on quote price.
params = {
'quoteOrderQty': 20,
}
const order = await binance.createOrder('XRP/USDT', 'market', 'buy', null, null, params)
order.push(order)
later, I tried to sell my xrp for usdt, by I keep getting precision error:
binance order amount should be evenly divisible by lot size
And I read that the amountToPrecision
is the answet, but I didn't get yet how to use this.
I tried like this without any success:
params = {
'quoteOrderQty': binance.amountToPrecision('XRP/USDT', 20),
}
const order = await binance.createOrder('XRP/USDT', 'market', 'sell', null, null, params)
Any ideas how can I solve this problem?