Confusion on balance

Hello,
Im using binance api to place a buy or sell order, but I’m observing that the initial capital (FDUSD), which is 10.000, given by binance test net, its confusing me when I place a buy or sell order, let me explain.
Im placing a buy order with quoteOrderQty=20 (20$) and a custom client id (assume 'abc_20)
The response of the buy order shows me:

The cummulativeQuoteQty is sliglty low from my 20$ investment, I think thats because of market fluctuation, right? But the problem comes after checking again the balance, using:
self.client.get_asset_balance(asset=‘FDUSD’)
The result is: 9980.228
Its confusing me because I though that the balance will be:
10000 - 20 - 0.228 = 9979.772 (0.228 is what the cummulativeQuoteQty suggests). Nut its 9980.228 from the API
Why its added back to the balance (capital) of FDUSD?
Thank you

Hi!
“cumulativeQuoteQty” is defined on this page as the accumulation of the price multiplied by the quantity for each execution of an order. Looking in the “fills” item and doing price*qty gives approximately the same value: 494.3 * 0.04 = 19.772. I suppose it could depend on this.

That’s because of the current price and lot sizes.

See https://testnet.binance.vision/api/v3/exchangeInfo?symbol=BNBFDUSD:

        {
          "filterType": "LOT_SIZE",
          "minQty": "0.00100000",
          "maxQty": "900000.00000000",
          "stepSize": "0.00100000"
        },

You’ve bought 0.04 BNB at 494.30 FDUSD, paying 494.30 × 0.04 = 19.772 FDUSD for it. That is indeed your cummulativeQuoteQty.

Due to the stepSize, the next allowed quantity is 0.041 BNB which would require 20.2663 FDUSD at the current best price. That is more than requested quoteOrderQty so the executed quantity is adjusted.

This value is correct and expected.

You had 10000 FDUSD before, then paid 19.7720 FDUSD for the order, and now the balance is 10000 – 19.772 = 9980.228.