Skip to main content

How gas is paid and funded

What happens to a write when the paying wallet runs out of gas, how the gas payer models differ, and the Platform API routes behind Transaction funding.

The platform sends an organisation's transactions from paying wallets funded with the network's native fee token, called gas. When a wallet runs short on a gas-charging network, the platform pauses the write, records a funding requirement naming the wallet and amount, and resumes automatically if funded within the funding window.

The Console calls a funding requirement a funding request. See Transaction funding to inspect who pays, top up wallets and switch the gas payer in the Console.

When a wallet runs out of gas

The platform pauses a write for funding only after the network refuses it for insufficient gas. Gas forecasts size the requested amount without triggering a pause. The one exception is setting up or repairing an organisation's bundler wallet, where the platform checks the balance and raises a requirement before any write is refused. The refused wallet can be a user's signing wallet, a smart wallet, the relayer wallet, the bundler wallet or the paymaster deposit.

The funding requirement records three figures for that wallet on that network: the minimum amount needed, a larger recommended amount covering fee drift and upcoming operations, and the last observed balance. Only one requirement stays active per organisation, network and wallet, so later writes blocked on the same wallet join it.

While a write waits, its transaction request keeps its state and names the active requirement. A smart-wallet operation that the bundler finds short waits the same way and joins the next bundle once its smart wallet or paymaster deposit is funded. See User operations to read an operation's status.

How a write paused for gas endsThe network refuses a sent write for gas, so the platform pauses it under an active funding requirement. A top-up resolves the requirement and the write resumes. If the funding window closes first, the requirement expires and the write fails with DALP-9087. One top-up releases every write waiting on the same wallet.How a write paused for gas endsThe desktop figure drawn for narrow screens: a refused write pauses until a top-up resolves its requirement or the funding window closes and it fails with DALP-9087.

A paused write ends in one of two ways: a top-up resolves its requirement, or the funding window closes.

A funding requirement moves through three statuses:

Status
Meaning
Waiting writes
active
The wallet is short. A notice shows at the top of Transaction funding.
Wait.
resolved
The platform observed enough funds on the wallet.
Resume, all of them, on one top-up.
expired
The funding window closed first.
Fail with the gas required error, DALP-9087.

The funding window defaults to 30 minutes per network and can be configured from 60 seconds to 7 days. Gas settings covers that window and the settle delay (2 minutes by default, up to five retries when a node still refuses a freshly funded wallet).

Some writes never pause:

  • Writes on a zero-gas network.
  • Calls that opt out of pausing, described in Fund through the API.
  • Multi-signer smart-wallet writes, which fail on a shortfall instead of pausing.

For a user's own wallet, the platform emails each person who holds it (or the organisation's owners if no person holds it) with the network, wallet address and minimum balance needed. Shared gas wallets (relayer, bundler and paymaster deposit) send no email and appear instead as notices on Transaction funding and the home dashboard.

A user can cancel a write paused on their own EOA wallet while it waits. Transaction lifecycle covers cancellation in other states.

Choose a gas payer

Two settings decide who pays gas for user-signed transactions. They change which wallet pays and what you keep funded without changing the underlying network fee. Gas sponsorship explains how each route reaches the network.

  • Wallet type (organisation-wide): chooses between EOA wallets and smart wallets. Moving from EOA wallets to smart wallets is permanent and happens in Transaction funding.
  • Gas payer (per network): with EOA wallets, chooses “Self-pay” or “Relayer-paid”. With smart wallets, chooses “Self-pay” or “Paymaster-paid”.

An organisation selects its wallet type and preferred gas payer during onboarding. The first network takes that payer unless its paymaster lacks a ready sponsorship key, in which case sponsorship stays off until an operator enables it. Every network added later, and every network after moving to smart wallets, starts on Self-pay until changed via Change gas payer.

