Fees are presents in many API model like Trades, Withdraws, Fiat Payments and so on.
I would like to understand how fees works on Binance API to understand how to parse that data.
As far as I understand, there could be three different cases
Assume we have two different trades, one for ETHEUR
and one for BNBEUR
Also assume my current balance is like this
- ETH Balance: 1 ETH
- BNB Balance: 1 BNB
- EUR Balance: 1000 EUR
Scenario 1) Buy ETH
by selling EUR
with commissionAsset
equal to ETH
I purchase some ETH
by selling EUR
. Here’s a real API result example
{
"symbol": "ETHEUR",
"id": <TRADE_ID>,
"orderId": <ORDER_ID>,
"orderListId": -1,
"price": "1258.07000000",
"qty": "0.15885000",
"quoteQty": "199.84441950",
"commission": "0.00015885",
"commissionAsset": "ETH",
"time": <TRADE_TIMESTAMP>,
"isBuyer": true,
"isMaker": false,
"isBestMatch": true
},
Could you explain how the commission is applied here? After executing the trade, my final ETH balance would be increased by qty - commission
?
Scenario 2) Buy ETH
by selling EUR
with commissionAsset
equal to BNB
In this scenario, I have enabled Binance to use my BNB
balance to receive a discount on the commission
{
"symbol": "ETHEUR",
"id": <TRADE_ID>,
"orderId": <ORDER_ID>,
"orderListId": -1,
"price": "1800.00000000",
"qty": "0.27799000",
"quoteQty": "500.38200000",
"commission": "0.00095876",
"commissionAsset": "BNB",
"time": <TRADE_TIMESTAMP>,
"isBuyer": true,
"isMaker": true,
"isBestMatch": true
},
Could you explain how the commission is applied here? After executing the trade, my final ETH balance would be increased by qty
but my BNB
balance would be reduced by 0.00095876 BNB
because of the commission
?
Scenario 3) Buy BNB
by selling EUR
with commissionAsset
equal to BNB
How does it work in both cases if I have enabled or disabled to use BNB
as the commissionAsset
?
{
"symbol": "BNBEUR",
"id": <TRADE_ID>,
"orderId": <ORDER_ID>,
"orderListId": -1,
"price": "479.00000000",
"qty": "0.20870000",
"quoteQty": "99.96730000",
"commission": "0.00015652",
"commissionAsset": "BNB",
"time": <TRADE_TIMESTAMP>,
"isBuyer": true,
"isMaker": true,
"isBestMatch": true
},
Could you explain how the commission is applied here in both cases (enabled/disabled BNB as commissionAsset
)?
- If I have “enabled” the
BNB
option ascommissionAsset
will I receive the fullqty
but myBNB
balance is reduced bycommission
? - If I have disabled the
BNB
option ascommissionAsset
will I receiveqty - commission
?