Skip to content

Binance watchOrders still miss order updates #27412

@wanga10000

Description

@wanga10000

Operating System

Windows

Programming Language

Python

CCXT Version

4.5.22

Description

Hi,
I'm testing Binance watchOrders, but there's still missing updates when the order was splited into several trades by Binance.
I'm trading future PAXGUSDT, which is a relatively low liquidity symbol.
Some issues also mentioned about this bug, but there's no feasible solution in them.

Here is the main part of code to help reproducing the error:

async def watch_orders_loop(exchange):
    while True:
        try:
            orders = await exchange.watchOrders()
            print('=========================================================')
            for order in orders:
                print(f"{order["info"]}")
                print('---------------------------------------------------------------')
        except Exception as e:
            # break
            print(e)

To reproduce, please open up this function and open "2" PAXG position in Binance future using just market order.

The order updates I got:

=========================================================
{'s': 'PAXGUSDT', 'c': 'web_coin_rr6vm56nkf292kldno0zxz6', 'S': 'SELL', 'o': 'MARKET', 'f': 'GTC', 'q': '2', 'p': '0', 'ap': '0', 'sp': '0', 'x': 'NEW', 'X': 'NEW', 'i': 1590776196, 'l': '0', 'z': '0', 'L': '0', 'n': '0', 'N': 'USDT', 'T': 1764408142510, 't': 0, 'b': '0', 'a': '0', 'm': False, 'R': False, 'wt': 'CONTRACT_PRICE', 'ot': 'MARKET', 'ps': 'SHORT', 'cp': False, 'rp': '0', 'pP': False, 'si': 0, 'ss': 0, 'V': 'EXPIRE_MAKER', 'pm': 'NONE', 'gtd': 0, 'er': '0'}
---------------------------------------------------------------
=========================================================
{'s': 'PAXGUSDT', 'c': 'web_coin_rr6vm56nkf292kldno0zxz6', 'S': 'SELL', 'o': 'MARKET', 'f': 'GTC', 'q': '2', 'p': '0', 'ap': '4235.15', 'sp': '0', 'x': 'TRADE', 'X': 'PARTIALLY_FILLED', 'i': 1590776196, 'l': '0.484', 'z': '0.815', 'L': '4235.15', 'n': '1.0249063', 'N': 'USDT', 'T': 1764408142510, 't': 45986502, 'b': '0', 'a': '0', 'm': False, 'R': False, 'wt': 'CONTRACT_PRICE', 'ot': 'MARKET', 'ps': 'SHORT', 'cp': False, 'rp': '0', 'pP': False, 'si': 0, 'ss': 0, 'V': 'EXPIRE_MAKER', 'pm': 'NONE', 'gtd': 0, 'er': '0'}
---------------------------------------------------------------
=========================================================
{'s': 'PAXGUSDT', 'c': 'web_coin_rr6vm56nkf292kldno0zxz6', 'S': 'SELL', 'o': 'MARKET', 'f': 'GTC', 'q': '2', 'p': '0', 'ap': '4235.15', 'sp': '0', 'x': 'TRADE', 'X': 'PARTIALLY_FILLED', 'i': 1590776196, 'l': '0.015', 'z': '0.83', 'L': '4235.15', 'n': '0.03176362', 'N': 'USDT', 'T': 1764408142510, 't': 45986503, 'b': '0', 'a': '0', 'm': False, 'R': False, 'wt': 'CONTRACT_PRICE', 'ot': 'MARKET', 'ps': 'SHORT', 'cp': False, 'rp': '0', 'pP': False, 'si': 0, 'ss': 0, 'V': 'EXPIRE_MAKER', 'pm': 'NONE', 'gtd': 0, 'er': '0'}
---------------------------------------------------------------
=========================================================
{'s': 'PAXGUSDT', 'c': 'web_coin_rr6vm56nkf292kldno0zxz6', 'S': 'SELL', 'o': 'MARKET', 'f': 'GTC', 'q': '2', 'p': '0', 'ap': '4235.112389', 'sp': '0', 'x': 'TRADE', 'X': 'PARTIALLY_FILLED', 'i': 1590776196, 'l': '0.002', 'z': '1.959', 'L': '4235.03', 'n': '0.00423503', 'N': 'USDT', 'T': 1764408142510, 't': 45986514, 'b': '0', 'a': '0', 'm': False, 'R': False, 'wt': 'CONTRACT_PRICE', 'ot': 'MARKET', 'ps': 'SHORT', 'cp': False, 'rp': '0', 'pP': False, 'si': 0, 'ss': 0, 'V': 'EXPIRE_MAKER', 'pm': 'NONE', 'gtd': 0, 'er': '0'}
---------------------------------------------------------------
=========================================================
{'s': 'PAXGUSDT', 'c': 'web_coin_rr6vm56nkf292kldno0zxz6', 'S': 'SELL', 'o': 'MARKET', 'f': 'GTC', 'q': '2', 'p': '0', 'ap': '4235.1107', 'sp': '0', 'x': 'TRADE', 'X': 'FILLED', 'i': 1590776196, 'l': '0.041', 'z': '2', 'L': '4235.03', 'n': '0.08681811', 'N': 'USDT', 'T': 1764408142510, 't': 45986515, 'b': '0', 'a': '0', 'm': False, 'R': False, 'wt': 'CONTRACT_PRICE', 'ot': 'MARKET', 'ps': 'SHORT', 'cp': False, 'rp': '0', 'pP': False, 'si': 0, 'ss': 0, 'V': 'EXPIRE_MAKER', 'pm': 'NONE', 'gtd': 0, 'er': '0'}
---------------------------------------------------------------

There's only 4 trades in these message.

Here is the actual trades in Binance web:
Image
Image

About 17 trades, so ccxt miss 13 trades.

Talking about the current solutions I asked for AI, it told me to

  1. Use watchMytrades. But if watchOrders would miss, in my little dump brain, I think there's no reason to use watchTrades which may also miss trades.
  2. Query the trade info after the order has been done. However, it costs weight limit. Also I still need websocket running for the detection of LIMIT/STOP order triggered. But I don't want them to have the risk of missing.

So is that a bug? If so, is it going to be taken care soon or it might take some time to deal with?
What would be the alternative solution for this issue if I need real-time updating order status?

Thanks in advance.

2025/11/30 Updated
Found out that using watchMyTrades is a key to go. It doesn't miss trades based on my test.
Now you need watchOrders for order updating and watchMyTrades for trade filled info.
However, based on the Binance API document they should watch the same source, but watchOrders would miss is kind of dump.
Hopefully this issue can be fixed in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions