This repository contains detailed gas comparison analysis of our latest products against our competitors. It aims to provide insights into the efficiency and performance differences, highlighting our technological advantages and areas for improvement.
To run the tests and check the results, please follow the steps below:
First, you need to set up the necessary environment variables. Create a .env
file in the root directory of the repository and specify the following variables:
# .env file
MAINNET_RPC_URL=your_mainnet_rpc_url_here
Replace your_mainnet_rpc_url_here
with your actual Mainnet RPC URL.
After setting up your environment variables, you can run the tests using Yarn. Execute the following commands in your terminal:
# Install dependencies
yarn
# Run tests
yarn test:ci
These commands will first install the necessary dependencies and then execute the tests defined in your project. Ensure you have Yarn installed on your system. If not, you can install it by following the instructions on the Yarn documentation.
This section presents detailed gas usage data for various swapping scenarios across different protocols. The tables below compare the amount of gas used for each type of transaction to highlight efficiency across platforms. Each entry denotes the gas used for a swap under the same conditions.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Fusion β
βββββββββββββββββββββββββββββββββββββββββββββ¬ββββββββββ¬ββββββββββββββββββββ¬ββββββββββββββββββββ€
β case β 1inch β uniswap β cowswap β
βββββββββββββββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββ¬ββββββββββΌββββββββββ¬ββββββββββ€
β WETH => DAI w/o callback by EOA β 116,226 β 128,157 β +10.27% β 131,704 β +13.32% β
βββββββββββββββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
β WETH => DAI w/o callback by contract β 116,586 β 128,618 β +10.32% β 135,778 β +16.46% β
βββββββββββββββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
β WETH => DAI with callback, resolver funds β 120,779 β 132,866 β +10.01% β 140,917 β +16.67% β
βββββββββββββββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
β WETH => DAI with callback, taker funds β 137,624 β 146,425 β +6.39% β 154,575 β +12.32% β
βββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Limit Orders β
βββββββββββββββ¬ββββββββββ¬ββββββββββββββββββββ¬ββββββββββββββββββββ¬ββββββββββββββββββββ€
β case β 1inch β uniswap β 0x β paraswap β
βββββββββββββββΌββββββββββΌββββββββββ¬ββββββββββΌββββββββββββββββββββ΄ββββββββββββββββββββ€
β ETH => DAI β 90,345 β 113,519 β +25.65% β β
βββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ¬ββββββββββ¬ββββββββββ¬ββββββββββ€
β WETH => DAI β 102,560 β 111,033 β +8.26% β 113,389 β +10.56% β 153,693 β +49.86% β
βββββββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β UniswapV2 pools β
βββββββββββββββββββββββββββββββ¬ββββββββββ¬βββββββββββββββββββ¬ββββββββββββββββββββ¬ββββββββββββββββββββ¬βββββββββββββββββββ¬ββββββββββββββββββββ€
β path β 1inch β 0x β 0x settler β uniswap_universal β uniswap_v2 β paraswap β
βββββββββββββββββββββββββββββββΌββββββββββΌββββββββββ¬βββββββββΌββββββββββ¬ββββββββββΌββββββββββ¬ββββββββββΌββββββββββ¬βββββββββΌββββββββββ¬ββββββββββ€
β ETH => DAI β 88,124 β 92,367 β +4.81% β 93,032 β +5.57% β 99,047 β +12.40% β 91,558 β +3.90% β 98,107 β +11.33% β
βββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌβββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌβββββββββΌββββββββββΌββββββββββ€
β ETH => USDC => DAI β 140,942 β 146,011 β +3.60% β 149,932 β +6.38% β 155,271 β +10.17% β 148,765 β +5.55% β 151,554 β +7.53% β
βββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌβββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌβββββββββΌββββββββββΌββββββββββ€
β DAI => ETH β 102,491 β 105,997 β +3.42% β 113,862 β +11.09% β 109,785 β +7.12% β 106,208 β +3.63% β 105,961 β +3.39% β
βββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌβββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌβββββββββΌββββββββββΌββββββββββ€
β DAI => WETH β 88,887 β 92,589 β +4.16% β 94,966 β +6.84% β 105,257 β +18.42% β 92,009 β +3.51% β 97,584 β +9.78% β
βββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌβββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌβββββββββΌββββββββββΌββββββββββ€
β DAI => WETH => USDC β 141,674 β 145,428 β +2.65% β 150,312 β +6.10% β 162,220 β +14.50% β 148,412 β +4.76% β 153,185 β +8.12% β
βββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌβββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌβββββββββΌββββββββββΌββββββββββ€
β DAI => WETH => USDC => USDT β 195,778 β 199,595 β +1.95% β 207,769 β +6.12% β 219,042 β +11.88% β 206,069 β +5.26% β 208,460 β +6.48% β
βββββββββββββββββββββββββββββββ΄ββββββββββ΄ββββββββββ΄βββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ΄βββββββββ΄ββββββββββ΄ββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β UniswapV3 pools β
βββββββββββββββββββββββββββββββ¬ββββββββββ¬βββββββββββββββββββ¬ββββββββββββββββββββ¬ββββββββββββββββββββ¬βββββββββββββββββββ¬βββββββββββββββββββ€
β path β 1inch β 0x β 0x settler β uniswap_universal β uniswap_v3 β paraswap β
βββββββββββββββββββββββββββββββΌββββββββββΌββββββββββ¬βββββββββΌββββββββββ¬ββββββββββΌββββββββββ¬ββββββββββΌββββββββββ¬βββββββββΌββββββββββ¬βββββββββ€
β ETH => DAI β 100,423 β 109,052 β +8.59% β 107,778 β +7.32% β 107,116 β +6.66% β 104,204 β +3.77% β 110,109 β +9.65% β
βββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌβββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌβββββββββΌββββββββββΌβββββββββ€
β ETH => USDC => DAI β 174,718 β 185,033 β +5.90% β 179,458 β +2.71% β 182,834 β +4.65% β 184,657 β +5.69% β 184,530 β +5.62% β
βββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌβββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌβββββββββΌββββββββββΌβββββββββ€
β DAI => ETH β 117,402 β 123,785 β +5.44% β 132,575 β +12.92% β 119,562 β +1.84% β 125,424 β +6.83% β 119,024 β +1.38% β
βββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌβββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌβββββββββΌββββββββββΌβββββββββ€
β DAI => WETH β 103,810 β 110,068 β +6.03% β 122,499 β +18.00% β 115,034 β +10.81% β 105,566 β +1.69% β 110,614 β +6.55% β
βββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌβββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌβββββββββΌββββββββββΌβββββββββ€
β DAI => WETH => USDC β 174,341 β 182,170 β +4.49% β 191,530 β +9.86% β 186,872 β +7.19% β 182,155 β +4.48% β 183,309 β +5.14% β
βββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌβββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌβββββββββΌββββββββββΌβββββββββ€
β DAI => WETH => USDC => USDT β 248,560 β 257,801 β +3.72% β 266,088 β +7.05% β 262,214 β +5.49% β 261,749 β +5.31% β 259,158 β +4.26% β
βββββββββββββββββββββββββββββββ΄ββββββββββ΄ββββββββββ΄βββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ΄βββββββββ΄ββββββββββ΄βββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Mixed pools β
βββββββββββββββββββββββββββββββββββββββ¬ββββββββββ¬ββββββββββββββββββββ¬ββββββββββββββββββββ€
β path β 1inch β 0x settler β uniswap β
βββββββββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββ¬ββββββββββΌββββββββββ¬ββββββββββ€
β ETH =(uniV2)=> DAI =(uniV3)=> USDC β 158,572 β 166,693 β +5.12% β 175,849 β +10.90% β
βββββββββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
β ETH =(uniV3)=> DAI =(uniV2)=> USDC β 153,171 β 163,216 β +6.56% β 169,331 β +10.55% β
βββββββββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
β DAI =(uniV2)=> WETH =(uniV3)=> USDC β 159,442 β 174,759 β +9.61% β 180,637 β +13.29% β
βββββββββββββββββββββββββββββββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββ€
β DAI =(uniV3)=> WETH =(uniV2)=> USDC β 156,582 β 174,644 β +11.54% β 177,145 β +13.13% β
βββββββββββββββββββββββββββββββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββ
β UniswapV2 pools (Permit2) β
βββββββββββββββββββββββββββββββ¬βββββββββββββ€
β path β 0x settler β
βββββββββββββββββββββββββββββββΌβββββββββββββ€
β DAI => ETH β 144,125 β
βββββββββββββββββββββββββββββββΌβββββββββββββ€
β DAI => WETH β 125,304 β
βββββββββββββββββββββββββββββββΌβββββββββββββ€
β DAI => WETH => USDC β 180,594 β
βββββββββββββββββββββββββββββββΌβββββββββββββ€
β DAI => WETH => USDC => USDT β 237,948 β
βββββββββββββββββββββββββββββββ΄βββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββ
β UniswapV3 pools (Permit2) β
βββββββββββββββββββββββββββββββ¬βββββββββββββ€
β path β 0x settler β
βββββββββββββββββββββββββββββββΌβββββββββββββ€
β DAI => ETH β 158,140 β
βββββββββββββββββββββββββββββββΌβββββββββββββ€
β DAI => WETH β 148,102 β
βββββββββββββββββββββββββββββββΌβββββββββββββ€
β DAI => WETH => USDC β 234,227 β
βββββββββββββββββββββββββββββββΌβββββββββββββ€
β DAI => WETH => USDC => USDT β 308,797 β
βββββββββββββββββββββββββββββββ΄βββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Mixed pools (Permit2) β
βββββββββββββββββββββββββββββββββββββββ¬βββββββββββββ€
β path β 0x settler β
βββββββββββββββββββββββββββββββββββββββΌβββββββββββββ€
β DAI =(uniV2)=> WETH =(uniV3)=> USDC β 200,213 β
βββββββββββββββββββββββββββββββββββββββΌβββββββββββββ€
β DAI =(uniV3)=> WETH =(uniV2)=> USDC β 200,086 β
βββββββββββββββββββββββββββββββββββββββ΄βββββββββββββ
We warmly welcome the contribution of additional comparison cases. By sharing different scenarios and use cases, teams can identify specific areas for potential improvements in their protocols. If you have encountered a scenario where you believe there is room for optimization or enhancement, please consider contributing by:
- Forking the repository.
- Adding your case to the designated section/file with a clear description of the scenario and why it presents an opportunity for improvement.
- Creating a pull request with a concise but informative title and description.
Your contributions will not only help improve the protocols but also provide valuable insights for the community on where there are opportunities for enhancement.
Thank you for helping us and the community identify opportunities for improvement and optimization.