Paying for your transactions
Last updated
Last updated
Deprecation Notice: Gelato Functions is set to replace Automate, providing enhanced automation capabilities, access to off-chain data, unified payments across networks, and a performance boost. Migrate your tasks to Gelato Functions before Legacy Automate's end of life on June 30th, 2024 for uninterrupted service.
When Gelato executes your transaction it needs to pay the transaction fees. The fees can be paid in one of two ways:
From Gelato Balance
Transaction pays for itself
Gelato currently accepts payment in the native network token or its wrapped version for each network that Automate supports. For example, on Ethereum you can pay either in ETH or WETH and on Polygon either in MATiC or WMATIC - and so on for all the other networks we support.
This is the easiest option. You simply deposit some tokens into Gelato for each of the network(s) on which you want to execute transactions. Each time an execution occurs, Gelato will deduct the costs from your Gelato Balance to cover the gas costs. In the future we will introduce a small Gelato fee.
If your Gelato Balance is too low to cover the costs of your transaction it will not execute until you top-up your balance. We provide a notification service for you to receive alerts when your balance is running low.
You can deposit funds into your Gelato Balance on the fund's page.
If your smart contract will be the one creating tasks, it would need its own Gelato balance to pay for the task executions.
AutomateTaskCreator exposes withdrawFunds
function to allow fundsOwner
to withdraw from the contract's Gelato balance.
You can also choose not to pre-deposit funds into your Gelato balance and have your function pay the fee during executions.
This can be done by inheriting AutomateReady.
In the increaseCount
function, we use _transfer
inherited from AutomateReady
to pay Gelato.
_transfer
has two parameters, fee
and feeToken
which has to be queried from the Automate contract by using getFeeDetails()
If you would like to have your smart contract deposit funds at any point of time into it's Gelato balance, inherit AutomateTaskCreator
like so. Learn more about