How to Save Gas on Ethereum

Feb, 18 2021
4 Minutes

Right now, gas costs on Ethereum are absolutely stifling.

If a trade on Uniswap costs $50, most people are going to be priced out.

I hate paying for gas, but the upside of DeFi can be worth it. Here are some tips and tricks I use to save gas.

Tools used:

  • TxStreet - a tool to visualize the mempool and to inform an optimal gas price selection
  • GasNow - visualize recent gas prices over time
  • Gas Prices on Dune Analytics - a dashboard to get a sense for the relative prices of common operations
  • Gas Prices Firefox extension - Surveys GasNow, Etherscan, and Ethereum Gas Station to give you a good sense of the mempool at a glance
Tools of the trade to save on Ethereum Gas fees

How to Save on Gas

Tip 1: Wait

First, ask yourself -  can my transaction wait? For example, these transactions can always wait:

  • ERC-20 approvals
  • Staking and unstaking
  • Paying back a loan

In fact, most operations can wait.

It's pretty much time-sensitive trades where you should be willing to pay higher gas. This is usually when an asset is falling or rising rapidly in value.

But in my experience, those trades can often wait too.

Why? Because, if you're chasing an asset that is rapidly rising in price, and you're not willing to pay top dollar on gas, there's a very good chance you'll experience slippage. And if there's too much negative slippage, your transaction will get reverted. Reverted trades are terrible! Not only does the trade fail, but you also spend gas. Insult to injury.

So I like to trade when the price is relatively stable, and gas prices are low. Patience is often rewarded. On the other hand, I have missed the train on buying and selling opportunities here and there because I haven't been willing to pay gas, but such is life.

In DeFi, you can never catch 'em all.

Tip 2: Know when Gas is Cheap

How do you know if gas is cheap?

It's easy, you go to Gas Now, scroll down and look to see if the current gas range is in the red. If it's in the red, it's a bad time to trade:

Using the Gas Now chart to see if gas is cheap

I also use a browser extension (Firefox, Chrome) that shows me the current gas price. When I see a low gas price (which is informed by the GasNow chart above), I opportunistically do everything I need to on chain. The extension looks like this:

Gas browser extension

And finally, because the price of Ether is always changing, I like to refer to this Dune Analytics dashboard to get a quick sense for what gas might cost for a given operation:

Dune Analytics Gas Dashboard

Tip 3: Set your own Gas Price

New users to Metamask will often "take" the suggested gas price that Metamask offers. This is rarely optimal for gas savings.

Instead, you'll want to customize the gas price to something a little less aggressive. Here's how to do it:

  • When a transaction confirmation pops up, hit the small "Edit" button right above the gas price
  • Go to Advanced
  • Set your gas price
How to set your own gas price on metamask

How do you know what gas price to set?

Unfortunately, Etherscan, GasNow, and most sites don't tell you exactly what gas price to use. They give subjective "slow", "normal" and "fast" estimates, but in my experience, following those numbers can lead to a really bad experience.

In order to select a smart price, you need to know what everyone else is doing at this exact moment. Thankfully, there's a beautiful little tool that can help you - TxStreet:

What TxStreet looks like

TxStreet helps you see exactly what's going on.

Each transaction is a cartoon character trying to catch a bus. Each "block" is a bus, and you can skip the line to a higher priority bus if you pay higher gas. You can scroll down to see the distribution of gas prices by block.

Oftentimes, there will be a row of buses that are priced at something like 90 gwei. To skip all of those transactions, you can bid 91 or 92 gwei.

Sometimes, the price to get in the top "bus" is actually less than what Metamask is quoting.

TxStreet has helped me from overpaying on gas many times.

Conclusion

I hope this article helps with some useful tactics to save on gas, while still participating in some of DeFi's most intriguing opportunities.

Transacting on the Ethereum blockchain is expensive, but because all of the real innovation is happening on Ethereum, that's where you can be early to projects and get access to nice "multi-X" returns.

By the time they get listed on Binance, and eventually Coinbase, those who were willing to pay the on-chain gas fees have already front-run the opportunity.

It's a bit like how accredited investors get to front-run the rest of us in an IPO. The only difference is anyone can pay for on-chain gas. This is the beauty of permissionless, decentralized systems.

There are other ways to save gas, namely, using gas tokens which take advantage of a special EVM opcodes that actually refund gas. But these are difficult to use, and most people won't bother with them.

In the future, we might not need to worry about gas nearly as much, but for now, it's the price we must pay for decentralization. Just don't pay more than you need!

Good luck out there!