Commissions in Income and userTrades are different [BUG] [URGENT]

Hello. Please take a look at result of 2 api requests:

https://fapi.binance.com/fapi/v1/userTrades?symbol=ETHUSDT&limit=1000&startTime=1606723511000&timestamp=1606729790117&signature=

Result:

> array:3 [
  0 => array:15 [
    "symbol" => "ETHUSDT"
    "id" => 166890649
    "orderId" => 4554858025
    "side" => "BUY"
    "price" => "580.19"
    "qty" => "1.315"
    "realizedPnl" => "0"
    "marginAsset" => null
    "quoteQty" => "762.94985"
    "commission" => "0.30517994" <<<<<<<<<<<<<<<<<<<  **last digit 4**
    "commissionAsset" => "USDT"
    "time" => 1606723511391
    "positionSide" => "BOTH"
    "maker" => false
    "buyer" => true
  ]
  1 => array:15 [
    "symbol" => "ETHUSDT"
    "id" => 166902646
    "orderId" => 4555028323
    "side" => "BUY"
    "price" => "573.94"
    "qty" => "1.326"
    "realizedPnl" => "0"
    "marginAsset" => null
    "quoteQty" => "761.04444"
    "commission" => "0.30441777" <<<<<<<<<<<<<<<<<<<<< **last digit 7**
    "commissionAsset" => "USDT"
    "time" => 1606723766639
    "positionSide" => "BOTH"
    "maker" => false
    "buyer" => true
  ]
  2 => array:15 [
    "symbol" => "ETHUSDT"
    "id" => 166954406
    "orderId" => 4556230749
    "side" => "SELL"
    "price" => "574.60"
    "qty" => "2.641"
    "realizedPnl" => "-6.47568999"
    "marginAsset" => null
    "quoteQty" => "1517.51860"
    "commission" => "0.60700743"
    "commissionAsset" => "USDT"
    "time" => 1606727346019
    "positionSide" => "BOTH"
    "maker" => false
    "buyer" => false
  ]
]

Now lets have a look to “income” endpoint:
https://fapi.binance.com/fapi/v1/income?limit=1000&startTime=1606694400000&timestamp=1606729983093&signature=

Result:

  >  array:4 [
      0 => array:8 [
        "symbol" => "ETHUSDT"
        "incomeType" => "COMMISSION"
        "income" => "-0.30517993" <<<<<<<<<<< **LAST DIGIT 3**
        "asset" => "USDT"
        "time" => 1606723511000
        "info" => "166890649"
        "tranId" => 90061166890649
        "tradeId" => "166890649" <<<<<<<<<<< **SAME TRADE ID**
      ]
      1 => array:8 [
        "symbol" => "ETHUSDT"
        "incomeType" => "COMMISSION"
        "income" => "-0.30441776" <<<<<<<<<<<<<<< **LAST DIGIT 6**
        "asset" => "USDT"
        "time" => 1606723766000
        "info" => "166902646"
        "tranId" => 90061166902646
        "tradeId" => "166902646"
      ]
      2 => array:8 [
        "symbol" => "ETHUSDT"
        "incomeType" => "REALIZED_PNL"
        "income" => "-6.47568999"  <<<<<<<<<<<<< NO PROBLEMS HERE
        "asset" => "USDT"
        "time" => 1606727346000
        "info" => "166954406"
        "tranId" => 90060166954406
        "tradeId" => "166954406"
      ]
      3 => array:8 [
        "symbol" => "ETHUSDT"
        "incomeType" => "COMMISSION"
        "income" => "-0.60700743" <<<<<<<<<< NO PROBLEMS HERE
        "asset" => "USDT"
        "time" => 1606727346000
        "info" => "166954406"
        "tranId" => 90060166954406
        "tradeId" => "166954406"
      ]
    ]

You may think its not a big deal, but after 40.000 orders balance difference is huge!
What to do? I already downloaded all orders from userTrades endpoint and dont want to download for every customer 40000 rows again.

Will forward this to the related team

1 Like

Please use the data from userTrades; The data from income needs some fixing

I’m using it but cant make balance match binance balance.

What I’m doing right now.
Downloading all funding and transactions from “income” except “commissions” and “realizedPnl”.

After I downloading all user trades from all tickers and get SUM of all realizedPnl minus sum of all commissions and at the end I got 10 usd difference on balance of 200 usd future account. 5% is huge difference.

I need to calculate leverage for every trade at the moment. So I need full balance history.

If you want to reconcile your balance, suggest you use income;
And the income endpoint has been fixed, please try out; If you still have question after the fix, you need to contact CS to clarify the numbers

Future income history sum incorect Apparently still have some issues with this endpoint