Skip to content

Request access

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

Guides

Tokens

Every chain has base tokens, on for every account: its native coin and the tokens Portuna lists, USDT and USDC (on the testnets, the test USDT). You can turn any of them off, the native coin included. Any other ERC-20 you add yourself by its contract address, on the testnets and on mainnet: Portuna Sweep checks it on the chain and shows you its card, you compare the card with the issuer’s site or a block explorer, and you add the token with your confirmation.

Base tokensYour tokens
sourcepresetcustom
Whatthe chain’s native coin, and USDT and USDC as Portuna lists themany ERC-20 you add by its contract address
Onfor every account, until you turn one offonce you add it, after its check and with confirm: true
A sweep identifies it bynative, the ticker or the contract addressits contract address only
The rateyour rate of the chain, 70% on Ethereum and 0 on BSC as standard; the native coin a markup on gas80% on every chain, or a rate agreed with Portuna
The conventional costmeasured by Portuna on each chainmeasured when you add it, see below
After 5 failed sweeps in a rowstays onturned off; only support turns it on again

GET /v1/tokens lists them all: on each chain the native coin first, then the listed tokens by ticker, then yours, oldest first. A sweep is accepted only for a token that is active there. Each token shows what you pay for it, tariff, and its conventional cost, baseline; a token of your own also what its check found: provider, check and warnings. token is how a sweep identifies it.

In the console, the Tokens page of each environment shows the same list, with the card of each of your tokens, and checks, adds and turns off tokens. Every member of the organization sees it; adding and turning off tokens take a developer role or above.

Terminal window
curl "https://api-testnet.portuna.io/v1/tokens?chain_id=11155111" -H "Authorization: Bearer $PORTUNA_API_KEY"
200 OK
{
"tokens": [
{ "chain_id": 11155111, "token": "native", "symbol": "ETH", "decimals": 18, "source": "preset", "status": "active",
"tariff": { "kind": "base", "rule": "gas_markup", "rate_bps": 1000, "since": null, "valid_until": null },
"baseline": { "transfer_gas": null, "conventional_gas": { "new": 21000, "existing": 21000 }, "version": null, "method": "fork", "measured_at": null, "block": null, "status": "measured", "next": null } },
{ "chain_id": 11155111, "token": "USDT", "address": "0x3809a97a7a25C8bA577027c0AE2D81a09cdA1a2f", "symbol": "USDT", "decimals": 6, "source": "preset", "status": "active",
"tariff": { "kind": "base", "rule": "conventional_share", "rate_bps": 7000, "since": null, "valid_until": null },
"baseline": { "transfer_gas": 32633, "conventional_gas": { "new": 237233, "existing": 53633 }, "version": null, "method": "fork", "measured_at": null, "block": null, "status": "measured", "next": null } },
{ "chain_id": 11155111, "token": "0xd8bb299F465D010157B980D87C7A5ae3Ea9cA8d9", "address": "0xd8bb299F465D010157B980D87C7A5ae3Ea9cA8d9",
"symbol": "EURX", "name": "Example Euro", "decimals": 18, "source": "custom", "status": "active",
"provider": { "status": "testnet" },
"check": { "result": "ok", "method": "simulate", "checked_at": "2026-10-11T09:12:28Z" },
"warnings": [{ "code": "testnet", "message": "testnet: providers know no contracts here; compare the address with the issuer's source" }],
"tariff": { "kind": "custom_default", "rule": "conventional_share", "rate_bps": 8000, "since": null, "valid_until": null },
"baseline": { "transfer_gas": 34512, "conventional_gas": { "new": 239112, "existing": 55512 }, "version": 1, "method": "simulate", "measured_at": "2026-10-11T09:12:28Z", "block": 9412345, "status": "measured", "next": null },
"created_at": "2026-10-11T09:12:30Z" }
]
}
tokens, err := client.Tokens(ctx, sepolia)
if err != nil {
log.Fatal(err)
}
for _, t := range tokens {
// Token is what a sweep names it by: "native", a ticker, or the address of a token of your own.
// Only an active token can be swept; a refused one says why in Reason.
fmt.Printf("%s %s (%s): %s %s\n", t.Token, t.Symbol, t.Source, t.Status, t.Reason)
if t.Tariff != nil && t.Baseline != nil {
fmt.Printf(" rate %d bps (%s), conventional cost %d gas\n", t.Tariff.RateBps, t.Tariff.Kind, t.Baseline.ConventionalGas.Existing)
}
}

A base token you do not accept can be turned off, the native coin too: its path segment is native.

Terminal window
curl -X DELETE "https://api-testnet.portuna.io/v1/tokens/11155111/native" -H "Authorization: Bearer $PORTUNA_API_KEY"
curl -X POST "https://api-testnet.portuna.io/v1/tokens" \
-H "Authorization: Bearer $PORTUNA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"chain_id": 11155111, "address": "native"}'

DELETE responds with 204. The token stays in GET /v1/tokens as disabled, new sweeps of it get 422 token_disabled, and its queued sweeps end rejected with token_disabled; those already sent end as they will. POST /v1/tokens with the same address, or native, turns it on again and responds with 200 and the token. A base token needs no confirmation and no check.

In the Go SDK the zero address stands for the native coin.

// The zero address is the native coin. Its queued sweeps are rejected with token_disabled.
if err := client.DisableToken(ctx, sepolia, common.Address{}); err != nil {
log.Fatal(err)
}
// A base token is turned on again without a confirmation.
if _, _, err := client.EnableToken(ctx, sepolia, common.Address{}); err != nil {
log.Fatal(err)
}

Three steps, on a testnet or on mainnet:

  1. Check it. POST /v1/tokens/check checks the token and returns its card. It adds nothing.
  2. Compare the card with the issuer’s site or a block explorer: the address, the symbol, the decimals, and what the providers know of it.
  3. Add it with POST /v1/tokens and "confirm": true, which says you compared the card.
Terminal window
curl -X POST "https://api-testnet.portuna.io/v1/tokens/check" \
-H "Authorization: Bearer $PORTUNA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"chain_id": 11155111, "address": "0xd8bb299F465D010157B980D87C7A5ae3Ea9cA8d9"}'
200 OK
{
"chain_id": 11155111,
"address": "0xd8bb299F465D010157B980D87C7A5ae3Ea9cA8d9",
"testnet": true,
"explorer_url": "https://sepolia.etherscan.io/token/0xd8bb299F465D010157B980D87C7A5ae3Ea9cA8d9",
"source": "custom",
"status": "new",
"contract": { "symbol": "EURX", "name": "Example Euro", "decimals": 18, "total_supply": "1000000000000000000000000", "proxy": "", "implementation": null, "hints": [] },
"provider": { "status": "testnet" },
"check": { "result": "ok", "method": "simulate", "transfer_gas": 34512, "sweep_gas": 19804, "fee_bps": 0, "dust": false, "block": 9412345, "checked_at": "2026-10-11T09:12:28Z" },
"warnings": [{ "code": "testnet", "message": "testnet: providers know no contracts here; compare the address with the issuer's source" }],
"tariff": { "kind": "custom_default", "rule": "conventional_share", "rate_bps": 8000, "since": null, "valid_until": null },
"baseline": { "transfer_gas": 34512, "conventional_gas": { "new": 239112, "existing": 55512 }, "version": 1, "method": "simulate", "measured_at": "2026-10-11T09:12:28Z", "block": 9412345, "status": "measured", "next": null }
}
FieldWhat it says
contractWhat the contract says of itself: symbol, name and decimals, cleaned for display, total_supply, whether it is a proxy (proxy, implementation), and hints, what its code lets the issuer do: pause, blacklist, tax, max_tx, cooldown, fee, rebasing, erc777, upgrade.
providerWhat market data providers know of the address on mainnet: name, symbol, decimals on this chain, logo, site, rank and the provider’s page. attribution carries the credit the provider asks for: show it with its data. not_found on mainnet is an unknown token: you may add it, with a warning. On the testnets the providers are not asked, testnet: they know no testnet contracts.
checkHow the test sweep went: ok, or not_simulated if it could not run; the transfer (transfer_gas) and your sweep of one address (sweep_gas) in gas; fee_bps, the fee a transfer keeps; dust, a transfer of the whole balance leaves some behind.
warningsWhat to weigh, below.
tariff, baselineThe rate and the conventional cost the token would get, see below.
explorer_urlThe token’s page in the chain’s block explorer, to compare with.
statusYour state of the token now: new if you do not have it, or its status if you do. source is preset when the address is a base token of the chain: turn it on instead.

symbol and name are read with a bounded call and cleaned: control characters removed, cut to 32 and 64 characters. They are there for people to read; nothing in Portuna Sweep relies on them, and neither should you.

The check runs on the chain as it is, in a simulation, and sends nothing. First the contract:

Checkcode if it failsBlocked for every account
The address holds contract code.not_a_contractno
It is not an account delegated with EIP-7702, whose code starts with 0xef0100. A deposit address is one: its code returns success to every call and moves nothing.delegated_accountno
It is not a contract of Portuna Sweep: the factory, a batcher or a delegate.own_contractno
decimals() returns a number from 0 to 36.invalid_decimalsyes
balanceOf reads a stored balance. A token whose balances are not stored is a fake.balance_not_storedyes
A transfer emits a Transfer event. Without one, nothing would confirm a sweep.no_transfer_eventyes
A transfer works now. details.cause is the token’s own reason, such as a pause.transfer_failsno: check it again later
Portuna has not blocked it. details.category and details.public_note say why it did.token_blockedalready

Then the check runs your sweep’s own path: your gas wallet calls your batcher, and a deposit address delegated to your delegate moves the token to a hot wallet, for one address and for three in one batch. It measures the token’s transfer for its conventional cost on the way. A token that transfers but that your sweep cannot move gets 422 sweep_incompatible, with details.cause:

details.causeWhy the sweep cannot move it
item_gasA sweep of one address needs more than the 300,000 gas a batch gives it.
balance_hiddenThe token shows a delegated address no balance.
tx_originPlain transfers work and your sweep does not, for no other cause found: most likely the token wants the sender to be the transaction’s origin. Portuna looks into it; the token is not blocked for it.
sender_codeThe token refuses a sender with code.
batch_limitIt moves one address of a batch, but not several.

The automatic blocklist. invalid_decimals, balance_not_stored, no_transfer_event and sweep_incompatible (except tx_origin) come from the token’s code, and no retry changes them: once a check on a later block gives the same result, usually within minutes, the token goes on the blocklist for every account, with the category unsweepable. From then on everyone gets token_blocked for it. Every check also runs a base token of the chain through the same path: if that fails too, the node is at fault, and you get 503 chain_unavailable, not a verdict on your token.

A chain the environment does not serve gets 422 unknown_chain, an address that is not a non-zero 0x-address 422 invalid_address. If the chain’s node does not respond to the check, the response is 503 chain_unavailable: try again later. 503 token_check_unavailable means tokens cannot be added on that chain for now. Checks run your sweep on the chain’s node, so they are bounded: 20 in a row, then one every 6 seconds; more get 429 rate_limited, with the seconds to wait in Retry-After.

address := common.HexToAddress(os.Getenv("TOKEN"))
card, err := client.CheckToken(ctx, sepolia, address)
var refusal *portuna.Error
if errors.As(err, &refusal) {
switch refusal.Code {
case portuna.CodeTransferFails:
log.Fatalf("the token refuses transfers now (%s): check it again later", refusal.Cause())
case portuna.CodeChainUnavailable, portuna.CodeTokenCheckUnavailable:
log.Fatalf("the token could not be checked now, try again later: %v", err)
default:
// not_a_contract, sweep_incompatible (see Cause), token_blocked and the other refusals.
log.Fatalf("this token cannot be swept: %v %s", err, refusal.Cause())
}
}
if err != nil {
log.Fatal(err) // a network error or a timeout: try again
}
// Compare the card with the issuer's site or a block explorer: the address, the symbol, the decimals.
fmt.Printf("%s %q (%q), explorer %s\n", card.Address, card.Contract.Symbol, card.Contract.Name, card.ExplorerURL)
if card.Provider.Status == portuna.ProviderFound {
fmt.Printf("%s knows it as %s (%s). %s\n", card.Provider.Source, card.Provider.Name, card.Provider.Symbol, card.Provider.Attribution)
}
for _, w := range card.Warnings {
fmt.Printf("warning %s: %s\n", w.Code, w.Message)
}
if card.Baseline != nil {
fmt.Printf("rate %d bps of a conventional cost of %d gas (%s)\n", card.Tariff.RateBps, card.Baseline.ConventionalGas.Existing, card.Baseline.Status)
}
if card.Contract.Decimals == nil || *card.Contract.Decimals != wantDecimals {
log.Fatalf("the token does not have the %d decimals your books expect", wantDecimals)
}

Warnings do not stop you from adding a token. They are what to look at before you do, and they stay on the token in GET /v1/tokens.

codeWhat it means
unknown_to_providersMainnet: no market data provider knows the contract, an unknown token.
provider_unavailableThe providers did not respond; they are asked again later.
testnetA testnet: the providers know no contracts here. Compare the address with the issuer’s source.
lookalikeThe symbol looks like a base token’s, such as USDT, but this is not that token; base identifies it.
other_chainThe address is a base token of another chain; base identifies it.
decimals_mismatch, symbol_mismatchThe contract and the provider disagree.
fee_on_transferThe token keeps fee_bps of each transfer: less reaches the hot wallet, and sweeps count what arrives.
rebasingA transfer of the whole balance leaves a little on the deposit address.
near_item_limitYour sweep of the token, sweep_gas, comes close to the 300,000 gas a batch gives one address.
proxyThe issuer can replace the token’s code; implementation is the current one.
not_simulatedThe test sweep could not run. The token is run on your first deposit and priced at the network’s floor until then.
baseline_reviewA transfer costs more than 80,000 gas: the token is priced at 80,000 until Portuna has reviewed its conventional cost.
Terminal window
curl -X POST "https://api-testnet.portuna.io/v1/tokens" \
-H "Authorization: Bearer $PORTUNA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"chain_id": 11155111, "address": "0xd8bb299F465D010157B980D87C7A5ae3Ea9cA8d9", "confirm": true}'

The token is checked again, with the same refusals as POST /v1/tokens/check, and added: 201 with the token as in GET /v1/tokens. Without "confirm": true, a token of your own gets 422 confirmation_required.

  • 200 is the response for a token you have already, or a refused token added again: that checks it anew and starts its count of failed sweeps anew.
  • A token whose transfer costs more than 80,000 gas is added and swept at once, priced at 80,000 until Portuna has reviewed its conventional cost: baseline.status is review until then.
  • A token turned off after 5 failed sweeps in a row gets 409 token_needs_support: only support turns it on again.
  • You can have up to 100 tokens of your own on a chain, refused ones included; the next one gets 409 too_many_tokens until you remove one.
// Confirmed says you compared the card. Without it, a token of your own gets confirmation_required.
token, created, err := client.EnableToken(ctx, sepolia, address, portuna.Confirmed())
switch portuna.ErrorCode(err) {
case "":
if err != nil {
log.Fatal(err) // a network error or a timeout: try again
}
case portuna.CodeTokenNeedsSupport:
log.Fatal("the token was turned off after 5 failed sweeps: contact support")
case portuna.CodeTooManyTokens:
log.Fatal("remove a token first: 100 tokens of your own per chain at most")
default:
log.Fatal(err) // the refusals of the check, as above
}
fmt.Printf("added %s, new: %t, status %s\n", token.Token, created, token.Status)
if token.Baseline != nil && token.Baseline.Status == portuna.BaselineReview {
// Its transfer costs more than 80,000 gas: it is priced at 80,000 until Portuna has reviewed its conventional cost.
fmt.Println("the token's conventional cost waits for review")
}
Terminal window
curl -X DELETE "https://api-testnet.portuna.io/v1/tokens/11155111/0xd8bb299F465D010157B980D87C7A5ae3Ea9cA8d9" \
-H "Authorization: Bearer $PORTUNA_API_KEY"

The response is 204. A token of your own is removed from the list, and new sweeps of it get 422 unknown_token; sweeps of it that are still queued end rejected with token_disabled. A base token is turned off instead, as above. An address that is neither a base token nor added by you gets 404 not_found. A token turned off after 5 failed sweeps stays in your list, 409 token_needs_support, until support has looked at it.

// A token of your own is removed; its queued sweeps are rejected with token_disabled.
if err := client.DisableToken(ctx, sepolia, address); err != nil {
log.Fatal(err)
}

A sweep identifies a token of your own by its contract address, never by its symbol:

{ "chain_id": 11155111, "hot_wallet": "0x2Cd50979a8A33e8CA37DA85F8517fb148a67b769", "account": "0x2c7536E3605D9C16a7a3D7b1898e529396a65c23", "token": "0xd8bb299F465D010157B980D87C7A5ae3Ea9cA8d9" }

In the sweep, token is that address too, while token_symbol and token_decimals hold what the token said of itself when the sweep was requested. Everything else works as for a base token: first and repeat sweeps, batches, keep_one_unit and the statuses.

