Hi all, I hope this is the correct place to post this. If not, please direct me to the right place.
I have a question regarding getting an accourate BNFCR balance on futures, via the private stream. I cannot find out how to do this properly. Also it seems that the issue below happens only on subaccount. On the main account I have never encountered this issue:
This is something I tested a few minutes ago:
Initially my BNFCR balance is 46.35
I execute an order SHORT, of 35 at this price: 2.4364
The private socket send me the following:
AccountUpdateEvent { event_type: “ACCOUNT_UPDATE”, event_time: 1724323654589, data: AccountUpdateDataEvent { reason: “ORDER”, balances: [EventBa
lance { asset: “BNFCR”, wallet_balance: “-45.36064455”, cross_wallet_balance: “-45.36064455”, balance_change: “0” }], positions: [EventPosition { symbol: “JTOUSDT”, posi
tion_amount: “-35”, entry_price: “2.4364”, accumulated_realized: “-7.47839988”, unrealized_pnl: “0.00700000”, margin_type: “cross”, isolated_wallet: “0”, position_side:
“BOTH” }] } }
Note the negative BNFCR amounts.
I then close this position and get the following balance update:
AccountUpdateEvent { event_type: “ACCOUNT_UPDATE”, event_time: 1724323687931, data: AccountUpdateDataEvent { reason: “ORDER”, balances: [EventBalance { asset: “BNFCR”, wallet_balance: “-45.44050014”, cross_wallet_balance: “-45.44050014”, balance_change: “0” }], positions: [EventPosition { symbol: “JTOUSDT”, position_amount: “0”, entry_price: “0”, accumulated_realized: “-7.51559987”, unrealized_pnl: “0”, margin_type: “cross”, isolated_wallet: “0”, position_side: “BOTH” }] } }
Note that the BNFCR balance is still negative, even after the position is fully closed.
However when I inquire via API to see what my BNFCR balance is, I get the correct value which is now: 46.22 BNFCR and not what the last balance update event reported which was -45.44050014 BNFCR
This is an issue. It is either a bug, or there’s something fundamental I do nto understand here.
Please note also again, that I have not experienced this behaviour with an API key that connects to my main account. This seems to happen only on subaccounts, hence my suspicion that this is a bug and not a feature.
Any help would be appreciated.