Giter VIP home page Giter VIP logo

kiennguyenbinh / dex-listings-scanner-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 0xcaso/dex-listings-scanner-bot

0.0 0.0 0.0 3.68 MB

A Telegram Bot that will notify you whenever a new pair is added on your favouirte DEXs. Featured DEXs are TraderJoe (Avalanche), Netswap and Tethys (Metis), Trisolaris (Aurora) and Fuseswap (Fuse).

License: MIT License

JavaScript 100.00%

dex-listings-scanner-bot's Introduction

Dex Listings Scanner - Telegram Bot

This is a Telegram bot which will notify you whenever a new pair is added on your favourite DEXs.

Screenshot

Description

The script is listening for the event "PairCreated" emitted from the factory contract of the DEX. Whenever this happens, a log with all the info will be written into a text file, and a message to the bot will be sent.

You can remove the DEX I've put and add the ones you want, as long as you can find the URL RPC of the blockchain and the factory address of the DEX.

Setup

  1. Export your mnemonic private key from Metamask (preferably of an account you don't use, also it won't spend gas of course), and insert it on line 5 of app.js:
const mnemonic = 'YOUR MNEMONIC PHRASE GOES HERE';
  1. On Telegram, search BotFather and create a bot. At the end of the procedure you'll find a key in a format like 7862412351:ABCdI2ujasdasguun38nuan8nin-512kjhi and insert it on line 7 of app.js:
const bot = new Telegraf('YOUR API TOKEN GOES HERE');
  1. Add a directory called "logs" inside the project, then run the script with
node app.js

and then activate the bot sending "/start" in the chat.

  1. If you want to add a DEX you want to scan, you have 3 things to do:
  • Create an object with DEX factory contract address, URL RPC of its blockchain and its name. Example:
const traderjoe = {
  address: '0x9Ad6C38BE94206cA50bb0d90783181662f0Cfa10',
  rpcLink: 'https://api.avax.network/ext/bc/C/rpc',
  dex: 'TraderJoe'
};
  • Create the contract object. Example:
const netswapFactory = buildContract(netswap.address, netswap.rpcLink);
  • Add the listening and log creation. Example:
traderjoeFactory.on('PairCreated', async (_token0, _token1, _pairAddress) => {
  logPairInfo(_token0, _token1, _pairAddress, traderjoe.rpcLink, traderjoe.dex, context);
});

Find the factory address of the DEX and the URL RPC of the blockchain

Address

Let's say you know the DEX you want to add. To find the address, usually you can just go to its docs and you'll probably find a section with all the contracts addresses listed. Example: Trader Joe Docs.

URL RPC

If you have already add the blockchain on Metamask, you can go to select a network, then go to "Add Network". Press "Cancel" and then you'll find "New RPC URL".

dex-listings-scanner-bot's People

Contributors

0xcaso 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.