/cryptocurrency-monitor

Serverless cryptocurrency monitor

Primary LanguageJavaScriptMIT LicenseMIT

Cryptocurrency Monitor

Open Source Love License: MIT FOSSA Status

Stories in Ready Build Status Coverage Status Scrutinizer Code Quality Known Vulnerabilities dependencies Status

Serverless application on AWS that use Coinbase to monitor buy/sell/spot price and Twilio to send SMS alerts.

Getting Started

AWS Services in use:

Prerequisites

Installing

Create serverless.config.yml

cp serverless.config.sample.yml serverless.config.yml

Edit serverless.config.yml and provide Twilio SID, Token and Sender Phone Number (must follow Twilio phone number format).

twilio_sid: 
twilio_token: 
twilio_from: 
worker_rate: cron(*/10 * * * ? *)
worker_enabled: true

Development & Test

Install dependencies

yarn install

Run the tests

npm test

Deployment

serverless deploy -v

Alerts

Alerts are stored into cryptocurrency-monitor DynamoDb table.

New alerts can be added through AWS Console using this format:

{
    "id": "6cd86d8f-1229-40e7-9aab-997cb2e065a8",
    "name": "ETH-EUR 5%",
    "mobile": "+12345678910",
    "currencyPair": "ETH-EUR",
    "price": 300,
    "priceType": "buy",
    "percent": 5
},

Alert fields:

  • "id": "6cd86d8f-1229-40e7-9aab-997cb2e065a8" UUID
  • "name": "ETH-EUR 5%" Alert name
  • "mobile": "+12345678910" Receiver's phone number. Must follow Twilio phone number format.
  • "currencyPair": "ETH-EUR" Coinbase currency pair
  • "price": 300 Base price. It will be updated with the new price when the alert is triggered.
  • "priceType": "buy" Coinbase price type
  • "percent": 5 Percent change (up or down).