ccxt / ccxt

A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges
https://docs.ccxt.com
MIT License
32.42k stars 7.45k forks source link

Fees not returned or red from Binance API #17793

Open JayceeB1 opened 1 year ago

JayceeB1 commented 1 year ago

Operating System

Windows 11

Programming Languages

python

CCXT Version

3.0.90

Description

Fees are not returned from Binance API in the order, was working correctly in early versions... but i don't know witch one :')

Happens both buying and selling

'fees': [{'currency': None, 'cost': None, 'rate': None}]

Thanks

Code

market_order = binance.create_order(
                    symbol,
                    type='market',
                    side='sell',
                    amount=position
                )
{
    "info": {
        "symbol": "BTCBUSD",
        "orderId": "_(editedforpivacy)_",
        "orderListId": "-1",
        "clientOrderId": "(editedforpivacy)",
        "price": "0.00000000",
        "origQty": "0.00273000",
        "executedQty": "0.00273000",
        "cummulativeQuoteQty": "79.73966910",
        "status": "FILLED",
        "timeInForce": "GTC",
        "type": "MARKET",
        "side": "BUY",
        "stopPrice": "0.00000000",
        "icebergQty": "0.00000000",
        "time": "1683203423434",
        "updateTime": "1683203423434",
        "isWorking": True,
        "workingTime": "1683203423434",
        "origQuoteOrderQty": "0.00000000",
        "selfTradePreventionMode": "NONE",
    },
    "id": "(editedforpivacy)",
    "clientOrderId": "(editedforpivacy)",
    "timestamp": 1683203423434,
    "datetime": "2023-05-04T12:30:23.434Z",
    "lastTradeTimestamp": None,
    "symbol": "BTC/BUSD",
    "type": "market",
    "timeInForce": "GTC",
    "postOnly": False,
    "reduceOnly": None,
    "side": "buy",
    "price": 29208.67,
    "triggerPrice": None,
    "amount": 0.00273,
    "cost": 79.7396691,
    "average": 29208.67,
    "filled": 0.00273,
    "remaining": 0.0,
    "status": "closed",
    "fee": {"currency": None, "cost": None, "rate": None},
    "trades": [],
    "fees": [{"currency": None, "cost": None, "rate": None}],
    "stopPrice": None,
}
frosty00 commented 1 year ago

@JayceeB1 I think it only works for limit orders that get filled immediately

JayceeB1 commented 1 year ago

@frosty00 I'm almost sure I had them a few days ago, maybe a Binance API problem?

holinkasa commented 5 months ago

Operating System

Windows 11

Programming Languages

python

CCXT Version

3.0.90

Description

Fees are not returned from Binance API in the order, was working correctly in early versions... but i don't know witch one :')

Happens both buying and selling

'fees': [{'currency': None, 'cost': None, 'rate': None}]

Thanks

Code

market_order = binance.create_order( symbol, type='market', side='sell', amount=position )   

{'info': {'symbol': 'BTCBUSD', 'orderId': '(editedforpivacy)', 'orderListId': '-1', 'clientOrderId': '(editedforpivacy)', 'price': '0.00000000', 'origQty': '0.00273000', 'executedQty': '0.00273000', 'cummulativeQuoteQty': '79.73966910', 'status': 'FILLED', 'timeInForce': 'GTC', 'type': 'MARKET', 'side': 'BUY', 'stopPrice': '0.00000000', 'icebergQty': '0.00000000', 'time': '1683203423434', 'updateTime': '1683203423434', 'isWorking': True, 'workingTime': '1683203423434', 'origQuoteOrderQty': '0.00000000', 'selfTradePreventionMode': 'NONE'}, 'id': '(editedforpivacy)', 'clientOrderId': '(editedforpivacy)', 'timestamp': 1683203423434, 'datetime': '2023-05-04T12:30:23.434Z', 'lastTradeTimestamp': None, 'symbol': 'BTC/BUSD', 'type': 'market', 'timeInForce': 'GTC', 'postOnly': False, 'reduceOnly': None, 'side': 'buy', 'price': 29208.67, 'triggerPrice': None, 'amount': 0.00273, 'cost': 79.7396691, 'average': 29208.67, 'filled': 0.00273, 'remaining': 0.0, 'status': 'closed', 'fee': {'currency': None, 'cost': None, 'rate': None}, 'trades': [], 'fees': [{'currency': None, 'cost': None, 'rate': None}], 'stopPrice': None}

can confirm i dont also see the fees, but in older version i could see them, but i dont remember too in wich version lol

holinkasa commented 5 months ago

if someone can point it out since i need the damn fees, since my bot dca alot ill need to update my tp based on accumulated fees