Skip to main content
Gas sponsorship lets your project cover the native gas fee on your users’ transactions. You can sponsor every transaction or a configurable portion of them, and your users never need to hold a network’s native token for the transactions you sponsor.

Sponsorship configurations

By default your project sponsors everything. There is no setup step, and the gas cost is billed back to you on a monthly cycle through OMS, converted to a USD value at the time of each transaction. You can instead sponsor a subset of transactions per user. A rule might cover a user’s first three transactions, for example, and leave the rest to the user. When a transaction is not sponsored, the user pays its fee. They do not need the network’s native token to do so: preparation returns the tokens accepted for that fee, and the user can pay in a stablecoin instead. Sponsorship is configured on your OMS project. Your application code does not select it per transaction.

Handle both outcomes

Every transaction follows the same lifecycle:
  1. Prepare the transaction.
  2. Read whether the prepared transaction is sponsored, along with any fee options it returned.
  3. Execute. A sponsored transaction needs no fee selection. An unsponsored transaction needs one fee option.
Because a sponsorship rule can change which outcome applies without any change to your code, handle both. Read the fee options the preparation actually returned rather than assuming a sponsored transaction never carries any. Each SDK does this through a fee option selector. A sponsored preparation invokes your selector with an empty collection: return the platform’s empty value to continue, or throw to stop execution. Every SDK also ships a firstAvailable selector that handles both outcomes.

Transactions that are always sponsored

Three cases are sponsored regardless of your project’s rules:
  • Testnets. Transaction fees are sponsored on testnets.
  • Smart sessions. Smart session transactions must be sponsored. OMS rejects preparation when the transaction is not sponsored, so a remote backend never selects or submits a fee option. See Smart Sessions.
  • Server Wallet transfers. A Server Wallet transfer requires a sponsored quote, and preparation fails without one. See Server Wallets.