Setting up a Gas Manager Policy

A guide to setup your first gas manager policy using the Alchemy Admin Dashboard.

This document outlines creating a gas manager policy to cover transaction fees for your users. Before getting started, you'll need a growth or enterprise Alchemy account. If needed, you can do this by visiting our website and signing up for a new account or upgrading your existing account.

Step 1: Create an account and application

Once you have an account, create a new application or use an existing application along with the associated chain.


Try on testnets first!

Your new gas manager policy will directly associate the application and network in this step. We recommend creating an application on a test network like Sepolia or Mumbai.

Step 2: Go to create a new policy

After logging in, navigate to the "Gas Policies" section and click "Create a policy" or click here.

Step 3: Fill out your new policy

In the "Create Paymaster" form, you will need to enter the name of your gas manager and select the application from [Step 1].

Step 4: Setup your spending rules

After hitting next, you can optionally set up address levels and global rules.


A note on Rules

Address and global rules allow you to limit the amount of money or the number of transactions that can be transferred from the gas manager policy. Address rules limit the maximum USD amount or the number of transactions covered for a recipient address. At the same time, a global cap restricts the total amount that can be spent across all recipient addresses for that policy.

Step 5: Setup an allow or blocklist

Next, you can also optionally set up an address allowlist or blocklist.


A note on allowlist or blocklist

An allow list allows you to list addresses that can only use the gas manager policy, you alternatively setup a block list, which allows all addresses to execute against the paymaster policy, except the addresses specified in the list.

Step 6: Set a policy duration


A note on Policy Durations

The policy duration will be the length of time that your paymaster policy remains in effect. After the end date has passed, your policy will automatically become deactivated.

Step 7: Publish your policy 🚀


Published Policies

Remember! Your policy will go live if your policy date range includes the current time. You can also go back and edit or delete existing policies by clicking the "Edit Policy" button.

Step 8: Activate your policy ⚡️

Once the policy is up and running, activate it by clicking the "Activate" button in the top-right corner.

Next up: Executing a gas manager coverage

The following docs outline how to execute a gas manager coverage all you need to do is:

  1. Pull your policy id from this process and get your supported entry points using: eth_supportedEntryPoints
  2. For each user operation where a gas manager is needed to pay gas, call alchemy_requestPaymasterAndData with the user operation details.
  3. With the returned paymasterAndData request the final user operation and submit it to a bundler by following this guide.

Note: Interaction with eth_estimateUserOperationGas

For accurate gas estimation, the gas manager portion of the User Operation validation contract call needs to run. When calling eth_estimateUserOperationGas it is recommended to use both a dummy signature (for the account portion) and a dummy paymasterAndData (for the gas manager portion). The dummy data is specific to the validation scheme of your account/gas manager. It does not need valid data, but it should not revert and should only fail with a signature error.

For the Alchemy gas manager, it is recommended to use the following dummy value in thepaymasterAndData before sending to eth_estimateUserOperationGas
DUMMY_PAYMASTER_AND_DATA = “0xc03aac639bb21233e0139381970328db8bceeb67fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c”

What’s Next

Now that you created your first policy it's time to sponsor your first request!