What You Need to Know About Gas Fees and Slippage
Table of Links
Abstract and 1. Introduction
-
Background
2.1 Layer-2 Blockchains
2.2 Project Mariana
-
Related Work and Contribution
-
System Architecture
-
Model
5.1 Automated Market Makers
5.2 Price Impact
-
Simulation
6.1 Data and Parameters
6.2 Results
-
Discussion
-
Conclusions, Acknowledgements, and References
Graphs and Tables
5 Model
The major metric to consider for evaluation of the cross-border CBDCs exchange is the cost of the CBDCs swap. In general, the total cost of DeFi service consists of three components: [31], [19]
TotalCost = GasFee + DeFiExplicitFee + DeFiImplicitFee
Gas Fees are paid to the blockchain operators for executing the transaction. In the case of transactions on roll-ups, the gas fee is comprised of both the L1 and L2 gas fee components.
DeFi Explicit Fee is charged by the DeFi protocol for the provided service. In the case of token swap at AMM-DEX, the liquidity pool fee (LP Fee) is the explicit fee charged by the DEX, and part of it (or whole) is distributed to the liquidity providers (LPs) to the pool.
DeFi Implicit Fee are indirect fees specific to the design of the DeFi protocol. Price impact and slippage are implicit fees accrued by a trader when swapping tokens at AMM [31], [19] and refer to the difference between quoted and executed price by the AMM. Price impact is caused by the transaction volume and slippage (positive or negative) results from other swaps occurring within the same block as the transaction swap.
Further the following model for the total cost of swap is considered:
TotalSwapCost = GasFee + LPFee + PriceImpact
LP Fee is typically the percentage of the transaction volume, and liquidity providers supply capital to the AMM’s liquidity pools in exchange for participation in LP fees. Price impact is the change in exchange price caused by the transaction volume and is specific to the AMM type and the liquidity pool size. The next section presents the major AMM types and corresponding price impact calculation methods.
5.1 Automated Market Makers
Constant Product with Concentrated Liquidity Market Maker (CLMM) – Uniswap v3
Stableswap Invariant – Curve v1
Cryptoswap Invariant – Curve v2 As in equation (4), but with K defined as
5.2 Price Impact
Authors:
(1) Krzysztof Gogol, University of Zurich ([email protected]);
(2) Johnnatan Messias, Matter Labs;
(3) Malte Schlosser, University of Zurich;
(4) Benjamin Kraner, University of Zurich;
(5) Claudio Tessone, University of Zurich.