The Gas Problem
On BNB Smart Chain, every transaction requires BNB to pay the network fee — even if you're only transferring USDT. This creates a chicken-and-egg problem: your deposit addresses hold USDT but need BNB to move it.
Paychainly solves this with two automated systems: per-sweep BNB top-ups and an auto-refill mechanism for the gas wallet itself.
Per-Sweep BNB Top-Up
Before every sweep, the sweep processor sends a small amount of BNB from the gas wallet to the deposit address:
GAS_TOP_UP_BNB=0.002 # default, configurableThis is enough to cover the USDT transfer gas cost. After the sweep, any leftover BNB is returned to the gas wallet automatically.
Gas Wallet Auto-Refill
The gas wallet needs to stay funded. Paychainly monitors its BNB balance and triggers an automatic refill when it drops below the threshold:
GAS_WALLET_MIN_BNB=0.05 # alert + refill trigger
GAS_REFILL_USDT_AMOUNT=10 # USDT to swap per refillThe refill swaps USDT → BNB via PancakeSwap V2. The swap route is USDT → WBNB via the standard V2 router.
Monitoring Gas Health
The /health endpoint reports the gas wallet BNB balance. In the admin panel, the Gas Wallet page shows the current balance, recent top-up history, and refill transactions.
If the gas wallet balance drops below GAS_WALLET_MIN_BNB, a Telegram alert fires immediately.
Best Practices
- Keep 0.5–1 BNB in the gas wallet as a safety buffer
- Set
GAS_REFILL_USDT_AMOUNThigh enough that refills happen infrequently (avoid swap slippage on tiny amounts) - Monitor the gas wallet page daily until you've established a stable refill rhythm