← All Posts
How It Works

Understanding the Sweep Mechanism: How Your Funds Move from Deposit Address to Master Wallet

May 8, 2026· 2 min read
Understanding the Sweep Mechanism: How Your Funds Move from Deposit Address to Master Wallet

What Is a Sweep?

Each customer gets a unique deposit address derived from your HD wallet seed. When USDT arrives at that address, Paychainly automatically transfers the funds to your configured master wallet — this is called a "sweep".

The sweep is fully automated. You never touch the deposit address private keys directly.

Step 1: BNB Top-Up

BNB Smart Chain requires BNB for gas. Since deposit addresses hold only USDT, Paychainly first sends a small amount of BNB from the gas wallet to the deposit address to cover the transfer fee.

Default: 0.002 BNB per top-up (configurable via GAS_TOP_UP_BNB)

Step 2: USDT Transfer

With gas funded, Paychainly calls the USDT transfer() function from the deposit address, sending the full balance to your master wallet.

Step 3: Fee Deduction

Before sweeping, two deductions are made:

  • Platform fee: default 0.5 USDT (configurable via SYSTEM_FEE_USDT)
  • Gas reimbursement: default 0.2 USDT (configurable via GAS_FEE_USDT)

These are sent to the fee wallet (GAS_FEE_WALLET_ADDRESS). Your master wallet receives the remainder.

Step 4: Leftover BNB Return

Any remaining BNB in the deposit address (after the transfer) is returned to the gas wallet to keep it topped up.

Concurrency Safety

The sweep queue runs at concurrency 1. This prevents nonce collisions that would cause transactions to fail. Each sweep job is retried up to SWEEP_MAX_RETRIES times (default 5) with exponential backoff.

Monitoring Sweeps

All sweep activity is visible in the admin panel under Sweep Monitor. Failed sweeps are visible in the Bull Board queue UI at /admin/queues.

← Back to Blog
sweepfundsbnbusdtfees