bogdanteodoru/py3cw

Can't create grid bot on Binance Futures Coin account

gabriel254 opened this issue · 1 comments

Hi, I can't create grid bot on Binance Futures Coin account.
To reproduce the problem:

from py3cw.request import Py3CW
key = xxxx
secret = xxxx
client = Py3CW(key=key, secret=secret)

## Test binance spot bot (works fine)
spot_payload={
    "account_id": your_binance_spot_account_id,
    "pair": "USDT_DOGE",
    "upper_price": 0.25,
    "lower_price": 0.15,
    "quantity_per_grid": 100,
    "grids_quantity": 10,
    "is_enabled": False,
}
spot_error, data = client.request(entity="grid_bots", action="manual", payload=spot_payload, additional_headers={'Forced-Mode': "real"})

if spot_error:
    print(spot_error)
else:
    print("Spot success!")


## Test binance futures bot (works fine)
futures_payload={
    "account_id": your_binance_futures_account_id,
    "pair": "USDT_DOGEUSDT",
    "upper_price": 0.25,
    "lower_price": 0.15,
    "quantity_per_grid": 100,
    "grids_quantity": 10,
    "is_enabled": False,
    "leverage_type": "cross",
    "leverage_custom_value": "2"
}
futures_error, data = client.request(entity="grid_bots", action="manual", payload=futures_payload, additional_headers={'Forced-Mode': "real"})
if futures_error:
    print(futures_error)
else:
    print("Futures success!")

## Test binance futures_coin bot (doesn't work!)
futures_coin_payload={
    "account_id": your_binance_futures_coin_account_id,
    "pair": "DOGE_DOGEUSD_PERP",
    "upper_price": 0.25,
    "lower_price": 0.15,
    "quantity_per_grid": 5,
    "grids_quantity": 10,
    "is_enabled": False,
    "leverage_type": "cross",
    "leverage_custom_value": "2"
}
futures_coin_error, data = client.request(entity="grid_bots", action="manual", payload=futures_coin_payload, additional_headers={'Forced-Mode': "real"})
if futures_coin_error:
    print(futures_coin_error)
else:
    print("Futures-coin success!")


## Test binance futures_coin bot without leverage (doesn't work!)
futures_coin_payload={
    "account_id": your_binance_futures_coin_account_id,
    "pair": "DOGE_DOGEUSD_PERP",
    "upper_price": 0.25,
    "lower_price": 0.15,
    "quantity_per_grid": 5,
    "grids_quantity": 10,
    "is_enabled": False
}
futures_coin_error, data = client.request(entity="grid_bots", action="manual", payload=futures_coin_payload, additional_headers={'Forced-Mode': "real"})
if futures_coin_error:
    print(futures_coin_error)
else:
    print("Futures-coin success!")

The output is:

Spot success!

Futures success!

{'error': True, 'msg': 'Other error occurred: unknown_error Unknown error occurred#Exceptions::DealSilentException None.'}

{'error': True, 'msg': 'Other error occurred: unknown_error Unknown error occurred#Exceptions::DealSilentException None.'}

BTW, I have sufficient DOGE funds on my futures coin account and I don't have any DOGE positions at the moment. And I can create the binance futures coin grid bot with the same parameters on the WebUI.

Is this a bug of the py3cw or did I write the wrong code? Thanks for helping!

Hi @gabriel254. I don't think this is a wrapper error but rather a 3commas endpoint error. Please open a bug on their end.