Kucoin / kucoin-python-sdk

MIT License
47 stars 17 forks source link

Get Order Details doesn't provide price value (price comes back equal to 0) #19

Closed knoghax closed 3 months ago

knoghax commented 3 years ago

When I try to get the order details after purchasing the price that shows there is 0. I'm wondering if this could be an API issue.

The code I used is:

from kucoin.client import Market
import keysKucoin
from kucoin.client import Trade
import json

client = Market(url='https://api.kucoin.com')

api_key = keysKucoin.APIkey
api_secret = keysKucoin.Secretkey
api_passphrase = keysKucoin.Passphrase

client = Trade(key=api_key, secret=api_secret, passphrase=api_passphrase, is_sandbox=False, url='')

order_id = client.create_market_order('NEO-USDT', 'buy', size='0.01')

order = client.get_order_details(order_id["orderId"])
print(json.dumps(order, indent=4, sort_keys=True))

and the print I get is

{
    "cancelAfter": 0,
    "cancelExist": false,
    "channel": "API",
    "clientOid": clientOid,
    "createdAt": 1619955054000,
    "dealFunds": "1.047733",
    "dealSize": "0.01",
    "fee": "0.001047733",
    "feeCurrency": "USDT",
    "funds": "0",
    "hidden": false,
    "iceberg": false,
    "id": id,
    "isActive": false,
    "opType": "DEAL",
    "postOnly": false,
    "price": "0",
    "remark": null,
    "side": "buy",
    "size": "0.01",
    "stop": "",
    "stopPrice": "0",
    "stopTriggered": false,
    "stp": "",
    "symbol": "NEO-USDT",
    "tags": null,
    "timeInForce": "GTC",
    "tradeType": "TRADE",
    "type": "market",
    "visibleSize": "0"
}

(The id and ClientOid fields are changed, I don't know if this information is dangerous to have public)

As you can see, the price in the response is 0, when it should be 104.7733

ISAAC-XXYYZZ commented 3 months ago

Due to many changes in the SDK, please refer to our latest documentation: https://www.kucoin.com/docs/beginners/introduction Please try updating to the latest version of the SDK and modify your code to try again. If you encounter any issues, feel free to provide feedback.