Giter Site home page Giter Site logo

uniswapv3_arbitrage's Introduction

WARNING

Work in progress. This is not a final version. I am still working on it.

Arbitrage Trading Bot UNISWAPV3

This is a simple arbitrage trading bot for Uniswap V3. I have created this bot to learn about Uniswap V3 and arbitrage trading. This bot is not a financial advice. Use it at your own risk.

How it works

  • Arbitrers directory, contains bot for each pool. You can create a new bot for a new pool.
  • This bots need a json, with the pool information
  • The bot will check the spot price of the tokens in the pool using slot0 function of the pool
  • If the spot price is different from the price in the pool, the bot will make a trade calling the contract located in the contracts directory
Advices
  • Cause now only check the spot price, we cannot predict the slippage of our own trade, so be careful
  • Actually the contract is a example u can find in: https://solidity-by-example.org/defi/uniswap-v3-flash-swap/
  • The contract is only a example, i suggest u to make ur own contract, and test it before using it in production
  • I am also currently calculating the upper and lower ticks of the price range, but I am not sure if I am doing the calculation correctly, and I am not currently putting the ticks to use. This part of the code will be commented out, if you find a use for it, or are not calculating the ticks correctly, please let me know.
  • The address in Arbitrerspools are for Arbitrum change it for your desired network
Keep in mind
  • This bot is not a financial advice. Use it at your own risk.
  • This bot is not a final version. I am still working on it.
  • This bot is not a high frequency trading bot. It is a simple arbitrage trading bot.
  • This bot is not a professional trading bot. It is a simple arbitrage trading bot.
  • The contract provided in the contracts directory is just an example. I am looking to make a final version, but I am still working on it.
  • All commits are welcome. Feel free to contribute to this project.

How to use

  • Clone the repository
  • cd into the repository
  • Install the dependencies
    • bun install or npm install
  • Make cp .env.example .env and fill the .env file with your PRIVATEKEY. (You can use .env to store your provider too)
  • Deploy the contract in your selected network ( i recommend start with a testnet ) using ignition/modules/deploy.js
  • Run the bot
    • bun run Arbitrers/WETH-USDT/price_usdt.js
    • node run Arbitrers/WETH-USDT/price_usdt.js
      • ( I recommend use bun)

uniswapv3_arbitrage's People

Contributors

4nibhal avatar

Watchers

 avatar  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.