gateio / gateapi-python

263 stars 98 forks source link

CCXT calls return BadRequest when setting Risk Limit and Leverage on swap contracts #126

Closed lemozade closed 1 year ago

lemozade commented 2 years ago

I am trying to set the Risk Limit and Leverage for swap contracts. Both API calls return BadRequest. I am following the v4 API document, and the required parameters look to be correct. Can someone please help?

Initialise Gate.io on CCXT: self.exchange = ccxt.gateio({'apiKey': settings.gate_key, 'secret': settings.gate_secret, 'enableRateLimit': False})

Method for setting Risk Limit: self.exchange.private_futures_post_settle_positions_contract_risk_limit( params={'settle': 'usdt', 'contract': 'BTC_USDT', 'risk_limit': '10'})

Returns: BadRequest: gateio {"label":"INVALID_PROTOCOL","detail":"invalid argument: #3"}

Method for setting Leverage: self.exchange.private_futures_post_settle_positions_contract_leverage(params={'settle': 'usdt', 'contract': 'BTC_USDT', 'leverage': '0', 'cross_leverage_limit': '10'})

Returns: BadRequest: gateio {"label":"INVALID_PROTOCOL","detail":"invalid argument: #3"}

revilwang commented 2 years ago

Is there any debugging log which can show the raw HTTP request sent to the server?

lemozade commented 2 years ago

Hello. I commented on CCXT GitHub, and it has been fixed: https://github.com/ccxt/ccxt/issues/14440