Skip to content

Request access

Tell us about your processing, and we'll reply by email.

Guides

Recipes

The batch overhead is shared by its addresses: a repeat USDT sweep on Sepolia takes about 44,600 gas alone in its batch and 18,100 in a batch of 50. Send sweep requests in bursts, for example every few minutes for everything that arrived, rather than one by one with pauses. A batch takes your gas wallet’s due sweeps on its chain, to any of your hot wallets, oldest first, up to the chain’s batch size.

When you need the transaction’s hash in the response, send the sweeps as a sweep list: POST /v1/sweep-lists with wait, 10 seconds unless you say otherwise, and your HTTP client’s timeout at 60 seconds. When your gas wallet is free, the answer is sent, with the transaction. When it is queued or processing, the hash comes in transaction.sent, whose transaction has the list’s list_id. Each list is a transaction of its own: for a steady flow of deposits, single sweeps sent in bursts stay cheaper and go faster.

You do not need to track which addresses are delegated. Sign an authorization when you create a deposit address and send it with every sweep of that address: the service uses it only when the address needs it. Re-sign only if the address sends a transaction of its own, which changes its nonce.

  • Leave amount out to sweep the whole balance; set it to sweep part of it.
  • Turn on keep_one_unit for permanent deposit addresses: your users’ next deposits become much cheaper, and with your fee above zero it does not raise what you pay. See Keeping one unit on the address.
  • Mind the decimals: amounts are integers in the token’s smallest units, and the same token can have different decimals on different chains. GET /v1/tokens gives each token’s decimals, and every sweep its token_decimals; for tokens you add yourself, check them against your books, see Tokens.
  • Fund it with a plain transfer of the chain’s native coin. It is one address on every chain, but each chain has its own balance.
  • Watch available in GET /v1/balance: the balance minus the fees due, which are kept in reserve.
  • Set a low balance alert to know when to top it up.
  • If it runs dry, sweeps wait and retry; after five attempts they fail. Top up and send them again with new external_ids.

No deposit address needs a gas top-up, and none is left with dust. The gas savings come from repeat sweeps: on permanent deposit addresses, which your users top up again and again, every subsequent sweep in a batch costs less than a conventional sweep. A first sweep costs about as much gas as a conventional one. See First and repeat sweeps.

  • A native coin sweep takes the address’s balance to zero, so no dust is left on it.
  • The first sweep of an address costs more than a plain transfer; in batches of 10 or more, every subsequent one costs less.
  • If users send ETH or BNB to an address from exchanges with a fixed gas limit, do not delegate it: see Deposits from exchanges.

The conventional cost of a token sweep always counts these two steps: top up the deposit address with native coin (21,000 gas), then transfer the token’s whole balance. How much native coin the address already holds does not change it.

Users do send native coin to deposit addresses. If an address already holds enough to pay for its token transfer, how you sweep it is your choice:

  • move the token yourself, in one step: the coin on the address pays for the gas;
  • move the native coin off yourself, and send us only the addresses without it;
  • send us both: the token, and the native coin as a sweep of its own. Nothing is left on the address.

The conventional cost stays the same either way. Gas per address that holds the token and enough native coin for its transfer, in a batch of 50 under today’s mainnet gas rules; in brackets, the difference from doing the same yourself:

Chain, token (rate)Yourself: the tokenYourself: the token, then the coinWith us: the tokenWith us: the token and the coin
Ethereum, USDT (70%)41,29762,29743,608 (+6%)59,768 (−4%)
BSC, USDT (0%)29,71550,71513,952 (−53%)28,643 (−44%)

The native coin sweep is an estimate: 14,691 gas in a batch of 50, plus the 10% markup on Ethereum. Moving the coin yourself usually leaves some of it on the address, see Zero left on the address; our sweep leaves 0.

Conventional sweeps leave native coin on almost every deposit address: see why. When you move your addresses to Portuna Sweep, collect it:

  1. Find it. Run the free Recovery scan on your deposit addresses. Its report shows the native coin left on each address and what it is worth.
  2. Leave out what is not worth a sweep, see below.
  3. Sweep the rest with ordinary native coin sweeps: "token": "native", without amount to take it all. The coin goes to the hot wallet, and the address is left with 0.
Terminal window
curl -X POST "https://api-testnet.portuna.io/v1/sweeps" \
-H "Authorization: Bearer $PORTUNA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"external_id": "dust-2c75",
"chain_id": 11155111,
"hot_wallet": "0x2Cd50979a8A33e8CA37DA85F8517fb148a67b769",
"account": "0x2c7536E3605D9C16a7a3D7b1898e529396a65c23",
"token": "native",
"authorization": {
"chain_id": 11155111,
"address": "0x4B016ED183d0CF18B99d2d4f9f6F218BC1D9CaF4",
"nonce": 14,
"y_parity": 0,
"r": "0x…",
"s": "0x…"
}
}'
  • Each address needs its authorization, as for any first sweep. After conventional sweeps its nonce is above 0: sign with the current one and send no transaction from the address until the sweep has gone out, see Nonces and stale authorizations. For an address that is delegated already, the service ignores it.
  • They are priced by your tariff for the native coin: the sweep’s gas plus your markup, 10% on Ethereum as standard and none on BSC, and never more than a plain transfer of 21,000 gas. See Fees and tariffs.
  • Do not delegate an address whose users send it ETH or BNB from exchanges with a fixed gas limit: see Deposits from exchanges.

On Ethereum a native coin sweep of a delegated address costs about 16,000 gas in a batch of 50, its fee included. Leave out an address whose leftover is worth less than its sweep: a balance in wei below the sweep’s gas times the gas price.

  • Sweep the dust after the address’s first sweep of a token with Portuna Sweep. That one sets the delegate, and the dust then goes as a repeat sweep.
  • On an address you do not delegate otherwise, the native coin sweep is the first one and sets the delegate too: it costs extra_gas of your tariff more.
  • The scan’s report does the sum for you. The cost of each balance is its sweep at the scan’s gas price, counting the first sweep of every address with its authorization, so for an address delegated already it is on the safe side. The net is the balance less that cost: send the native coin balances with a net above zero.

Each hot wallet has its own delegate, and an address runs one delegate at a time. To move an address to another hot wallet, sign an authorization for that hot wallet’s delegate and send it with the next sweep to the new hot wallet. That sweep costs about as much as a first one; no revocation is needed.

  • Each sweep: GET /v1/sweeps/{id} has swept_amount, tx_hash, gas_cost and fee, enough to recompute the fee; its item in transaction.mined has swept_amount and fee.
  • Match sweeps with what the chain shows: the transaction’s id and the sweep’s batch_index name its place for good, from the first transaction.sent on. To match the transfers your node or indexer sees, key a token sweep by the mined hash and transfer_log_index, the token’s Transfer to the hot wallet in the block. The native coin emits no Transfer: key it by the hash and log_index, the batch contract’s Swept event of the sweep. The mined hash is the one in transaction.mined, not necessarily the highest version of transaction.sent; GET /v1/sweeps/{id} has the same indexes. See Webhooks.
  • All sweeps: GET /v1/sweeps lists them newest first, filtered by status, chain_id, account, hot_wallet, your external_id, or the transaction that carried them: tx_hash or transaction_id; GET /v1/revocations does the same for revocations.
  • Batches: GET /v1/transactions lists the transactions that carried them, one per batch: its status, hash, block, hot wallets, how its sweeps fared, its gas and fees. Any hash of a transaction finds it with tx_hash, also one it had before it was replaced at a higher gas price; in GET /v1/sweeps the hash of a batch that reverted still finds its sweeps, unless it reverted while a version of the service from before October 24, 2026 was running.
  • The gas wallet: GET /v1/ledger lists every movement with its sign: gas, fees, withdrawals of fees and top-ups.
  • By day: GET /v1/usage?days=30 gives sweeps by outcome, revocations, gas and fees per UTC day and chain.

These lists are pages of up to 200 rows: pass next_cursor as cursor for the next one, or let the SDK go through them. See the API overview.