Giter Site home page Giter Site logo

habben101 / eth-uniswap-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from digitalnomad91/eth-uniswap-bot

0.0 0.0 0.0 293 KB

ETH bot monitors transactions in real-time, parses ABI contract function to find addLiquiduityETH() calls, and then initiates a new transaction with swapExactETHforToken() contract. Threaded, asynchronous, very fast. Need geth node RPC API available.

eth-uniswap-bot's Introduction

Ethereum Uniswap Bot

Ethereum bot that watches the blockchain txpool in realtime for uniswap smart contract addLiquidityETH() tx's and then intiates a swapExactETHforToken() when a tx with the right paramaters is found.

Install & Run Instructions

  • You must have access to an ethereum node with websocket access enabled.
  • npm install

watch_tx_bot.js:

  • This script connects to your geth node and watches the TXPOOL in realtime to search for transactions going to the uniswap router address (0x7a250d5630b4cf539739df2c5dacb4c659f2488d) and with a binary input value that starts with 0xf305d719 (inidcating a addLiquidityETH() smart contract). It then decodes the binary input data using the data in abi.json and looks at the paramater values for the addLiquidityETH() function call. If the token (or is it the to address? -- deeprocks) value matches the one we're looking for, then the bot will initiate an asynchronous call to the send_tx_swapExactETHForTokens.js script.

send_tx_swapExactETHForTokens.js:

  • This script is called automatically by the watch_tx_bot.js script when the right transaction is found. It will create a new smart contract binary value using the swapExactETHForTokens() function and then pass that binary input value into a new transaction going to the uniswap router address (0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D). Values for the smart contract and for the new uniswap router tx will be provided by values passed in by the watch_tx_bot.js script.

send_test_tx.js:

  • This script is for testing the bot by sending out a transaction for it to "find". It is suggested that you run your geth node on the rinkeby testnet chain so that you don't lose any real eth funds. Make sure you're watch_tx_bot.js is running and listening for transactions with the proper paramaters, then run this script and watch as the bot catches it as soon as it's posted to the testnet TXPOOL.

See it in action

(the final tx fails due to no balance in my wallet at the time)

eth-uniswap-bot's People

Contributors

digitalnomad91 avatar dependabot[bot] 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.