Socket
Socket
Sign inDemoInstall

coinpit-index

Package Overview
Dependencies
130
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    coinpit-index

External spot price use by coinpit futures exchange


Version published
Maintainers
2
Created

Readme

Source

coinpit-index

This module listens to BTC/USD spot prices from different exchanges. (currently supported providers: Bitfinex, OKCoin, BitStamp)

install:

npm install coinpit-index --save

usage

var config = {
    feed                : ["bitfinex", "bitstamp", "okcoin"], 
    minExternalProviders: 1, // if less than 1 provider, band will return undefined
    ticksize            : 1, // up to 1 decimal place
    bandUpperLimit      : 2, // upper limit on the band from the median external price
    bandLowerLimit      : 2, // lower limit on the band from the median external price
    logExternalPrice    : true // logs price, min and max
}

var coinpitIndex = yield require('coinpit-index')(config)

// returns current external spot price band. {price:<price>, max:<max>, min:<min>
var band = feed.getBand() 

// listen to coinpitIndex when externalSpotPrice changes.
coinpitIndex.on('price', function(band){
    var externalSpotPrice = band.price
    var upperLimitSpotPrice = band.max
    var lowerLimitSpotPrice = band.min
)

Keywords

FAQs

Last updated on 15 Sep 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc