KuCoin create order by quote amount not working?
See original GitHub issueWhen I try to create a new market buy/sell order on KuCoin by providing the quote amount using the quoteAmount
parameter, like this:
kucoin.createOrder(symbol, 'market', 'buy', (void 0), (void 0), {
'quoteAmount': value
});
I receive the following error [here]:
TypeError: Cannot read property 'toString' of undefined
.
I saw that this has been implemented more than a year ago in #6035, but I think there is a problem with that:
if (this.safeValue (params, 'quoteAmount')) {
// used to create market order by quote amount - https://github.com/ccxt/ccxt/issues/4876
request['funds'] = this.amountToPrecision (symbol, amount); //<- ERROR! 'amount' used here accidentally instead of value of 'quoteAmount'?
} else {
request['size'] = this.amountToPrecision (symbol, amount);
}
- Programming Language version: Node.Js v14.15.5
- CCXT version: v1.43.71
- CCXT Pro version: v0.6.9
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Order size increment invalid · Issue #112 - GitHub
The priceIncrement field specifies the min order price as well as the price increment.This also applies to quote currency. The order price must ......
Read more >Explanation of problems when publish the ads? - KuCoin
Setting an ad floating quote means that your quote is a floating price. You can set a premium or a cut-rage price. Q2.What...
Read more >KuCoin API Documentation: General
General. Introduction. Welcome to KuCoin's trader and developer documentation. These documents outline the exchange functionality, market details, and APIs.
Read more >[Spot Grid] Introduction to Parameters - KuCoin
Price ” composed the price range of the spot trading. No. of Orders Placed: Total number of placed sell/buy orders. It is used...
Read more >Open Orders Did Not Go Through - KuCoin
If an order has remained open for an extended period, it may be that the price you entered is not consistent with the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@frzsombor
The problem is that by logical reasoning
funds
should accept quote cost precision, but KuCoin API still accepts base precision only. I’ve pushed another fixup, please let me know if you still have this issue with 1.43.80, it will be available in ~20 minutes.Unfortunately still not working, getting the same “Error: Balance insufficient!” error.
Now, it looks like the new costToPrecision leaves the
request['funds']
at 8 number length precision (0.00061202
), but KuCoin only accepts 5(-6?) as I found above.And this is actually strange, because when I’ve checked
this.markets[symbol].precision
it showedprecision: {amount: 4, price: 8}
, for the symbol, so I don’t understand the problem. Is KuCoin giving bad market data (and this is whyamountToPrecision
was used until v1.43.76) orcostToPrecision
is used accidentally instead ofamountToPrecision
/priceToPrecision
?