3commas-io / 3commas-official-api-docs

Official Documentation for the 3commas APIs
https://3commas.io
250 stars 87 forks source link

BUG of Binance Futures Coin market pairs #97

Closed gabriel254 closed 2 years ago

gabriel254 commented 3 years ago

I use GET /ver1/accounts/market_pairs api to get all available pairs on Binance Futures Coin market. But the returned pairs are incorrect.

from py3cw.request import Py3CW
key = xxx
secret = xxx
client = Py3CW(key=key, secret=secret)
error, pairs= client.request(entity="accounts", action="market_pairs", payload={"market_code": "binance_futures_coin"})
print(pairs)

assert "DOGE_DOGEUSD_PERP" in pairs

payload={
    "account_id": your_binance_futures_coin_account_id,
    "pair": "DOGE_DOGEUSD_PERP",
    "instant": True,
    "position": {
        "type": "buy",
        "units": {
            "value": 10
        },
        "price": {
            "value": 0.15
        },
        "order_type": "limit"
    },
    "leverage": {
        "enabled": True,
        "type": "isolated",
        "value": 2
    }
}
error, data = client.request(entity="smart_trades_v2", action="new", payload=payload)

print(error)

The output is

['BTC_BTCUSD_PERP', 'USD_BTCUSD_PERP', 'USD_BTC', 'ETH_ETHUSD_PERP', 'USD_ETHUSD_PERP', 'USD_ETH', 'LINK_LINKUSD_PERP', 'USD_LINKUSD_PERP', 'USD_LINK', 'BNB_BNBUSD_PERP', 'USD_BNBUSD_PERP', 'USD_BNB', 'TRX_TRXUSD_PERP', 'USD_TRXUSD_PERP', 'USD_TRX', 'DOT_DOTUSD_PERP', 'USD_DOTUSD_PERP', 'USD_DOT', 'ADA_ADAUSD_PERP', 'USD_ADAUSD_PERP', 'USD_ADA', 'EOS_EOSUSD_PERP', 'USD_EOSUSD_PERP', 'USD_EOS', 'LTC_LTCUSD_PERP', 'USD_LTCUSD_PERP', 'USD_LTC', 'BCH_BCHUSD_PERP', 'USD_BCHUSD_PERP', 'USD_BCH', 'XRP_XRPUSD_PERP', 'USD_XRPUSD_PERP', 'USD_XRP', 'ETC_ETCUSD_PERP', 'USD_ETCUSD_PERP', 'USD_ETC', 'FIL_FILUSD_PERP', 'USD_FILUSD_PERP', 'USD_FIL', 'EGLD_EGLDUSD_PERP', 'USD_EGLDUSD_PERP', 'USD_EGLD', 'DOGE_DOGEUSD_PERP', 'USD_DOGEUSD_PERP', 'USD_DOGE', 'UNI_UNIUSD_PERP', 'USD_UNIUSD_PERP', 'USD_UNI', 'THETA_THETAUSD_PERP', 'USD_THETAUSD_PERP', 'USD_THETA', 'XLM_XLMUSD_PERP', 'USD_XLMUSD_PERP', 'USD_XLM', 'BTC_BTCUSD_211231', 'USD_BTCUSD_211231', 'ETH_ETHUSD_211231', 'USD_ETHUSD_211231', 'ADA_ADAUSD_211231', 'USD_ADAUSD_211231', 'LINK_LINKUSD_211231', 'USD_LINKUSD_211231', 'BCH_BCHUSD_211231', 'USD_BCHUSD_211231', 'DOT_DOTUSD_211231', 'USD_DOTUSD_211231', 'XRP_XRPUSD_211231', 'USD_XRPUSD_211231', 'LTC_LTCUSD_211231', 'USD_LTCUSD_211231', 'BNB_BNBUSD_211231', 'USD_BNBUSD_211231', 'SOL_SOLUSD_PERP', 'USD_SOLUSD_PERP', 'USD_SOL', 'LUNA_LUNAUSD_PERP', 'USD_LUNAUSD_PERP', 'USD_LUNA', 'BTC_BTCUSD_220325', 'USD_BTCUSD_220325', 'ETH_ETHUSD_220325', 'USD_ETHUSD_220325', 'ADA_ADAUSD_220325', 'USD_ADAUSD_220325', 'LINK_LINKUSD_220325', 'USD_LINKUSD_220325', 'BCH_BCHUSD_220325', 'USD_BCHUSD_220325', 'DOT_DOTUSD_220325', 'USD_DOTUSD_220325', 'XRP_XRPUSD_220325', 'USD_XRPUSD_220325', 'LTC_LTCUSD_220325', 'USD_LTCUSD_220325', 'BNB_BNBUSD_220325', 'USD_BNBUSD_220325']

{'error': True, 'msg': 'Other error occurred: Unknown pair Pair not found None.'}

It seems that the pair DOGE_DOGEUSD_PERP is a valid pair from the GET /ver1/accounts/market_pairs. But I can't use DOGE_DOGEUSD_PERP to create smart trade. As in #96 , DOGE_DOGEUSD_PERP can not be used in grid bot neither.

McNultyyy commented 2 years ago

Is there any update on this? I have been having this same issue with COIN-M futures for a while now. The devs in the API telegram channel also seem to be ignoring this

EfremovEvgeniy commented 2 years ago

HI, we checked it and created smart trade with this pair.