Skip to content
PortunaPortunaPortunaDocsTestnet

Statuses, confirmations and reorgs

queued ──▶ processing ──▶ swept
▲ │ ├────▶ failed
└── retry ◀──┘ └────▶ rejected
StatusMeaning
queuedAccepted and waiting for a batch, or waiting for a retry.
processingIn a batch that is being prepared, is on its way, or waits for its confirmations.
sweptFinal. The funds are in the hot wallet: swept_amount, tx_hash, gas, fee.
failedFinal. The transfer reverted on chain, or the sweep ran out of attempts. reason says why.
rejectedFinal. The sweep was never sent: a check before sending kept failing. reason says which.

attempts counts the tries. The final status comes with a sweep.swept, sweep.failed or sweep.rejected webhook event. reason is always one of the stable codes below: branch on it. The node’s own messages stay in our logs; new codes may come, so treat one you do not know like internal.

Before a batch goes out, the service checks every address on one block. A sweep that fails a check is checked again after a pause, three times in all, because a node may not see funds or a delegation that have just arrived. If it still fails, the sweep is rejected:

reasonWhat happenedWhat to do
not_upgradedThe address is not delegated to this hot wallet’s delegate, and the request had no authorization.Send the sweep again with an authorization.
stale_authorizationThe authorization’s nonce is not the address’s nonce: the address sent a transaction after you signed.Sign again with the current nonce.
would_failThe simulation shows the transfer would fail, for example no balance or less than amount.Check the address’s balance.
nothing_to_sweepWith keep_one_unit, the address holds no more than the unit it keeps.Nothing: sweep it after the next deposit.

failed with the name of a contract error means the transfer reverted on chain, inside a batch that went through:

reasonMeaning
TokenTransferFailedThe token refused the transfer.
NativeTransferFailedThe hot wallet refused the native coin.
NothingToSweepThe balance was gone by the time the batch executed.
UnauthorizedBy the time the batch executed, the address was delegated to another delegate.
revertedThe transfer reverted without an error of our contracts, for example a token that used up the 300,000 gas one address may take.

Such a sweep bears its share of the gas but no fee. Any other reason of a failed sweep is the cause of its last attempt.

An attempt can fail as a whole: for example, the batch cannot be sent while the gas wallet has no gas, or the whole transaction reverts. The sweep then goes back to queued for a retry, and reason says why until the next attempt. A sweep gets five attempts, with growing pauses between them; once they run out, it ends failed with the cause of the last one. The same causes come in a revocation’s reason and in a hot wallet’s error.

reasonWhat happenedWhat to do
insufficient_gas_balanceThe gas wallet’s balance, less the fees due it keeps in reserve, does not cover the transaction.Top up the gas wallet: queued sweeps go on by themselves.
gas_limit_exceededOne sweep needs more gas than a transaction may use, for example because of an unusual token.Contact support.
transaction_revertedThe whole transaction reverted, on chain or in its gas estimate.Nothing: it is retried. If it keeps happening, contact support.
nonce_conflictAnother transaction took the gas wallet’s nonce.Nothing: it is retried with the next nonce.
chain_unavailableThe chain’s node did not answer, or failed the request.Nothing: it is retried.
internalSomething else failed on our side.Nothing: it is retried. If it keeps happening, contact support.

The service records an outcome only after the transaction’s block has enough blocks on top of it: three on the testnets, counting its own block. Until then the sweep stays processing.

If a reorg drops the block within those confirmations, the transaction’s receipt disappears, and the service sends the same transaction again from its journal. You see nothing but a delay: no duplicate sweep, no lost sweep. An outcome is recorded once its confirmations are in, and a deeper reorg after that is not handled; on Ethereum and BSC such reorgs are very rare.

The service also takes care of transactions that get stuck: it sends them to the node again and, if they still wait, replaces them with the same transaction at a higher fee. You never need to resend anything yourself.

StatusMeaning
pendingThe delegate is being deployed. Sweeps to this hot wallet get 409 hot_wallet_not_active until it is active.
activeThe delegate is on chain: tx_hash is its deployment. A hot_wallet.active event is sent.
failedThe deployment did not work; error says why. A hot_wallet.failed event is sent. Send POST /v1/hot-wallets again to retry.

error is a code too. Most often it is insufficient_gas_balance: top up the gas wallet, then register the hot wallet again. not_deployed means the deployment went through but the delegate is not at its address: contact support. Any other code is a cause of a failed attempt.

A revocation goes through queued and processing like a sweep, then ends as revoked, failed or rejected:

StatusreasonMeaning
revokedThe address has no delegation any more.
rejectednot_delegatedThe address had no delegation to remove.
rejectedstale_authorizationThe address’s nonce is no longer the one you signed for.
rejectedinvalid_authorizationThe authorization did not pass the check before sending. Sign again.
failednot_appliedThe transaction went through, but the chain skipped the authorization: the address’s nonce changed after the check. Sign again.
failedotherThe cause of the last attempt, after the attempts ran out.

See Revoking a delegation.