Giter VIP home page Giter VIP logo

cycle-arb-analysis's Introduction

Uniswap Cycle Arbitrage Analysis

.
├── abi // smart contract ABI file
├── data // output data
├── go-ethereum // modified go-ethereum 
├── reports // data analysis results
├── template // latex figure templates
├── test // test scripts
├── uniswap-v2-py // uniswap v2 python client
└── utils // helper scripts
  • Go-ethereum: this is a modified go-ethereum client allowing us to export all transactions and receipts related to uniswap/sushiswap, the output is a 22959997 line file, each line contains a transaction and the corresponding receipt, key modifications:
    • go-ethereum/core/blockchain.go: start from line 792, function ExportReceiptsN
    • go-ethereum/core/transaction.go: start from line 49, Txdata structure
  • Key Python scripts:
    • get_all_pairs_thegraph.py: get all uniswap pairs via TheGraph API
    • get_all_cycle_arbs.py: identify and extract all successful cyclic arbitrages
    • count_cycles.py: count the cycle lengths
    • get_start_token_stats.py: count the start tokens for cyclic arbitrages
    • get_daily_revenue.py: get daily revenue of all cyclic arbitrages
    • get_gas_trend.py: get daily gas cost for cyclic arbitrages
    • get_profit_rev_dist.py: get profit/revenue distribution for cyclic arbitrages
    • get_bot_stats.py: get stats of cyclic arbitrage contracts
    • get_tx_list.py: get all transactions related to those arbitrage contracts we identified, including the UniswapV2Router contract
    • get_failed_stats.py: get stats of failed cyclic arbitrages excluding those initiated from the UniswapV2Router contract
    • get_failed_router_stats.py: get stats of all failed cyclic arbitrage transactions initiated from the UniswapV2Router contract
    • get_top10bot_daily_revenue.py: get the daily revenue stats of the top 10 bots in terms of total revenue
    • get_blockwise_stats.py: get blockwise reserves info of all uniswap pairs
    • get_toppair_blockwise_reserves.py: get the blockwise reserves of those pairs in the top 10 arbitrage path
    • draw_xxx.py: draw the analysis results with python matplotlib
    • tex_xxx.py: draw the analysis results with Latex templates

cycle-arb-analysis's People

Contributors

ccyanxyz avatar yeyehhxx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.