Giter Club home page Giter Club logo

fork-token-filter's Introduction

Token-Filter

A pratical example on how to perform multiple type of filters on millions of pairs. The goal of this repo is to be used as a low barrier of entry reference source code for aspiring new searchers (hence, JavaScript).

This bot contains:

  • filtering pairs by tokens present. You can filter for pairs that have a busd/wbnb/usdc/dai pool for a certain token and even require that all of them/one of them/two of them be present by slightly modifying the code. I was writing an arbitrage bot that went from eth -> token -> usdc and so needed to check that an existing token had both an eth and usdc pool otherwise I would discard it from my tokens-to-arb list.
  • filtering pairs by TAX/HONEYPOT/BUY DIVERSION. After filtering pairs by tokens present, this bot filters tokens that are not worth frontrunning/arbing over. Mainly those for which you lose a certain % of your trade after buying then selling. You can choose your fee tolerance accordingly, 1%, 2%, 5% etc
  • filtering pairs by Reserves amount. You might not want to arb over pairs that have too little reserves as you will suffer from too much slippage and it is better if you ignore them. In this bot I filtered tokens that had less than 1000 busd in their token/BUSD Reserves.

After all filtering is done, the final array of filtered pools ([tokenAddr, pair1Addr, pair2Addr], [...],[...],...) is printed into another file. I can then proceed to create either an array, structure, hashmap of all those items in whichever way is convenient for my arb bot. The nice thing is that this will be hardcoded into the bot instead of it being fetched at runtime. Too many people try to fetch the pairs and create their database inside their arbitrage bot at runtime. Having everything hardcoded beforehand is a much better alternative.

The code works straight ahead on BSC mainnet since the 2 necessary contracts are already deployed. You can go ahead and try the bot. Even though this bot simulates buy and selling it does not use any gas! Everything is explained inside the pair.js file

UniswapFlashQuery.sol is the contract that we use to fetch all pairs from any DEX

toleranceCheck.sol is the contract that we use to filter tokens that have a TAX/HoneyPot by simulating buy and sell.

You'll have to make a few changes before deploying these contracts to other chains. These are all pretty simple and obvious so i'll let you check this.

ENJOY !

fork-token-filter's People

Contributors

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