Taming Gas Fees with Hedgehog — Hedging Use Cases for Smart Wallets and Layer 2 Solutions

Hedgehog Protocol
Hedgehog Protocol
Published in
10 min readMar 1, 2024

Ethereum has undoubtedly become the pillar of development of decentralized applications (dApps), thanks to its dedicated community of builders. Yet, both users and developers still face a fair share of challenges — from scalability bottlenecks to unpredictable gas fees and sometimes a disorienting user experience.

In response to these challenges, smart wallets and Layer 2 solutions have emerged. They’re stepping up to tackle these issues, aiming to make the blockchain ecosystem more user-friendly, scalable, and flexible.

This article aims to present these two solutions and showcase a use case where Hedgehog creates a market for L2s rollups to hedge gas fees, showcasing their potential savings using gas derivatives.

Before we start, let’s briefly define what Smart Wallets and Layer 2 solutions are.

Smart Wallets

Smart contract wallets, a sophisticated evolution of traditional cryptocurrency wallets, leverage smart contracts to offer enhanced security features, improved user experience, and seamless integration with dApps.

The main benefit of these wallets lies in their programmability, allowing for customizable security protocols and automated management of assets. This flexibility not only enhances the user experience by simplifying interactions with the blockchain but also opens up new avenues for managing digital identities and assets securely and efficiently.

Rollups: Scaling Ethereum with Layer 2 Solutions

Rollups have emerged as a promising solution to Ethereum’s scalability issues, offering a way to increase transaction throughput without sacrificing security or decentralization. By processing transactions off-chain and then rolling them up into a single transaction to reach finality on the Ethereum blockchain, rollups significantly reduce the burden on the network, resulting in faster transaction times and substantially lower gas fees.

There are two main types of rollups: Optimistic Rollups and Zero-Knowledge (ZK) Rollups. Optimistic Rollups assume transactions are valid by default and only run computations in case of a dispute. At the same time, ZK Rollups provide cryptographic proof of validity for each transaction, allowing for immediate finality without the need for disputes. Both types (which can also have several design differences between each) offer their unique advantages in terms of efficiency, security, and cost-effectiveness.

Gas fees present a bottleneck for both rollups and smart wallets, limiting their adoption and efficiency. The volatility of gas fees complicates transactions and development within the Ethereum ecosystem, posing challenges in maintaining cost-effectiveness. In the following section, we explore how rollups and smart wallets address this issue, aiming to mitigate the impact of fluctuating gas costs.

The Challenge of Gas Fees

Gas fees — the cost of executing transactions on the Ethereum network — can be a double-edged sword. While they compensate validators for the computational resources used, their volatility and unpredictability can significantly impact the user experience and the overall cost of transactions. High gas fees can deter users from participating in the ecosystem, especially during periods of network congestion, and constitute a considerable challenge for developers aiming to create cost-effective and accessible dApps.

Chart 1 illustrates the magnitude of this challenge. Users and developers are incurring an average of $10 Million in gas costs every day. This has been consistently growing in the past weeks, but overall, cost growth is not only affected by adoption, but random events could also affect it for several weeks.

Chart 1: Gas Fees daily costs in dollars.

The unpredictability of gas fees can be seen in Chart 2. It shows the daily median gas prices in Gwei. It illustrates how volatile gas can be and how costly it can get for extended periods. The orange bar showcases a supposed scenario where gas prices are fixed at 20 Gwei. It is a contrast that catches our attention.

Chart 2: Daily Gas Prices — 1 year.

Even though daily data looks problematic already, it doesn’t paint the whole picture. Gas prices are extremely volatile. The more granular the data, the more the volatility problem becomes evident. Chart 3 plots the same data, querying the median gas price on an hourly basis.

Chart 2: Hourly Gas Prices — 1 year.

Smart contract wallets and rollups directly confront these challenges. Smart wallets can automate gas management using strategies such as gas token utilization or dynamic fee adjustments based on network conditions. Conversely, Rollups offer a pathway to more sustainable gas fees by minimizing the data stored on-chain and optimizing transaction processing.

Costs

