Skip to content

Fixes Binance withdrawals failing due to additive fee - #1137

Open
Jackb-03 wants to merge 2 commits into
GENERALBYTESCOM:masterfrom
Jackb-03:binancefixUSDTasFiat
Open

Fixes Binance withdrawals failing due to additive fee#1137
Jackb-03 wants to merge 2 commits into
GENERALBYTESCOM:masterfrom
Jackb-03:binancefixUSDTasFiat

Conversation

@Jackb-03

@Jackb-03 Jackb-03 commented Feb 9, 2026

Copy link
Copy Markdown

Fixes Binance withdrawals failing with "User has insufficient balance" when using USDT as the preferred fiat currency.

The previous implementation unconditionally added the Binance withdrawal fee on top of the withdrawal amount in sendCoins(). After purchasing crypto with USDT, Binance's trading fee reduces the actual balance received below the ordered amount. This meant the code was attempting to withdraw more than the available balance every time.

The fix replaces the unconditional fee addition with a balance-aware approach:

When balance >= amount + fee, the fee is added to the withdrawal so the customer receives the full requested amount.

When balance >= amount but less than amount + fee, the amount is sent as-is and the customer receives the amount minus the fee that Binance deducts automatically.

When balance < amount (common after trading fees reduce the purchased amount), the entire available balance is sent instead of failing.

This preserves the original intent of covering the withdrawal fee when possible while preventing the withdrawal from failing when the balance is tight. Tested with real Binance transactions confirming both the fee-inclusive and fee-exclusive withdrawal paths succeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant