kucoin-python-sdk icon indicating copy to clipboard operation
kucoin-python-sdk copied to clipboard

{"code":"100003","msg":"Contract parameter invalid"}

Open BaseMax opened this issue 2 years ago • 9 comments

Source

from kucoin.client import Trade

api_key = 'xxxxxx'
api_secret = 'xxxxxx'
api_passphrase = 'xxxxxx'

client = Trade(key=api_key, secret=api_secret, passphrase=api_passphrase, is_sandbox=False, url='https://api-futures.kucoin.com')

order_id = client.create_limit_order('GMT-USDT', 'sell', '5', '1.01')
print(order_id)

Log

C:\Users\MAX\Documents>python trade.py
Traceback (most recent call last):
  File "C:\Users\MAX\Documents\trade.py", line 13, in <module>
    order_id = client.create_limit_order('GMT-USDT', 'sell', '5', '1.01')
  File "C:\Users\MAX\AppData\Local\Programs\Python\Python310\lib\site-packages\kucoin\trade\trade.py", line 99, in create_limit_order
    return self._request('POST', '/api/v1/orders', params=params)
  File "C:\Users\MAX\AppData\Local\Programs\Python\Python310\lib\site-packages\kucoin\base_request\base_request.py", line 99, in _request
    return self.check_response_data(response_data)
  File "C:\Users\MAX\AppData\Local\Programs\Python\Python310\lib\site-packages\kucoin\base_request\base_request.py", line 116, in check_response_data
    raise Exception("{}-{}".format(response_data.status_code, response_data.text))
Exception: 200-{"code":"100003","msg":"Contract parameter invalid"}

BaseMax avatar Jun 01 '22 17:06 BaseMax

This was related to the symbol name. It seems symbol names are different in FEATURES mode. I changed USDT to USDTM and the problem was fixed.

If you know why symbol names are different in the FEATURES and what mean USDTM and M please explain to me.

By the way, Thank you in advance.

BaseMax avatar Jun 02 '22 04:06 BaseMax

Hello

That is right

We have different symbol names in future and spot.

Also the base currency, USDT is converted to USDTM

Please get the full info here:

https://docs.kucoin.com/futures/#get-open-contract-list

progressivehed avatar Jun 02 '22 04:06 progressivehed

Also the base currency, USDT is converted to USDTM

Do you know what this abbreviation stands for? And what does M mean? @progressivehed

BaseMax avatar Jun 02 '22 05:06 BaseMax

It is just a naming to differentiate USDT name in spot from future

progressivehed avatar Jun 03 '22 19:06 progressivehed

It is just a naming to differentiate USDT name in spot from future

Thanks, Future charts are not available in the trading view?

BaseMax avatar Jun 03 '22 19:06 BaseMax

image

I cannot find USDTM charts in tradingview. But I see GMT-USDT (Kucoin) in tradingview. They are same or no?

BaseMax avatar Jun 03 '22 19:06 BaseMax

No actually these namings are only inside Kucoin.

You can not find them on charting websites under those names (like tradingview)

In all charting websites, they have standard names universally. For BTC it is BTC-USDT perpetual contract .

So to summarize my answrr, thiese specific namings only belongs to Kucoin

progressivehed avatar Jun 07 '22 12:06 progressivehed

No actually these namings are only inside Kucoin.

You can not find them on charting websites under those names (like tradingview)

In all charting websites, they have standard names universally. For BTC it is BTC-USDT perpetual contract .

So to summarize my answrr, thiese specific namings only belongs to Kucoin

Thank you for your answer. Does it's only related to naming or chart data is different too?

BaseMax avatar Jun 07 '22 12:06 BaseMax

It is just about naming. Chart data are usually the same ( with slight delays)

progressivehed avatar Aug 03 '22 15:08 progressivehed

Since this issue has already been addressed and there have been no updates for a long time, we will now close it. If you need any further assistance, feel free to ask!

ISAAC-XXYYZZ avatar Jul 29 '24 09:07 ISAAC-XXYYZZ