How gas fees are measured, why users set limits, and why you don’t need to worry about this on Bebop!

Network fees can be confusing. If you’re like me, you have some variation of the DeFi Saver Chrome plug-in to track how the fees are trending and are constantly looking for a green gas tank to signal low base fees. One minute you’re seeing 10 GWEI and an hour later it’s jumped to 150. What happened?

And when you finally see that green tank and initiate a trade, you don’t know how the base fee may increase or whether your transaction will be successfully completed. Sure, you can set maximum limits, but wouldn’t it be nice to know exactly how much you are going to pay when you submit the transaction? This is one of the problems that Bebop aims to solve for you.

On Bebop, you don’t need to worry about encountering any unexpected network fees. These fees are already included in the trade and they won’t change for you once the transaction has been initiated. Here we will explain some general content around how gas fees are measured, how you can set limits to avoid your transaction getting stuck in an infinite loop, and how Bebop eliminates any unexpected fees when conducting a trade on our platform.

Measuring gas fees

TL;DR — Total gas price is comprised of the computational units required for a transaction multiplied by the base fee (plus tip), where the base fee is the minimum required to have your transaction validated and the “tip” is what incentivizes the validator to validate your transaction.

Total gas fee = computational units * (base fee + priority tip)

Computational units: Not all transactions are created equally. Some are much more simple in nature, such as transferring one asset from one wallet to another, whereas others can involve a series of complicated instructions. Because of this, protocols have developed a method for paying in what is known as a computational unit. A standard transaction on Ethereum will typically cost around 21,000 units, while a complex transaction can cost much more.

Base fees: Each computational unit, whether this be a piece of logic completed by the transaction or the amount of storage used by the network for the transaction, will cost a set amount of gas. This amount is specified by the block that the transaction will be included in. The base fee is the minimum amount of gas that must be paid for every transaction in the block. As a result of the Ethereum London fork (a major upgrade to the blockchain that occurred in August 2021), this fee is then burned by the network.

Ethereum Gas Model

In Ethereum, gas fees are measured in GWEI (pronounced kind of like “gway”), where 1 GWEI = 10–18 ETH. When you set limits for the gas price that you’re willing to pay (base + tip), you’re specifying how much you’re willing to pay in GWEI for each unit of gas. The wallet submitting the transaction can specify these limits.

Priority tip or fee (previously “miner tip”): This, plus the block reward (which comes from the blockchain), is an economic incentive for the blockchain validator to validate your transaction. Users add this priority fee on top of the base fee in order to increase their chances of having their transaction added to the next block in the blockchain. This tip can vary from something as low as 1.5 GWEI to any infinite value. To avoid the tip fee from spiking too much, users can also specify the maximum fee that they are willing to spend. If this is not reached by the network the user, the transaction will be processed and the user will receive a refund equal to:

Refund = maximum fee — (base fee + priority tip)

Tracking gas prices on Ethereum

Gas fees fluctuate based on supply and demand for the computational power of the network. If there is a lot of congestion, you can expect higher gas fees and vice versa. There do tend to be certain times of the day or days of the week when gas prices average lower. Below is a chart showing gas price by time and day from ethereumprice.org.

Gas price by time of the day (July 2022)

Low gas fees would be considered anywhere from 0 to 30 GWEI, whereas higher gas prices would include base fees of 80+ GWEI.

Fun fact — In 2020, an unknown user or company paid 10,000 ETH, equivalent to $2.6 million at the time, in gas fees for one transaction to send 0.5 ETH.

Don’t believe it? Check it out on Etherscan. https://tinyurl.com/2p8bbxn8

Many defi users use gas trackers to monitor how gas is trending. For example, the DeFi Saver Gas Prices Extension can be added to Chrome so that you constantly see how the price is fluctuating. When you use one of these applications, you’re looking at how much the base fees are changing during that period in time. When there is lower supply or greater demand for the computational network, it will be more competitive to have your transaction validated and thus base fees can skyrocket.

View from DeFi Saver Chrome extension

Validators will give preference to transactions with a higher tip fee, and these tracking applications will tell you what tip fee is being selected at the time. You can also see whether this fee is trending up or down and the base fee history over the last day, week, or month.

How to set gas limits

So, why set gas limits for your transactions? Since the Ethereum network is turing complete, the network is susceptible to the halting problem. This means that there is no way of predicting whether a general piece of code will complete or be stuck in an infinite loop. Because of this, wallets set a maximum amount of gas that they are willing to spend for their transaction. This limit should be high enough that the transaction has enough gas to complete but not too high such that if the transaction finds itself in an infinite loop: the wallet’s ETH balance would then be completely drained as the transaction processes.

Editing gas properties in MetaMask

When submitting a transaction, you can typically adjust the gas limit, max priority fee, and max fee. The gas limit is the maximum computational units that the wallet is willing to use for the transaction — remember a standard transaction will typically be about 21,000 units. In the example above, we’ve set the max priority fee to 1.5 GWEI and the max fee (base fee + priority fee) to 90 GWEI. If the base fee required were to spike above 90 GWEI, the transaction would not be completed.

What’s important to understand about gas is that the gas will be spent when the attempted transaction is added to the next block regardless of whether the transaction runs into an error or successfully completes. Transactions will continue to be computed until one of three events occur: (1) the transaction is complete, (2) the maximum amount of gas used is reached (note that this is not the same as the maximum price in GWEI per gas), or (3) the transaction runs into an error and exits. Transactions cannot be submitted if the maximum amount of gas allowed multiplied by the gas price is greater than the total amount of ETH in the wallet.

The transaction fee after a transaction is completed is the price of gas multiplied by the amount of gas actually used in the transaction. But since it’s difficult to calculate exactly how many computational units or how much gas will be used in the transaction, it’s hard to predict the exact cost of a transaction.

Your gas feed included on Bebop

On Bebop, you will not encounter any unexpected network fees. These fees are already included in the trade being placed and they will not change for you once the transaction has been initiated. Further, our users have full transparency into how their quote is being calculated and can clearly see this in the trade breakdowns, as can be seen below.

Full transparency into what you pay on Bebop

Bebop uses private professional market makers to provide quotes to our users. This means that the quote you receive for your trade will contain both the price for the swap and the amount of gas that the liquidity provider (or “LP”) will pay for your transaction.

While the transaction is signed by the user of Bebop, the LP holds the wallet that submits the transaction to the network. The transaction is still trustless but, if the transaction were to fail, the entire transaction cost is paid for by the submitter — i.e. the liquidity provider. Unlike trading on many other DeFi platforms, this means that if a transaction were to fail, users on Bebop do not pay ANY transaction costs.

Of course, we aim for our users’ transactions to complete and do not anticipate them failing. But you can be assured that on Bebop, you will pay the price (including that of gas that you see) and that any unpredictable fees are alleviated.

Join the waitlist!

Try trading on a platform that’s transparent. Join our waitlist at bebop.xyz to get the chance to be one of the first whitelisted users to trade on the platform! Bebop will become available to the greater public during the course of summer 2022.

Stay tuned for announcements and surprises on Twitter and join our Discord to stay connected with the community.

Bebop. Make the most out of every exchange.

--

--

Kat Fore
Bebop — Seamless and efficient crypto trading for everyone

Product Manager @ Bebop — your gateway to better trades in Defi. Previously discovered crypto at Wintermute. Former management consultant with an MBA from LBS.