Fordefi Gas Station: Gas Refills for Automated Token Sweeps

Read Time 3 mins | Written by: Uri Eden

What is Gas?

Gas refers to the unit used to measure the computational effort required to execute operations and transactions on the Ethereum network. Every operation that is executed on the Ethereum Virtual Machine (EVM), such as smart contract execution or token transfers, consumes a certain amount of gas.

Gas Fee Challenges

In order to transact on Ethereum and Ethereum like blockchains (EVM-compatible) users needs to pay a gas fee. This gas fee is applicable to transactions involving both the primary asset of the blockchain and any other tokens present on the network. The transaction fee is paid only in ETH or base assets.

This is where the concept of a gas station proves valuable, providing benefits in terms of ease and efficiency. Gas station’s are typically engineered to negate the need for continuous tracking of your primary asset levels. In the absence of a gas station, users are required to manually manage and transfer funds to their vault accounts to cover transaction charges. This could pose a significant nuisance when funds are continuously swept or transferred to a main vault account, also referred to as the omnibus account.

Introducing Fordefi Gas Station

In contrast to many existing solutions for automating gas fees, Fordefi has taken a new approach and has developed a system explicitly designed to alleviate the burden of gas fees for our users. The Fordefi Gas Station is a unique mechanism that assists users in refilling their vaults with the required amount for sending transactions. Unlike traditional methods that fill the gas when funds are received into a wallet, Fordefi enables users to decide when to activate and refill the gas only when actually sweeping to another vault. This approach ensures customers only refill gas when needed and allows them to take into account other variables such as fee prices and multiple deposits to the same account that needs sweeping.

Further more, the customer is always in charge of his own gas fees without the need to refill external wallets that belong to the provider or a third party.

API and User Centric

Fordefi Gas Station employs a developer-friendly API that includes the following steps:

1. API users may set an optional flag fee_payer in the create transaction API call from the primary vault that points to any another vault. This allows for greater flexibility and convenience in managing transaction fees from any given vault to another.

2. If the funds in the originating vault (in the native currency) are insufficient to cover the transaction fee and the user has set the fee_payer option, an additional transaction will be automatically generated to refill it. This transaction transfers the deficit amount from the fee-payer vault to the primary vault, with a certain buffer to ensure smooth transaction processing.

3. The two transactions are created atomically. This means that if one transaction cannot be created due to policy restrictions, simulation failure, or lack of funds in the fee-payer vault, then neither transaction will be created. This ensures the reliability of the system and protects users from unexpected transaction failures.

Track and View Gas Transactions in the UI

Located in a dedicated section on the Fordefi user interface, users can easily track their gas transactions. Here, users can view all their past and pending gas transactions. Each transaction is listed with details such as the date, the origin and destination vault, amount, and status. This allows users to easily track and manage their gas transactions.

Fordefi Gas Station Screen

What’s Next? Gas-less Transactions

In our forthcoming iteration and as part of our commitment to continual improvement, we are planning to introduce a feature that will enable the creation of gas-less transactions. This feature will leverage the EIP-712 mechanism, a standard that has been proposed and accepted within the Ethereum community.

By employing this mechanism, customers will gain the ability to sign an off-chain permit message. This permit message essentially serves as an authorization, giving permission to another vault to send funds on the customer's behalf.

The advantage of this feature is that it completely removes the need to create two separate on-chain transactions, which is the current requirement. Instead, the process will be streamlined and simplified to require the sending of just one on-chain transaction.

This innovative approach not only enhances the efficiency of the transaction process but also contributes to a more user-friendly experience for our customers, who are always at the center of our product development endeavors.

Connect with us!

Learn how Fordefi's MPC wallet and security platform can help you unlock your DeFi strategies.
Uri Eden

Uri Eden is a Director of Product Management at Fordefi. Joining Fordefi in 2022, Uri brings with him over a decade of experience in product management and engineering.