Guides
Recipes
Batch your requests
Section titled “Batch your requests”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.
Get the hash at once
Section titled “Get the hash at once”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.
Send authorizations freely
Section titled “Send authorizations freely”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.
Decide how much to sweep
Section titled “Decide how much to sweep”- Leave
amountout to sweep the whole balance; set it to sweep part of it. - Turn on
keep_one_unitfor 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/tokensgives each token’sdecimals, and every sweep itstoken_decimals; for tokens you add yourself, check them against your books, see Tokens.
Keep the gas wallet funded
Section titled “Keep the gas wallet funded”- 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
availableinGET /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.
Where the gas savings are
Section titled “Where the gas savings are”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.
The native coin
Section titled “The native coin”- 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.
Native coin already on the address
Section titled “Native coin already on the address”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 token | Yourself: the token, then the coin | With us: the token | With us: the token and the coin |
|---|---|---|---|---|
| Ethereum, USDT (70%) | 41,297 | 62,297 | 43,608 (+6%) | 59,768 (−4%) |
| BSC, USDT (0%) | 29,715 | 50,715 | 13,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.
Collect the dust of conventional sweeps
Section titled “Collect the dust of conventional sweeps”Conventional sweeps leave native coin on almost every deposit address: see why. When you move your addresses to Portuna Sweep, collect it:
- 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.
- Leave out what is not worth a sweep, see below.
- Sweep the rest with ordinary native coin sweeps:
"token": "native", withoutamountto take it all. The coin goes to the hot wallet, and the address is left with 0.
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.
What is worth a sweep
Section titled “What is worth a sweep”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_gasof 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.
Several hot wallets
Section titled “Several hot wallets”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.
Reconcile with your books
Section titled “Reconcile with your books”- Each sweep:
GET /v1/sweeps/{id}hasswept_amount,tx_hash,gas_costandfee, enough to recompute the fee; its item intransaction.minedhasswept_amountandfee. - Match sweeps with what the chain shows: the transaction’s
idand the sweep’sbatch_indexname its place for good, from the firsttransaction.senton. To match the transfers your node or indexer sees, key a token sweep by the mined hash andtransfer_log_index, the token’sTransferto the hot wallet in the block. The native coin emits noTransfer: key it by the hash andlog_index, the batch contract’sSweptevent of the sweep. The mined hash is the one intransaction.mined, not necessarily the highestversionoftransaction.sent;GET /v1/sweeps/{id}has the same indexes. See Webhooks. - All sweeps:
GET /v1/sweepslists them newest first, filtered bystatus,chain_id,account,hot_wallet, yourexternal_id, or the transaction that carried them:tx_hashortransaction_id;GET /v1/revocationsdoes the same for revocations. - Batches:
GET /v1/transactionslists 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 withtx_hash, also one it had before it was replaced at a higher gas price; inGET /v1/sweepsthe 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/ledgerlists every movement with its sign: gas, fees, withdrawals of fees and top-ups. - By day:
GET /v1/usage?days=30gives 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.