All Projects → jxm262 → btc-stats

jxm262 / btc-stats

Licence: MIT license
Bitcoin price api to calculate statistics on spot prices across exchanges.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to btc-stats

idex-sdk-js
IDEX v3 SDK built with TypeScript, supporting both web and Node environments.
Stars: ✭ 35 (+20.69%)
Mutual labels:  exchange
PSServicePrincipal
PowerShell module for creating and deleting enterprise and registered applications as well as SPN object (single and batch) for automation. This can be used as a facilitator for setting up Exchange PowerShell CBA
Stars: ✭ 14 (-51.72%)
Mutual labels:  exchange
mozi
0x protocol exchange prototype. A relayer.
Stars: ✭ 23 (-20.69%)
Mutual labels:  exchange
PSBlackListChecker
Basic functionality of this module is ability to quickly verify if given IP address is on any of over 80 defined DNSBL lists. Below code will return results only if IP is on any of the lists. Advanced functionality of this module is ability to send reports to your email when things get bad on one of those 80 defined DNSBL listrs.
Stars: ✭ 50 (+72.41%)
Mutual labels:  exchange
coinbase-pro-rs
Coinbase pro client for Rust
Stars: ✭ 127 (+337.93%)
Mutual labels:  exchange
bot-trader
Simple bot trader for Bitmex
Stars: ✭ 14 (-51.72%)
Mutual labels:  exchange
binance-client-websocket
🛠️ C# client for Binance websocket API
Stars: ✭ 41 (+41.38%)
Mutual labels:  exchange
exchange-ews-thunderbird
thunderbird addons provide exchange support: mail, calendar, global address list (contacts)
Stars: ✭ 15 (-48.28%)
Mutual labels:  exchange
Remove-DuplicateItems
Script to remove duplicate items from Exchange mailboxes.
Stars: ✭ 32 (+10.34%)
Mutual labels:  exchange
easypump
EasyPump makes the coin pump easy and profitable
Stars: ✭ 14 (-51.72%)
Mutual labels:  exchange
conduit
Conduit - Open Source 0x Relayer API implemented in NodeJS
Stars: ✭ 18 (-37.93%)
Mutual labels:  exchange
Microsoft365
Manage Microsoft 365 with PowerShell
Stars: ✭ 30 (+3.45%)
Mutual labels:  exchange
algo-coin
Python library for algorithmic trading cryptocurrencies across multiple exchanges
Stars: ✭ 386 (+1231.03%)
Mutual labels:  exchange
testnet.backend
Backend for a ViaBTC exchange server (trading engine)
Stars: ✭ 18 (-37.93%)
Mutual labels:  exchange
haveno
Decentralized P2P exchange built on Monero and Tor
Stars: ✭ 542 (+1768.97%)
Mutual labels:  exchange
cryptomkt-node
CryptoMarket Node SDK
Stars: ✭ 21 (-27.59%)
Mutual labels:  exchange
roq-samples
How to use the Roq C++20 API for Live Cryptocurrency Algorithmic and High-Frequency Trading as well as for Back-Testing and Historical Simulation
Stars: ✭ 119 (+310.34%)
Mutual labels:  exchange
stockholm
💵 Modern Python library for working with money and monetary amounts. Human friendly and flexible approach for development. 100% test coverage + built-in support for GraphQL and Protocol Buffers transports using current best-practices.
Stars: ✭ 26 (-10.34%)
Mutual labels:  exchange
Sarrafi
💵 Exchange price application for android
Stars: ✭ 49 (+68.97%)
Mutual labels:  exchange
frontend
testnet.exchange frontend
Stars: ✭ 18 (-37.93%)
Mutual labels:  exchange

btc-stats Build Status

Bitcoin price api to calculate statistics on spot prices across exchanges. Uses the xchange.js module to retrieve current ticker prices.

Note!! This is highly in the Alpha stage.