sweep, _, err := client.CreateSweep(ctx, portuna.SweepRequest{
ExternalID: "tokens-1",
ChainID: sepolia,
HotWallet: common.HexToAddress(os.Getenv("HOT_WALLET")),
Account: common.HexToAddress(os.Getenv("DEPOSIT")),
Token: token.Token, // a token of your own is named by its address, never by its symbol
})
if err != nil {
log.Fatal(err)
}
// Webhooks tell the outcome too: transaction.mined, or sweep.rejected or sweep.failed if no transaction
// carried it.
for sweep.Status == portuna.SweepQueued || sweep.Status == portuna.SweepProcessing {
time.Sleep(10 * time.Second)
if sweep, err = client.Sweep(ctx, sweep.ID); err != nil {
log.Fatal(err)
}
}
if sweep.Status == portuna.SweepSwept {
// SweptAmount is what the token's Transfer events say reached the hot wallet: credit that.
fmt.Println("swept:", sweep.SweptAmount)
if sweep.ReportedAmount != "" {
// A token that keeps a fee on transfers: this is what the transfer claimed.
fmt.Println("the transfer reported:", sweep.ReportedAmount)
}
} else {
// transfer_not_confirmed: the token reported success and moved nothing. Credit nothing.
fmt.Printf("sweep %s: %s\n", sweep.Status, sweep.Reason)
}

A token’s contract can return whatever its author wrote: report a transfer it did not make, or move less than it says. So Portuna Sweep does not take a token’s word for an amount. For every token sweep, swept_amount is the value of the token’s own Transfer events from the deposit address to the hot wallet in that sweep’s part of the batch receipt: what the chain recorded as arriving.

  • A token that keeps a fee on transfers. swept_amount is what arrived; reported_amount is what the transfer reported moving. reported_amount is present only when the two differ.
  • Events that say more arrived than was sent. A token moves at most what it is asked to, so swept_amount never exceeds what the transfer reported moving: events that claim more count as that.
  • A token that reports success and moves nothing. With no Transfer event from the deposit address to the hot wallet, the sweep ends failed with transfer_not_confirmed. Nothing counts as moved and there is no fee.
  • Events of other contracts in the same transaction do not count: only the swept token’s own.
statusMeaning
activeSweeps of the token are accepted.
disabledYou turned the base token off. In a token.refused event: you removed your token since.
refusedPortuna refuses the token; reason says why.

A sweep of a token you may not sweep is refused at once with 422 and one of these codes; sweeps of it that were queued before end rejected with token_disabled:

codeWhy
unknown_tokenNeither a base token of the chain nor one you added: a token you removed, one another account added, or a token of your own named by its symbol.
token_disabledYou turned the base token off.
token_refusedPortuna refuses the token: see its reason in GET /v1/tokens.
token_needs_supportThe token was turned off after 5 sweeps in a row failed because of it: contact support.
token_blockedPortuna blocked the token for every account.
reasonWhat happenedWhat to do
blockedPortuna blocked the token on this chain, for every account; blocked says why.Nothing: it cannot be added while it is blocked.
failing5 sweeps of your token in a row failed on chain for the token’s fault: TokenTransferFailed, reverted or transfer_not_confirmed.Find out why the token fails transfers, then contact support: only support turns it on again.
not_a_contractThe token’s code is gone.Remove it.
delegated_accountThe address is an account delegated with EIP-7702 now.Remove it.
invalid_decimalsdecimals() fails now, or returns more than 36.Remove it, or add it again once the token is fixed.
decimals_changeddecimals() returns a different value than when you added the token.Check your books, then add it again: it takes the new decimals.
  • Failing sweeps. Only failures for the token’s fault count, and only for your own tokens; an empty balance or a gas wallet without gas does not count. A swept sweep starts the count anew. After 5 in a row the token is turned off: POST /v1/tokens responds with 409 token_needs_support, and only support turns it on again.
  • Checks at start. Whenever the service starts, it checks your active tokens again as when you added them. A token whose node does not respond stays as it is.
  • The blocklist. Portuna can block a token on a chain, such as a scam or a token that breaks sweeps, and the check blocks a token it finds unsweepable by itself. The block overrides everything: a blocked token, base or your own, is refused with blocked for every account, and POST /v1/tokens/check and POST /v1/tokens refuse it with token_blocked. If the block is lifted, the token is what you had made it again.

Whenever a token you could sweep is refused, you get a token.refused webhook event with the token in data, as in GET /v1/tokens. A change of what you pay for a token comes as tariff.changed, below:

// onTokenEvent handles token.refused and tariff.changed events, once ParseWebhook has verified the delivery.
func onTokenEvent(event portuna.Event) error {
switch event.Type {
case portuna.EventTokenRefused:
token, err := event.Token()
if err != nil {
return err
}
// Its queued sweeps end rejected with token_disabled. Stop requesting new ones until you know why.
log.Printf("token %s on chain %d is refused: %s", token.Token, token.ChainID, token.Reason)
case portuna.EventTariffChanged:
change, err := event.TariffChange()
if err != nil {
return err
}
// Token is nil for all of your own tokens on the chain. The change applies to batches prepared from
// EffectiveAt on.
log.Printf("tariff on chain %d changes at %s: %s", change.ChainID, change.EffectiveAt.Format(time.RFC3339), change.Reason)
if change.Reason == portuna.TariffChangeExpiring && change.NewRateBps != nil {
// An agreed rate runs out within 7 days; NewRateBps applies from EffectiveAt.
log.Printf("agreed rate ends at %s, then %d bps", change.EffectiveAt.Format(time.RFC3339), *change.NewRateBps)
}
}
return nil
}

The fee is computed as for any token, see Fees and tariffs:

fee = max(0, X × conventional cost of the token − gas of the sweep)

  • X for a token of your own is 80% by default on every chain, BSC included: custom_tokens in GET /v1/tariff. Portuna may agree another rate with you, for all your tokens on a chain or for one of them, and possibly until a date; tariff of each token shows the rate in force and where it comes from: custom_default or negotiated.
  • The conventional cost is what a conventional sweep would spend on the token: the top-up of the deposit address (21,000 gas) plus a plain transfer of the token’s whole balance from it, transfer_gas, plus creating the address’s account for an address that has none. The transfer is measured when you add the token, simulate or holders in baseline.method.
  • Not measured yet, such as a token whose test sweep could not run, the token is priced at the network’s floor, floor in GET /v1/tariff, with the status provisional: on Ethereum a transfer of 27,900 gas, a conventional cost of 48,900. It is measured on the first deposit swept at the latest, yours or another account’s: the conventional cost is the contract’s, the same for everyone (deposit). The floor is below any real ERC-20, so you never pay more for a token that could not be measured.
  • A transfer above 80,000 gas, measured when you add the token or later, is priced at 80,000 until Portuna has reviewed the conventional cost (baseline.status: review); the token is swept meanwhile. A review that settles on more than 80,000 is a rise like any other: it applies after 7 days’ notice.

Each sweep records what it was priced with: conventional_gas, rate_bps, tariff_source and, for your own token, baseline_version.

  • A new rate applies to the batches prepared after the change; a sweep keeps the rate of its batch.
  • Conventional costs are frozen and versioned. A new version that is lower applies at once; one higher by more than 5% applies 7 days after you are notified, and baseline.next shows it with its effective_at until then.
  • You are notified with a tariff.changed webhook event: an agreed rate set, withdrawn or expired (reason negotiated, expired), a conventional cost changed (baseline), or the default rate of your own tokens on the chain changed (default). token is null for a rate of all your own tokens on the chain.
  • For an agreed rate with an end, you are notified twice. 7 days before it runs out, tariff.changed comes with the reason expiring, effective_at at its end and, in new_rate_bps, the rate that applies then: your agreed rate for all your tokens on the chain if it still applies, else the default. The console shows a banner on every page in those 7 days, and tariff.next_rate_bps of the token shows the rate after the end all along. When the rate runs out, tariff.changed comes again, with the reason expired. No event comes when the end of a rate changes nothing, the level above being the same.

A sweep of your token that fails on chain pays no fee, only gas. The batch gas is split by what each address is expected to take, by its token’s weight, so a light token’s sweep does not pay for a heavy one’s; and gas that a failing sweep of your own token burned beyond that is its own, up to the 300,000 gas an address may take. A token that keeps failing is turned off after 5 failures in a row.

  • Compare the card before you add a token. The address, symbol and decimals with the issuer’s site or a block explorer; mind lookalike and other_chain, and on mainnet unknown_to_providers.
  • Name tokens by address. Keep the contract address of each token you accept in your own records, and send that address in sweeps. In sweeps of your tokens, token is the address, never the symbol.
  • Treat symbol and name as untrusted text. Show them escaped, never match on them, never let them decide what a deposit is worth.
  • Check the decimals before you credit users. Compare token_decimals of the sweep with the decimals your books keep for that address, and hold the credit if they differ.
  • Credit swept_amount. Not the amount you asked for, nor reported_amount: swept_amount is what the chain confirmed reached your hot wallet.
  • Keep only what you accept, turn off the base tokens you do not, and handle token.refused: stop requesting sweeps of a refused token until you know why.