Part 1 — Gas Fees and KyberSwap

Krystal Wallet
KyberSwap
Published in
5 min readAug 17, 2020

Welcome to Part 1 of our ‘KyberSwap: Combating Gas Fees’ series! Here we explain “Gas” consumption on the Ethereum network, and address the many misconceptions around it. In the next blog post, we will explore how to reduce gas costs on KyberSwap!

Let’s start with the fundamental question — What is GAS?

What is Gas and why is it needed on Ethereum?

Gas refers to the cost necessary to perform a transaction on the Ethereum network. Gas prices are denoted in gwei, which are worth 0.000000001 ether. At the rate of 1 ETH = 400 USD, 1 gwei is approx 0.0000004 USD.

Here’s a simple analogy. Imagine you go for a 300km long road trip. All car trips need petrol, and you’re driving a car that has a mileage of 10km per liter. This trip will usually consume a total of 30 liters of petrol; but to prepare for unforeseen circumstances during the journey, you fill the tank with 50 liters of petrol before you start. However, you know you will probably consume less than 50 liters.

Assuming the cost of 1 liter of petrol is 2 USD:

  • Estimated cost of trip = Total qty x cost per liter = 50 x 2 = 100 USD
  • Actual cost of trip = Total qty x cost per liter = 30 x 2 = 60 USD (much less than estimated)

Similar to how a car trip needs petrol, on Ethereum, every transaction needs gas. Every Ethereum transaction has an estimated and actual gas requirement (estimated and actual petrol used) and a gas price (petrol price).

The final, actual gas cost is often much less than the initial estimated cost shown on KyberSwap.

FACT #1 — The actual cost of the transaction is generally lower than the estimated cost

Just like in the example of a road trip, you may end up using only 30/50 liters of petrol. In Ethereum, you are only charged for what you use, not what you initially estimated. Let’s look at the below transaction:

Ref : Etherscan

Here initial estimation for the transaction was 674,639. Gas price at the time of transaction was 128 Gwei

Calculating Ethereum Gas Fees

Estimated cost of transaction

= Total gas requirement x gas price

= 674,639 x 128 = 86,353,792 Gwei

= 32.87 USD (86,353,792 x 380.55 x 0.000000001 USD)

Actual cost of transaction

= Total gas used x gas price

= 466,467 x 128 = 59,707,776 Gwei

= 22.72 USD (59,707,776 x 380.55 x 0.000000001 USD)

Actual transaction cost is 30% lower than estimated cost! In some cases, it can even be 70% lower than estimated. At KyberSwap, when you are prompted with this pop-up:

This is an estimated cost of transaction. Actual cost (in most cases) will be much less than estimated cost.

Overall transaction cost in USD depends on 3 key variables

  1. ETH spot price
  2. Gas price in Gwei
  3. Gas Limit for transaction

FACT #2 — Gas price and fee are NOT set by KyberSwap

The Gas fee is not decided by KyberSwap, but by Ethereum miners. Generally, the more used and congested the Ethereum network is, the higher the overall Gas prices. If a user increases the gas price used for the transaction, the faster it executes, since miners will prioritize transactions that provide higher ETH fees.

ETH gas station info is used by KyberSwap to check real time gas prices. Prices at the time of writing are:

FACT #3 — Gas fee is NOT paid to KyberSwap

The transaction Gas fee is not paid to KyberSwap. It is paid to miners to facilitate transactions on the Ethereum blockchain. Generally, the higher the Gas price used, the faster your transaction executes. KyberSwap lets you decide among 4 level of gas fees:

  1. SUPER FAST
  2. FAST
  3. STANDARD
  4. SLOW

What is the KyberSwap team working on to reduce gas consumption?

KyberSwap cannot control gas prices as it depends upon network congestion, but we are already doing heavy research and exploring ways to reduce the total gas requirement for the token swaps.

Our research is looking at several possibilities:

  1. In periods of network congestion, find the best reserve off-chain first before using reserve routing to reduce gas consumption
  2. Use gas token at user’s wallet level to get gas refunds during swap transaction
  3. Use gas token at smart contract level (instead of user’s wallet) to get gas refund during swap transaction
  4. L2 solutions (at a very early research phase)
  5. All or a combination of the above

Key considerations when choosing a solution:

  1. User experience — no extra steps to swap tokens
  2. Scalability — solution should be able to handle the massive scale of KyberSwap, so gas savings should be available to every user rather than just a few.
  3. Best Rates — get the best possible rates for users.

In the next few weeks, we will release more details about the solutions we intend to implement! Read Part 2 — Using Reserve Routing to Reduce Gas Fees.

Other Information

👉🏻KyberSwap Support Helpdesk

👉🏻Why KyberSwap?

👉🏻KyberSwap Official Telegram

👉🏻Get started on Ethereum with KyberSwap

👉🏻Tips for trading on KyberSwap

👉🏻Follow KyberSwap Twitter Announcements

👉🏻Download KyberSwap Android App

👉🏻Download KyberSwap iOS App

👉🏻Website: KyberSwap.com

--

--