Despite the strides made by Layer 2 solutions in addressing Ethereum’s scalability issues, they are not immune to the challenges of mainnet’s gas fee volatility. While significantly reducing the load on the main Ethereum chain by processing transactions off-chain, they must still interact with the mainnet to publish transaction data or validity proofs to achieve finality.

This necessary step ensures the security and decentralization of transactions processed via rollups but comes at a cost. The gas fees required for these operations can be substantial, especially during periods of high network congestion and volatility in gas prices. This volatility substantially affects the operational costs for maintaining these rollups. The unpredictable nature of these costs poses a significant challenge to the economic viability of Layer 2 solutions.

With that in mind, we have created Chart 4, depicting the aggregated daily gas fee costs of several L2s on the Ethereum mainnet. Combined, these rollups spend a small fortune every day to reach finality, an average of $1.5 million/day in the past week.

Chart 4: Daily L2s Gas Expenses on Ethereum Mainnet.

To illustrate L2’s growth: on Feb 27th, Arbitrum spent nearly $500k on gas fees, and Optimism spent almost $400k. Both were the only solutions in the market six months ago; now, they don’t even represent half of the L2s spent on L1.

At the same time, L2s have been increasing the number of transactions running through them, increasing the throughput of the Ethereum ecosystem; collectively, they have been consistently growing their share of Mainnet’s daily gas fee consumption.

Chart 5: L2s gas expenses share on Ethereum mainnet.

It went from about 3% a year ago with only Arbitrum and Optimism to over 11% daily. At the height of inscriptions launch on EVM’s in December 2023 it reached over 40% of all gas fees on Mainnet.

Smart contract wallets, on the other hand, offer a nuanced approach to managing these challenges through advanced features and programmability. However, they, too, suffer from gas fee volatility, which can significantly impact the cost-efficiency of executing complex operations, such as automated transactions and multi-signature approvals.

The advantages of utilizing smart wallets (and account abstraction in general) are particularly noticeable on L2s, where the costs associated with call data significantly contribute to over 95% of the overall transaction fees. These methods aim to minimize the call data size at the expense of increasing the computational requirements for processing transactions on the blockchain. This trade-off is more economically viable on L2s due to the lower computation cost than Mainnet.

However, the increased computational demands, combined with the volatility of the Ethereum mainnet, have hindered the widespread adoption and realization of smart wallets’ full capabilities on the Ethereum mainnet.

Table 1: Number of AA users by chain.

It seems paradoxical, but the very programmable nature of these wallets presents a unique opportunity to mitigate such volatility and costs through gas fee hedging strategies.

Hedgehog offers precisely that solution. It allows for smart wallets to integrate dynamic fee adjustment algorithms that respond in real-time to changes in network congestion; this way, smart contract wallets could offer users a more predictable and efficient cost structure.

This not only enhances the user experience by providing more stable transaction costs but also ensures that smart contract wallets’ advanced security and functionality features remain accessible to a broader audience, further democratizing access to the Ethereum ecosystem.

Hedgehog: Hedging Gas Fees

Hedgehog was born as an infrastructure solution designed to address the precise volatility and unpredictability of gas fees on the Ethereum network. As described throughout this article, it is clearly a critical challenge that affects both individual users and developers.

By introducing the concept of Modular Synthetic Blockspace, Hedgehog simplifies the process of gas hedging, providing a strategic tool to mitigate the impact of gas price fluctuations. This approach is grounded in the creation of a synthetic asset — the baseFee token — allowing for more flexible and real-time management of gas fees.

As we’ve seen in Chart 3, the more granular the data, the clearer we see the volatility problem. To reduce this problem in the baseFee token, Hedgehog introduces it as a 50-block moving average, reducing volatility spikes and creating a better trading environment, which is described in Chart 6.

Chart 6: baseFee vs 50-block moving average baseFee.

The protocol is designed to be user-friendly, abstracting all the complexities associated with blockspace that often require a deep understanding of Ethereum’s infrastructure. Instead, Hedgehog offers a free market approach, enabling users to mint baseFee tokens, which are a Collateralized Debt Position (CDP) mechanism inspired by the Liquidity’s CDP design.

This design integrates aspects that facilitate arbitrage and employs an Automated Market Maker (AMM) with dynamic fees to attract liquidity. At the same time, the CDP encourages market convergence with the actual gas price by allowing participants to act on arbitrage opportunities themselves. It eliminates the need for an external validator, enhancing the market’s efficiency and responsiveness to price signals.

