Slick (Gas Option) is a hackathon project for ETH San Francisco 2018. It aims to solve the pain point of ETH gas price volatility for smart contract consumers by introducing a queue-like web service where you exchange time for gas cost for non-time sensitive transactions, as well as a marketplace for insurance (in the actual forms of futures and possibly American options) on gas price. Currently miners are incentivized to pick the transactions with high gas fees, but users especially DApp users and developers have no options. Existing ETH gas solutions like or relay solutions either abuses vulnerabilities in the gas cost system (storage refund) or does not target price fluctuation.

The inspiration of this project comes from the gas problem we encounter as DApp developers and as frequent users of the Ethereum network. Gas price spike due to a hit DApp can be a pain for the everyday users of the Ethereum network. In addition, it is a problem for DApp developers as it not only eats into investors' ROI for financial service DApps, but also causes fairness controversies (i.e. the outcome of FOMO3D). Moreover, if a DApp goes viral and becomes a hit, the gas spike can drive the DApp users away. The gas volatility issue creates a bottleneck for DApps and Ethereum's mass adoption, and this is where Slick (Gas Option) comes to play.

What it does

There are two key points for the solution:

  1. The user is able to submit multiple transactions with the same message, but each with different gas price and expiration time, to our service. Our service adopts a smoothing algorithm based on historical gas price to pick up the transaction with optimal price at the right time.
  2. The user is able to lock gas prices for future transactions (Futures) or buy insurance (American Options) for the gas price while submitting transactions to us to ensure the transactions go through within desired timeframe under desired gas price cap. These futures and option positions would be fully hedged in secondary markets (against natural counterparties such as ETH miners).

How we built it

Client Interface We created a simple wallet to serve as our client interface. On the page of submitting transactions, instead of inputting gas price, the user would be able to choose to use our service and send transactions to our web service. The user may specify a range of gas prices and expiration times. The method to submit a batch of same transactions with different gas prices should be abstracted out as a Web3 method which can be used by businesses that needs to process huge amount of transactions programmatically. For DApp developers, they are able to call our API to integrate the service.

Web Service The web service provides a set of REST APIs to support the application, including: • A POST service to accept a list of transactions with different gas prices. • A GET method to return the recent gas prices and recent transactions that are submitted to ETH network (with the corresponding gas prices). • A GET method to return the pending transactions. • A GET method to return the current price for a gas option.

Quantitative Calculation Engine The engine should be a routine that constantly monitors the gas prices and transactions pools, using which it picks the appropriate transaction to submit to ETH network. It implements a gas price prediction model based on quant finance algorithm. Additionally, the engine computes the price for the gas insurance (American Option), as Slick also acts as the market maker.

User Dashboard For a specific user, the dashboard shows a chart which compares gas prices between using and not using our service. The chart also shows that the gas price is smoothed. Some simulations might be necessary to show a reasonably long history. It also shows stats such as total ETH saved for using our service.

Gas Options To further assist users who are sensitive to potential high gas prices, we introduce options for the gas fee. When using Metamask or our modified web3 API to submit transactions, the user has the ability to buy options which caps the maximum possible fee before an expiration time. If the real gas fee is higher before the expiration time of the options (even with our Gas Fee Smoothing Service), the user will be able to get refunded for price difference between the executed gas fee and the options gas fee.

Challenges we ran into

The major challenges for gas fee options is that the gas fee itself is usually small, and exercise of the option via smart contract on ETH blockchain will cost extra gas fee, which defeats the purpose of service. The fundamental problem is the high-frequency micro-payment problem for ETH. ETH scaling is supposed to resolve the current limitations of TPS and gas fee. However, when ETH scaling is deployed in production, it must attract much more developers to build DApps on the network, leading to TPS and gas fee issue again. The same logic goes for the case that when a freeway expands from two lanes to four lanes, it’ll also attract more cars and encourage people to drive more, sometimes it attracts more than twice as many, leading to even worse traffic problem.

Accomplishments that we're proud of

We deployed Layer 2 solutions built by Celer Network to mitigate the gas fee. Leveraging Celer Network's conditional payment feature, we simulate a futures contract (due to the limitation of infrastructure, we hereby simplify the process by simulating a linear contract instead of nonlinear derivative in this hackathon) with discrete trigger thresholds. In this case, we act as a market maker for the future, and will hedge the risk of these futures positions against counterparties (likely miners) in the decentralized marketplace we hope to build beyond the scope of this hackathon.

What we learned

state channel (Celer) + ChainLink + financial engineering

What's next for SLICK (Gas Option)

Overall, we are trying to solve the issue of gas fee fluctuations for ETH users. This is a fundamental problem for ETH blockchain network, and will be lasting as a critical problem. We explored and prototyped solutions including centralized smoothing service, as well as options service on Layer 2. Next step, we hope to:

  1. Improve the UI/UX of the client interface into a sleek experience;
  2. Improve designs of the standalone gas option;
  3. Build the financial engineering engine;
  4. Build the decentralized exchange. Ultimately, we hope to bring to ETH foundation’s attention to a potential solution. We hope our explorations in this Hackathon could give ETH foundation some inspirations for Layer 1 solutions. For example, the options writer could be the miners or mining pool company.

Big thanks to the team, to the amazing hackers, sponsors and staff for all the help involved in the past 36 hours, and special tribute to the Carbo Clan and WEI!!!

Built With

Share this project: