swapping fees

    Open analytics bounties are all about deep dive dashboards into one specific topic.

    Introduction

    A few days ago 93.5 USDC was transferred to my metamask wallet as a salary. I was about to swap USDCs to Ethereum on metamask swapping app.

    When I entered the amount and clicked verify I was surprised when I see the swapping fee was $12! I stopped trading and decided to transfer USDCs to a CEX and then trade into whatever tokens I wanted.

    After that day I decided to explore what is happening with ERC20 APPs.

    There are many swapping programs on ERC20.

    In this analysis, we will examine the complexity and price of each swapping program means gas_used and gas_price.

    🚨 Section 1: “Swapping Apps“

    Loading...
    Loading...
    Loading...
    Loading...
    Loading...

    ✅ Observations

    There is 57K origin “From addresses” for swapping.

    A number of swapping apps like Uniswap have many origin addresses. So the number of “Swapping Apps” is almost 57.3K. We will find bigger “Swapping Apps” to investigate.

    There are two aspects:

    First*: the number of USD transactions*

    Second*: the volume of USD transactions.*

    The above tables and donate charts show the biggest “Swapping Apps”.

    Based on the “Number of USD transactions“, “Augur“, “mevbot”, and “uniswap” are the top three “Swapping Apps“

    Based on the “Volume of USD transactions“, “mevbot”, “0x“, and “uniswap” are the top three “Swapping Apps“

    Some of the AMOUNT_USDs on ethereum.core.ez_dex_swaps are empty. So it seems that the “Number of USD transactions“ is a more accurate chart to find the biggest swapping APPs.

    Based on the “Number of USD transactions“, the top 10 “Swapping Apps” are:

    1. augur

    2. uni swap

    3. mev bot

    4. metamask

    5. 1 inch

    6. sushiswap

    7. 0x

    8. curve fi

    9. zapper fi

    10. balancer

      \

    These 10 "swapping apps" mostly consist of swapping on ERC20. ***We found the 10 best exchange programs. Now we will examine them in terms of complexity and price. ***

    As we mentioned in the introduction section, the gas_used shows the complexity, and gas_price shows the price.

    🚨 Section 2: The Averages

    Methodology

    To find the best swap APPs, we searched the dex_dwap table for sum(amount_in_USD) and count(*) group by origin_to_address.

    We can only find the gas fees in the fact_transaction table, so we had to merge the dex_swap table and the transactions table to find the gas fees. Thanks to the amazing speed of Ethereum tables.

    By contacting the platforms and joining the two tables dex_swap and fact_transaction, we can create the token pair fees for each platform.

    Four sections has been designed for this bounty:

    🚨 Section 1: “Swapping Apps“

    Number of "Swapping Apps" on ERC20

    The top 100 "Swapping Apps" based on USD volume

    The top 100 "Swapping Apps" based on the number of USD transactions

    🚨 Section 2: The Averages

    Averages

    Average transaction fee

    Average gas prices

    Average gas used

    🚨 Section 3: The most expensive & cheapest “Token in“

    The most expensive "token in"

    The cheapest "token in"

    The most expensive "token in" for "1 inch"

    The cheapest "token in" for "1 inch"

    The most expensive "token in" for "Uni swap"

    The cheapest "token in" for "Uni swap"

    pair fees

    Token pair "average transitions fee" by platforms 2

    Token pair "average transitions fee" by platforms

    🚨 Section 4: Time dependency of “Swapping fee“

    Average swapping fee based on days of week

    Average swapping fee for "1 inch" based on days of week

    Average swapping fee for "Uni swap" based on days of week

    Average swapping fee based on hours of days

    Average swapping fee for "1 inch" based on hours of days

    Average swapping fee for "Uni swap" based on hours of days

    Loading...
    Loading...
    Loading...
    Loading...

    ✅ Observations

    The above table and 4 graphs show the “Average gas used”, “Average gas fee”, and “Average transaction fee.”

    I thought that the metamask is an expensive APP for trading, but the result shows otherwise :))

    As we have already mentioned, the “Gas used” shows the complexity of the action.

    Based on the “Average gas used” chart, the “==curve fi==” used the simplest functions, and “==1_inch==” is the most complicated.

    Based on the “Average gas price” chart, the “==uni swap==” has the cheapest function, and “==curve fi==” has the most expensive function

    The transaction fee is equal to A*gas price*gas used, where A is a constant.

    Based on the “Average gas price” chart, the “uni swap” has the cheapest price with minimum “gas used” , so we see that “uni swap” has the cheapest transaction fee.

    Based on the “Average gas price” chart:

    1. uni swap

    2. balancer

    3. curve fi

      Are the cheapest “Swapping Apps‘

    In terms of the transaction fees, "uni swap" is the best choice and "1-inch" is the worst.

    The low transaction fee of "uni swap" is due to the low gas price and the high transaction fee of "1_inch" is due to the high complexity.

    🚨 Section 3: The most expensive & cheapest “Token in“

    I want to swap USDC to ETH. After reviewing the swap process, I saw that the exchange from 125 USDC costs a fee of $17.

    It was weird! and a spark formed in my head! I think it's maybe that each pair of token swapping in a single "swapping app" have a different fee!

    So I tried to investigate the "Fees" on "Swapping Apps".

    In scale on "token in" we found the most expensive and cheapest. they were shown below.

    The “swap fee” for some of the tokens was 0!

    we ignored them.

    Loading...
    Loading...

    ✅ Observations

    The charts above show that the probability of "token in" and "token out" can be the most important metric for fees and not platforms.

    Let's check this possibility on the cheapest and most expensive platforms means “uni swap” and “1 inch”

    Loading...
    Loading...
    Loading...

    ✅ Observations

    As you can see, the cheapest fee on the "1 inch" (==700u==) is more expensive than the "most expensive token in" the "uni swap".

    In general, the fees on the "1 inch" platform are significantly higher than on the "Uniswap".

    But now the question is: platform or token! What Determines "Swap Fees"?

    To answer the above question, let's choose an important pair of tokens.

    We chose the: Ethereum, USDC, USDT, MATIC, OP, AAVE

    Pairs are the "ETH_MATIC", "ETH_OP", "ETH_USDC", "ETH_USDT", "USDC_ETH", "USDT_ETH", "USDT_USDC", "AAVE_OP"

    We tried to find an swap that is "ETH_MATIC" but the result was nothing. We tried to find "Token in" when "Token out" is ETH and the result was just "WETH".

    select distinct(SYMBOL_out) from 
    ethereum.core.ez_dex_swaps
      WHERE
    SYMBOL_in='ETH'
    

    This means that ETH cannot be swapped for anything other than “WETH”.

    Loading...
    Loading...

    ✅ Observations

    Question: platforms or tokens? Which determines the exchange fee?!

    The above table and charts illustrate the answer to this question. Some platforms don't have pairs of token pairs.

    In "Token pain "average transactions fee" platform 2" we present the common token pairs on all platforms.

    Each color relates to a specific token pair, and the chart's x-axis is based on the "average total fee" of the token pairs.

    In this chart, we examine the token pairs that are common across all platforms and ignore others! For example, the "Curve fi" only has the "USDT_USDC" pairs. So let's ignore the "Total average fee" comparison on her!

    Other columns (platforms) all have token pairs, so we'll use them to explain our results.

    Based on the explanations above, the "Uni swap" has the minimum and the "1 inch" has the maximum in the "Total average fee". This fact has already been confirmed!

    In the "Token pain "average transactions fee" platform" we present the "Average transactions fee" for all token pairs, regardless of whether they are common or not.

    As you can see, the "Uni-Swap" has the lowest "Average Transaction Fee" of all token pairs.

    Although the "1 Inch" has the most expensive platform, if you examine more closely, it's clear this platform has a lower "Average Transaction Fee" for a few pairs of tokens!

    For example, the "Mev bot" has a bigger "Average Transaction Fee" rather than "1 inch" in the "USDT_USDC" pair token.

    By the way, the "uni-swap" has the lowest "average transaction fee" of all token pairs.

    Now we can answer the question!

    Platforms or tokens! Which one determined the swapping fee?! the result shows that only the “Swapping platform” is only determinative.

    There is one more point we found.

    Ethereum can only be swap into WETH and only WETH can be swapped into Ethereum. So, to swap other tokens in Ethereum, first swap the tokens in WETH and then in ETH and vice versa, because swapping ETH corresponds to two normal swap and the transactions also have more fees.

    Uniswap is the cheapest swapping app and 1_inch is the most expensive

    Loading...
    db_img

    Result and discussion:

    👉 “Augur“, “mevbot”, and “uniswap” are the top three “Swapping Apps“ in term of “Numbre of USD transactions“

    👉 “mevbot”, “0x“, and “uniswap” are the top three “Swapping Apps“ in term of “Volume of USD transactions“

    👉 The “curve fi” used the simplest functions, and “1_inch” is the most complicated platform.

    👉 The “uni swap” has the cheapest function, and “curve fi” has the most expensive function

    👉 The low transaction fee of "uni swap" is due to the low gas price and the high transaction fee of "1_inch" is due to the high complexity.

    👉 ETH cannot be swapped for anything other than “WETH”.

    👉 Platforms or tokens! Which one determined the swapping fee?! the result shows that only the “Swapping platform” is only determinative.

    👉 In general, the "Swapping fee" increases a little at the end of the week and decreases during the holidays.

    👉 All "Swapping platforms" have the same pattern and they have the cheapest "Swapping fee" in the first third of the day and the most expensive "Swapping fee" in the third third of the day.

    Loading...

    🚨 Section 4: Time dependency of “Swapping fee“

    I have had one more experience. I've always done my transactions on Sundays because I figured that was the cheapest. So I decided to visualize the "Swap fees" by day of the week.

    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...

    ✅ Observations

    In this section, the time dependence of the "Swapping fee" was examined.

    As you can see, we have visualized the "Swapping fee" across the days of the week and hours of the day

    It becomes clear that the "swapping fee" is lowest on Sunday and Saturday and highest on Wednesday.

    In general, the "Swapping fee" increases a little at the end of the week and decreases during the holidays.

    This seems to be the case for all "swapping platforms" because the "1 Inch" and "Uniswap" have the same pattern.

    The same applies to the daytime hours.

    All "Swapping platforms" have the same pattern and they have the cheapest "Swapping fee" in the first third of the day and the most expensive "Swapping fee" in the third third of the day.