Commit ce3210b
authored
fix: preserve BNFCR in zero-balance filter and emit MiCA warning (#74)
* fix: use availableBalance for BNFCR in FutureBalance
For EU/EEA accounts under Binance MiCA Credits Trading Mode, BNFCR
walletBalance can be negative (fees and PnL are charged in BNFCR).
Binance stores the total cross-margin available balance — aggregating
all stablecoins minus used margin — in availableBalance on the BNFCR
asset entry. Using availableBalance as Amount for BNFCR ensures the
BinanceCryptoFutureMarginModel receives the correct collateral figure
and the > 0 guard passes for accounts with sufficient collateral.
* refactor: preserve BNFCR in zero-balance filter, revert availableBalance
- Add BNFCR exception to the zero-balance filter in BinanceBaseRestApiClient
so BNFCR always passes through even when walletBalance=0
- Remove manual BNFCR injection in BinanceFuturesRestApiClient (no longer needed)
- Revert FutureBalance.Amount to use walletBalance only (availableBalance causes
double-counting with Lean's own PnL/margin tracking)
* feat: emit BrokerageMessageEvent warning when BNFCR detected in account balances
* fix: update MiCA warning message to reflect all collateral assets1 parent e1d3bd9 commit ce3210b
3 files changed
Lines changed: 9 additions & 7 deletions
File tree
- QuantConnect.BinanceBrokerage
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
238 | 245 | | |
239 | 246 | | |
240 | 247 | | |
| |||
Lines changed: 1 addition & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
| 103 | + | |
109 | 104 | | |
110 | 105 | | |
111 | 106 | | |
| |||
0 commit comments