This adaptability is crucial for entities across the Ethereum ecosystem, from Layer 2 rollups bearing substantial gas costs for data publication to smart contract wallets seeking more predictable operational expenses. By leveraging synthetic blockspace, these players can hedge against cost surges due to network congestion, securing more stable transaction costs.

L2 Hedging Use Case Exercise

As an exercise and to illustrate the power of Hedgehog, we’ve prepared an interactive model to showcase the potential of Hedgehog and how much of an impact it could have on L2 net expenses on finality.

Suppose an L2 player wants to hedge their gas costs using Hedgehog to keep their net expenses price at 15 Gwei. For this, they create a strategy where when gas prices are above 50 Gwei, they mint the baseFee CDP and then immediately sell them at the market. When gas fees fall below 15 Gwei, they buy again and close the trove.

For simplicity, they also consider the Max Gwei price of the last 30 days on their risk strategy and add enough collateral so that they are not liquidated if gas prices reach the same level.

Chart 7: L2s hedging gas fee strategy.

Chart 7 shows actual historic baseFee data; we use the 50-block moving average, like the described baseFee token. In this model, we’re using Aribitrum as an example, using its real data for the past 30 days. We can see the top limit where CDPs are minted and the bottom limit where baseFee is bought back and the trove is closed. Using this strategy, Arbitrum would have had 4 opportunities to execute successful trades.

We also suppose that Arbitrum is trading enough ETH to cover last month’s gas expenses, and with its profits having an average of 15 Gwei, this way, trading four times 125.13 ETH per trade, they would need 2,082.68 ETH as collateral.

In the case of Arbitrum, they spent 2,787.02 ETH on gas last month. By repeating the strategy trade four times successfully, they could have saved 1,668.46 ETH last month by hedging with Hedgehog.

Considering all L2s in the model, the savings could have been 7,242.40 ETH last month, using 9,040.40 ETH as collateral, considering four successful 543.18 ETH trades.

Of course, this entire narrative may seem like a stretch; it doesn’t even consider the dynamic fees, but the point was to simplify the exercise as much as possible and show this market’s potential for these players. With that in mind, we have made this little model public so you can tweak the inputs and choose which L2 you want to investigate.

https://dune.com/p_dot/gas-fees#l2s-model

Conclusion

This article sheds light on the complexities of gas fees on the Ethereum Mainnet, spotlighting smart contract wallets and Layer 2 rollups. The introduction of Hedgehog and its Modular Synthetic Blockspace infrastructure stands as a beacon of progress, offering a robust alternative to gas fees’ fluctuating and unpredictable nature. This advancement enriches the Ethereum ecosystem, enhancing user experience and paving the way for broader adoption by providing a more predictable and manageable framework for transaction costs.

Moreover, the ingenuity behind Hedgehog, borrowing and further adapting proven frameworks like Liquity’s CDPs, showcases a unique approach to creating a free gas fees market. This solution addresses the immediate hurdles of gas fee costs and volatility. By stabilizing transaction costs according to any user’s or protocol’s specific needs, Hedgehog allows them to gain exposure to the very market that most affects blockchain initiatives.

And this is just the beginning. Hedgehog’s modular design opens the door to a multitude of hedging possibilities tailored to the specific needs of the blockchain community. Hedgehog not only addresses the immediate issue of gas fee volatility but also sets the stage for broader applications of synthetic assets like Bitcoin fees and Eigen rates, for example.

About Hedgehog Protocol

Synthetic Blockspace. Trade BaseFee and hedge your gas costs ⛽️ Derivatives markets for degens, rollups, and account abstraction 🦔

Come chat with us!

Twitter: https://twitter.com/TheHedgehog_io

Telegram Chat: https://t.me/thehedgehog_io

Telegram News: https://t.me/thehedgehog_news

Website: https://www.thehedgehog.io

--

--

Hedgehog Protocol
Hedgehog Protocol

Synthetic Blockspace. Trade BaseFee and hedge your gas costs ⛽️ Derivatives markets for degens, rollups and account abstraction 🦔 https://thehedgehog.io