Reimplement Simple Arbitrage in Rust

January 8, 2022 ยท View on GitHub

Example

  • simple-arbitrage
  • yield-liquidator

Stack

  • foundry
  • ethers.rs

Arbitrage Logic

  1. Find TKN/ETH pairs that exist in several Dexes.

  2. Update those pairs reserve using getReserve from UniswapFlashQuery.sol

  3. store reserve in Reserve struct WETH should always be reserve1

  4. calculated buy_price and sell_price

Contents

  1. 1Example
  2. 2Stack
  3. 3Arbitrage Logic