Wallet type and gas payer
Who pays gas
What you keep funded
Can you leave it
EOA wallets, Self-pay
Each user's own wallet
Each signer's wallet that runs short
Yes, per network
EOA wallets, Relayer-paid
The relayer wallet on that network
The relayer wallet
Yes, per network
Smart wallets, Self-pay
Each smart wallet, which repays the bundler
The bundler wallet and each smart wallet
Per network, not back to EOA
Smart wallets, Paymaster-paid
The paymaster deposit, which repays it
The bundler wallet and the paymaster deposit
Per network, not back to EOA
How a write reaches the network for each gas payerEOA wallets with Self-pay: the EOA wallet signs, submits and pays. Relayer-paid: the EOA wallet signs, and the relayer wallet submits and pays through the forwarder contract. Smart wallets: the smart wallet signs, and the bundler submits through the EntryPoint and fronts the gas. Under Self-pay the smart wallet pays the bundler back, under Paymaster-paid the paymaster deposit does.How a write reaches the network for each gas payerThe desktop figure drawn for narrow screens: the route a write takes under each of the four gas payers.
On a network that charges no gas, the same route runs and no fee is paid.

Self-pay suits users who already hold native currency and zero-gas networks, where other payers add an extra hop. With EOA wallets, the organisation funds nothing, though a signer who runs short waits for funding.

Relayer-paid suits EOA users who should never hold gas. The organisation funds one relayer wallet per network. Each user signs a meta transaction, the relayer submits it through the forwarder contract and pays the fee, and the target contract records the user as sender. The relayer cannot alter a signed request, though it can delay sending it.

Paymaster-paid suits smart-wallet users who should never hold gas. The bundler wallet fronts gas and the paymaster deposit at EntryPoint repays it in the same transaction, so both must stay funded. Switching to Self-pay turns sponsorship off while leaving the paymaster contract deployed and its deposit untouched. One send stays sponsored with sponsorship off: a person's own payout send during an offboard that retires their key, so the whole coin balance can leave the wallet (Offboard a participant). On a network that charges state creation as state gas, that repayment includes each operation's state creation gas, so an operation that creates state costs the payer more than one that does not.

What Relayer-paid does not cover

The relayer pays only for transactions it can relay:

  • The forwarder accepts EOA signatures only, so a smart-wallet sender fails immediately.
  • If the target contract does not trust the forwarder, the user's own wallet pays as under Self-pay.
  • Calls that attach native currency fail immediately because the relayer never funds sent value.
  • If the user's custody provider cannot sign meta-transaction requests, the call fails naming that provider.

The forwarder runs each user's requests in strict order, so the platform relays one transaction per user wallet per network at a time. Later writes from that wallet wait up to one hour for the previous one to finish, while different users do not block each other. A relayed transaction can be cancelled before confirmation by sending an empty replacement.

Changing who pays

Switching gas payer applies to new transactions on that network only. Transactions already prepared for the relayer still go through it, and deploying the organisation is always paid by the deploying wallet. Users keep the same addresses, assets and permissions.

Switching an EOA network to Relayer-paid creates a relayer wallet on that network. Switching back to Self-pay leaves its balance intact as “Idle” in the Wallets table, where a Permission manager can withdraw it. Returning to Relayer-paid later reuses the same relayer wallet and balance.

Fund through the API

The Platform API reads and updates the same funding state. System routes target the organisation's default network unless X-Chain-Id names another chain ID. All amounts are decimal wei strings.

Task
Route
List funding requirements
GET /api/v2/organizations/funding-requirements
Read whether a write waits for funds
GET /api/v2/transaction-requests/{transactionId}
Follow a write as it pauses and resumes
GET /api/v2/transaction-requests/{transactionId}/stream
Read the bundler wallet's balance
GET /api/v2/system/bundler/balance
Read a paymaster deposit
GET /api/v2/system/paymasters/{address}/balance
Deposit into the paymaster from your account
POST /api/v2/system/paymasters/{address}/deposits
Read how much a payer wallet can withdraw
GET /api/v2/system/payers/{address}/withdrawable
Withdraw from a payer wallet or paymaster deposit
POST /api/v2/system/payers/{address}/withdrawals
Change the gas payer with EOA wallets
PUT /api/v2/organizations/networks/gas-payer
Turn sponsorship on or off with smart wallets
PUT /api/v2/system/paymasters/config

