Skip to content

A uniswap simulator with a listener that arbitrages whenever there is a pool imbalance

Notifications You must be signed in to change notification settings

AdithyaNarayan/uniswap-arb-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Uniswap Arbitrage Simulator

To run the unit tests, run the following command

cargo test

To run an integration test, run the following command

cargo run

Design

Pools are designed as observables and notifies all listeners. This is done to simulate a bot listening for transactions in the Ethereum mempool. Whenever a swap is carried out, the run_arbitrage function runs and tries to arbitrage the price difference.

Arbitrage Logic

To derive the formula, the following constraints were used:

  1. The change in DAI in pool 1 and pool 2 must be the same
  2. k remains the same after a swap in each pool (almost)
  3. The ratio of tokens in each must be the same after the swap. If not, then more arbitrage opportunities can be found after the initial one

About

A uniswap simulator with a listener that arbitrages whenever there is a pool imbalance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages