Giter Club home page Giter Club logo

crypto-price-alerts's Introduction

GeckoTerminal Price Alerts

This repo allows you to setup custom price alerts for over 1000 tokens across hundreds of DEXs using the GeckoTerminal API. At the moment this is pretty bare-bones and using it isn't completely streamlined.

Setup

  • Run npm i to install the project dependencies
  • If you have a Discord key and channel ID that you want to send the notifications copy the .env.example file, update the example variables and rename it to .env.

Creating Alerts

Alerts can be created in the main.ts file inside of the createNewMethod(). Replace the calls to newAlert() with the data for tokens/chains you want to monitor. In the main() method make sure the createNewAlert() method call is uncommented. The parameters are as follows:

  • tokenSymbol: The symbol for the token you want to monitor. This is purely for naming the alert and doesn't need to match the token data.
  • poolAddress: The address of the pool that contains the token you want to monitor.
  • network: The name of the network that contains the pool and asset you want to monitor.
    • This name must match what the GeckoTerminal API expects. I've already included a list of 9 possible networks. Feel free to add any additional ones
  • price: The price that will trigger the alert.
  • alertType: The type of alert you want this to be. Must be "above" or "below".
    • "above" for when you want to be alerted when the asset price crosses above price.
    • "below" for when you want to be alerted when the asset price crosses below price

Running the Bot

To run the bot make sure the run() method in the main() method is uncommented. This will start the bot and it should run indefinitely and periodically check the prices of the assets that you've set alerts for. The checkAlerts() method takes in a boolean variable that allows you to set whether or not you want the alert to be deleted after it's been triggered. Setting this to true will prevent the alert from constantly being triggered once the condition is met for a given alert.

Alert Storage

All alerts are stored in a JSON file inside of output/alerts.json. You can modify the properties for an alert by modifying this file.

Disclaimer

As I stated earlier, this repo is pretty bare-bones and doesn't include any complex functionality, but is simple enough for anyone to add more complexity and features.

crypto-price-alerts's People

Contributors

lorem-ipsumm avatar

Watchers

 avatar  avatar

Forkers

viktor-kollegov

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.