Full schemas live in the v2 API reference under Transaction funding, Transactions and Organisation deployment.

Reading funding requirements and paused writes

The requirements list defaults to active requirements, newest first, and supports filter[status] (resolved or expired) plus filters on chainId, subjectAddress, subjectKind (eoa, smart-account or paymaster-deposit), expiresAt, lastRefusalAt and createdAt. Each row carries requiredWei, advisoryTotalWei, observedWei, status, expiresAt and resolvedAt.

Permission manager, Gas manager and System manager roles see every row in full. Other callers see addresses and amounts only for organisation wallets and every personal participant they own and may act as, including newly created participants waiting on identity gas.

A transaction request is paused while its status carries activeRequirement, naming id, address, role, subjectOwner (caller, organisation or platform), chainId and nativeCurrency. The signing caller, organisation owners and platform administrators also receive shortfall and recommendedTotal. If activeRequirementUnavailable: true appears, read the status again.

The status stream emits events whenever a write starts or stops waiting on a requirement and closes after 180 seconds while in flight, so reopen it to keep following. When the window closes, the request fails with DALP-9087.

Declining the funding pause

Send Prefer: dalp-no-funding-pause, alone or combined with a wait such as Prefer: wait=30, dalp-no-funding-pause, to fail fast with DALP-9087 instead of pausing. Without a wait, the route returns HTTP 202 and records the failure on the transaction request.

Routes listing DALP-14062 (TRANSACTION_QUEUE_FUNDING_REQUIRED) in the API reference can return HTTP 400 with data.transactionId when the queue recorded one. The header can decline a pause, never force one.

Topping up and withdrawing

No API route moves native funds in from outside the platform: send the network's currency to subjectAddress from an external wallet or treasury service. The paymaster deposit is the exception: POST /api/v2/system/paymasters/{address}/deposits takes amount in wei, requires wallet verification and the Permission manager, Gas manager or System manager role, and pays from the acting account.

Before withdrawing from a payer wallet or paymaster deposit, read the withdrawable limit (accessible to Permission manager, Gas manager, System manager and Auditor roles). Passing destination prices the withdrawal reserve for that address:

  • balance: wallet balance at the latest block (or latest indexed EntryPoint deposit for a paymaster).
  • reserve: cost of sending the withdrawal itself, including fee-bump replacement, taking the higher of a 1-wei transfer and the full withdrawable transfer.
  • inFlightReserve: worst-case cost of the wallet's unsettled signed writes and in-flight bundles.
  • withdrawable: balance minus reserve and inFlightReserve, floored at 0.

The withdrawal route re-applies the same calculation when sent (and checks the live EntryPoint deposit for a paymaster), returning DALP-14027 with the live figures if the limit fell. It only tracks writes the platform sent: if an external spend using the same key leaves too little for the withdrawal, it returns DALP-12104 to retry once confirmed.

Withdrawals require wallet verification and the Permission manager role (plus System manager on the signing account for paymaster withdrawals), take destination and amount (wei or all), and return HTTP 200 on settlement or HTTP 202 with a transaction request to follow.

Code
What the route refuses
DALP-14025
A wallet that is not one of the organisation's payer wallets on the network.
DALP-14027
An amount over the current limit.
DALP-14028
A destination that cannot receive the transfer.
DALP-12104
A withdrawal while the network holds a spend the platform did not send. Retry it.

Changing who pays through the API

With EOA wallets, an organisation owner or platform administrator calls PUT /api/v2/organizations/networks/gas-payer with chainId, gasPayer (self or relayer) and an optional reason. Smart-wallet organisations receive gas-payer-unavailable.

With smart wallets, a Permission manager, Gas manager or System manager calls PUT /api/v2/system/paymasters/config with enabled: true (Paymaster-paid) or false (Self-pay).

Read Gas sponsorship for how a sponsored operation reaches the network, Operator wallet for how the platform watches the balances of wallets it sends from, and Transaction funding for the Console screen.

Was this page helpful?