This project currently supports the following exchanges

  • bitfinex
  • bitstamp
  • okcoin
  • btce
  • bter
  • hitbtc
  • ccex

Note: these are all using btc-usd

Download

The source is available for download from npm or here on github (master branch)

npm install btc-stats

If preferred, you can specify a range of exchanges by calling the .exchanges() function. Otherwise, the functions will run across all the exchanges mentioned above.

//example - use only these 3 exchanges
btcstats.exchanges(["bitfinex", "bitstamp", "okcoin"]);

Quick Examples

var btcstats = require("btc-stats");

//if this line isn't specified, it runs the avg function across all exchanges, not just these 3
btcstats.exchanges(["bitfinex", "bitstamp", "okcoin"]);

//Example print the average price across 3 exchanges (bitfinex, bitstamp, okcoin)
btcstats.avg(function(error, resp) {
	if (!error) {
		console.log(resp);
	}
});  

Documentation

All Functions accept a callback argument

  • callback(err, results) - Called when the process completes, or an error occurs.
### avg(callback)

Calculates average midpoint price across exchanges. Midpoint is defined as mid-price between bid vs ask.

btcstats.avg(function(error, resp) {
    //response format { price: xxx }
});

### weightedAvg(callback)

Calculates average midpoint price across exchanges, weighted by volume.

btcstats.weightedAvg(function(error, resp) {
    //response format { price: xxx }
});

### min(callback)

Calculates the exchange with the minimum price.

btcstats.min(function(error, resp) {
    //response format { price: xxx , exchange: xxx}
});

### max(callback)

Calculates the exchange with the maximum price.

btcstats.max(function(error, resp) {
    //response format { price: xxx , exchange: xxx }
});

### minVolume(callback)

Calculates the exchange with the minimum volume.

btcstats.minVolume(function(error, resp) {
    //response format { volume: xxx , exchange: xxx }
});

### maxVolume(callback)

Calculates the exchange with the maximum volume.

btcstats.maxVolume(function(error, resp) {
    //response format { volume: xxx , exchange: xxx }
});

### minSpread(callback)

Calculates minimum spread between all exchanges. Defined as the exchange with the lowest asking price vs the exchange with the highest bidding price. This result may often be a negative number if 1 exchange has a higher bid vs an exchange with a lower ask (potential arbitrage maybe ? :)

btcstats.minSpread(function(error, resp) {
    //response format { spread: xxx, bid: xxx, ask: xxx, bidExchange: xxx, askExchange: xxx } 
});

### maxSpread(callback)

Calculates maximum spread between all exchanges. Defined as the exchange with the highest asking price vs the exchange with the lowest bidding price.

btcstats.maxSpread(function(error, resp) {
    //response format { spread: xxx, bid: xxx, ask: xxx, bidExchange: xxx, askExchange: xxx } 
});

### exchangeMinSpread(callback)

Calculates the exchange (within the list of exchanges) , with the minimum spread. Defined as the exchange with the highest asking price vs the lowest bidding price.

btcstats.exchangeMinSpread(function(error, resp) {
    //response format { spread: xxx, bid: xxx, ask: xxx, bidExchange: xxx, askExchange: xxx } 
});

### exchangeMinSpread(callback)

Calculates the exchange (within the list of exchanges) , with the minimum spread. Defined as the exchange with the highest asking price vs the lowest bidding price.

btcstats.exchangeMinSpread(function(error, resp) {
    //response format { spread: xxx, bid: xxx, ask: xxx, bidExchange: xxx, askExchange: xxx } 
});

Working on btc-stats

To help work on btc-stats, you'll need to

  • have Node installed.
  • Then clone the repo
  • install dependencies
git clone https://github.com/jxm262/btc-stats.git
cd btc-stats
npm install

To run tests (using mocha chai)

npm test

About the Project

This project utilizes my earlier project - xchange.js. Please please feel free to join in and help contribute. I'm also very open to suggestions or code reviews :)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].