Kucoin / kucoin-python-sdk

MIT License
46 stars 16 forks source link

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

Closed BaseMax closed 2 months ago

BaseMax commented 2 years ago

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 commented 2 years ago

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.

progressivehed commented 2 years ago

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

BaseMax commented 2 years ago

Also the base currency, USDT is converted to USDTM

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

progressivehed commented 2 years ago

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

BaseMax commented 2 years ago

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

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

BaseMax commented 2 years ago

image

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

progressivehed commented 2 years ago

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

BaseMax commented 2 years ago

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?

progressivehed commented 2 years ago

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

ISAAC-XXYYZZ commented 2 months ago

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!