Skip to content
This repository was archived by the owner on Apr 3, 2020. It is now read-only.

ihaveCred/cryptomonitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cryptomonitor

This is a crypto price monitor support ifttt-like experience, with configurable parameters such as price feed, margin call ratio, etc.

install

npm i cryptomonitor

demo


const queryCTL = require("cryptomonitor");  

let config = {
    assets: [
        {
            coin: "ethereum",
            sym: "eth",
            count: 0.5
        },
        {
            coin: "bitcoin",
            sym: "btc",
            count: 0.1
        },
        {
            coin: "ht",
            sym: "ht",
            count: 10
        },
        {
            coin: "lba",
            sym: "lba",
            count: 1000
        },
        {
            coin: "bnb",
            sym: "bnb",
            count: 180
        }
    ],
    debt: 400
};



let margincall = 2;
let margincall_callback = (r) => {
    console.log("alert!! " + r);
}

async function test() {
    var rate = await queryCTL(config, margincall, margincall_callback);
    console.log(rate);
}

test();


CTL ifttt extension

Demo code in extension/httpServer.js

You can find margincall service in ifttt.

Alt text

Set your collateral eth count,lend stable coin count and alert ctl line, if your ctl is lt alert line,you will receive alert. Alt text

About

This is a crypto price monitor support ifttt-like experience

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors