Skip to content
uzillion edited this page Jul 7, 2018 · 4 revisions

The various files inside trades folder has functions for different exchanges handling their respective stream data objects. Even though the format of these data objects varies from exchange to exchange, they each provide real-time trades happening on their platforms. After the respective data object is parsed, they each essentially go through the same steps.

  1. Important data like the price, quantity, exchange, and the side of the trade are extracted.
  2. Each individual trade is checked if it exceeds the Minimum Worth filter of the corresponding symbol.
    • The worth of a trade is calculated by multiplying the quantity of the cryptocurrency traded by the price with which it was traded.
    • The Minimum Worth for each cryptocurrency is held in the database, and can be easily viewed and edited by going to the home page of the running app.
  3. The next level of filter is the Volume Filter. This is meant to filter out seemingly large, but in reality insignificant trades from triggering the alerts.
    • This is done because during the time of high volume, the Minimum Worth can easily be surpassed. In which case comparing the trade's worth to the all the trades' worth in the last 24 hours can give a better perspective of how significant a trade really is.
    • The Volume Filter is represented in form of a percentage value. So say if the Volume Filter has a value of 1%, it would only allow trades that are worth more than the worth of 1% of the total trading volume.
    • Having the Minimum Worth filter is important too because when trading volume is extremely low, even 2% of the trading volume might not be worth much.
  4. When a trade successfully goes through all filters, the data is added to a message object and is passed on to message.js for the purpose of sending the alert.
Clone this wiki locally