Giter VIP home page Giter VIP logo

cryptocurrency-exchange-listener's Introduction

Crypto Exchange Compare

Express and Web Sockets app powered by React+Redux to implement real-time tracking of specified trading pairs such as (BTC-DASH, BTC-ETH, BTC-LTC) from Bittrex, Poloniex and Bitfinex

  • install dependencies yarn install

  • install rimraf globally for use in production build yarn global add rimraf

  • run in dev yarn run open:src

  • build for prod yarn run build

  • open the app at http://localhost:3000

API

import ExchangeSocketApi from './api/exchangeSocketApi';
const exchangeSocketApi = new ExchangeSocketApi();
  • specify trading pairs as an array
tradingPairs = ['BTC-ETH','BTC-DASH', 'BTC-LTC']

exchangeSocketApi.listenDataFromExchange(tradingPairs, callback)

Get realtime data from exchanges. Currently supports Poloniex, Bittrex and Bitfinex

exchangeSocketApi.listenDataFromExchanges(tradingPairs, (data) => {
  console.log('All Exchange data', data);
});
//returns
{
  'BTC-LTC': {
    'All_Prices': {
      Bitfinex: 0.018955,
      Bittrex: 0.01895222,
      Poloniex: '0.01893073',
    },  
    Best_Price: { Exchange: 'Poloniex', Price: 0.01893073 }
  },
  'BTC-ETH':{
    'All_Prices': {
      Bitfinex: 0.081817,
      Bittrex: 0.0822603,
      Poloniex: '0.08176915',
    },
    Best_Price: { Exchange: 'Poloniex', Price: 0.08176915 }
  },
  'BTC-DASH':{
    'All_Prices': {
      Bitfinex: 0.069946,
      Bittrex: 0.06990888,
      Poloniex: '0.06973162',
    },
    Best_Price: { Exchange: 'Poloniex', Price: 0.06973162 }
   }
}

exchangeSocketApi.subscribeToBitfinex(tradingPairs, callback)

Subscribe To Bitfinex

exchangeSocketApi.subscribeToBitfinex(tradingPairs, (data) => {
  console.log('Bitfinex data', data);
});
//returns
{ exchange: 'Bitfinex', pair: 'LTCBTC', price: 0.018952 }

exchangeSocketApi.subscribeToPoloniex(tradingPairs, callback)

Subscribe To Poloniex

exchangeSocketApi.subscribeToPoloniex(tradingPairs, (data) => {
  console.log('Poloniex data', data);
});
//returns
{ exchange: 'Poloniex', pair: 'LTCBTC', price: 0.018952 }

exchangeSocketApi.subscribeToBittrex(tradingPairs, callback)

Subscribe To Bittrex

exchangeSocketApi.subscribeToBittrex(tradingPairs, (data) => {
  console.log('Bittrex data', data);
});
//returns
{ exchange: 'Bittrex', pair: 'LTCBTC', price: 0.018952 }

TODO

  • React in general needs work
  • fetch user from database(mongodb)
  • store historical data to db and use d3 to display it
  • spinner until data arrives from all 3 exchanges

cryptocurrency-exchange-listener's People

Contributors

durmo11 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.