gmanroney / cryptoboard Goto Github PK
View Code? Open in Web Editor NEWCollects data from multiple cryptocurrency exchanges, transforms it and posts it into redis
License: MIT License
Collects data from multiple cryptocurrency exchanges, transforms it and posts it into redis
License: MIT License
{
"name": "gdax",
"docurl": "https://docs.gdax.com/#websocket-feed",
"wssurl": "wss://ws-feed.gdax.com",
"pairs": "BTCUSD, LTCUSD, LTCBTC, ETHUSD, ETHBTC, ETCUSD, ETCBTC, BFXUSD, BFXBTC, RRTUSD, RRTBTC, ZECUSD, ZECBTC",
"active": "N"
}
Going to add ability to send exchange name from command line e.g. server.js hitbtc so the same code can run up exchanges independently. For now options will be
server.js -> do nothing
server.js hitbtc -> do hitbtc
server.js bitfinex -> do bitfinex
Send output from server to log file
As of now a websocket is opened for each connection to the exchange. This does not appear to be terribly efficient and needs to be investigated to see if using a single websocket will make the code more efficient.
{
"name": "binance",
"docurl": "https://github.com/binance-exchange/binance-official-api-docs/blob/master/web-socket-streams.md",
"wssurl": "wss://stream.binance.com:9443",
"pairs": "BTCUSD, LTCUSD, LTCBTC, ETHUSD, ETHBTC, ETCUSD, ETCBTC, BFXUSD, BFXBTC, RRTUSD, RRTBTC, ZECUSD, ZECBTC",
"active": "N"
}
Refactoring of redis step in each exhange function into its own separate function.
{
"name": "bitstamp",
"docurl": "https://www.bitstamp.net/websocket/",
"wssurl": "???",
"pairs": "BTCUSD, LTCUSD, LTCBTC, ETHUSD, ETHBTC, ETCUSD, ETCBTC, BFXUSD, BFXBTC, RRTUSD, RRTBTC, ZECUSD, ZECBTC",
"active": "N"
}
https://docs.bitfinex.com/docs
{
"name": "bitfinex",
"docurl": "https://docs.bitfinex.com/docs",
"wssurl": "wss://api.bitfinex.com/ws",
"pairs": "BTCUSD, LTCUSD, LTCBTC, ETHUSD, ETHBTC, ETCUSD, ETCBTC, BFXUSD, BFXBTC, RRTUSD, RRTBTC, ZECUSD, ZECBTC",
"active": "Y"
}
{
"name": "okex",
"docurl": "https://www.okex.com/ws_getStarted.html",
"wssurl": "wss://real.okex.com:10440/websocket/okexapi",
"pairs": "BTCUSD, LTCUSD, LTCBTC, ETHUSD, ETHBTC, ETCUSD, ETCBTC, BFXUSD, BFXBTC, RRTUSD, RRTBTC, ZECUSD, ZECBTC",
"active": "N"
}
Document on how to use crpytoboard
{
"name": "huobiapi",
"docurl": "https://github.com/huobiapi/API_Docs_en/wiki/WS_General",
"wssurl": "wss://api.huobi.pro/ws",
"pairs": "BTCUSD, LTCUSD, LTCBTC, ETHUSD, ETHBTC, ETCUSD, ETCBTC, BFXUSD, BFXBTC, RRTUSD, RRTBTC, ZECUSD, ZECBTC",
"active": "N"
}
Basic function working but it crashes some time after start with the following error:
BITFINEX wss://api.bitfinex.com/ws BTCUSD
BITFINEX wss://api.bitfinex.com/ws LTCUSD
BITFINEX wss://api.bitfinex.com/ws LTCBTC
BITFINEX wss://api.bitfinex.com/ws ETHUSD
BITFINEX wss://api.bitfinex.com/ws ETHBTC
BITFINEX wss://api.bitfinex.com/ws ETCUSD
BITFINEX wss://api.bitfinex.com/ws ETCBTC
BITFINEX wss://api.bitfinex.com/ws BFXUSD
BITFINEX wss://api.bitfinex.com/ws BFXBTC
BITFINEX wss://api.bitfinex.com/ws RRTUSD
BITFINEX wss://api.bitfinex.com/ws RRTBTC
BITFINEX wss://api.bitfinex.com/ws ZECUSD
BITFINEX wss://api.bitfinex.com/ws ZECBTC
Finshed launch
Connected to Redis Server
events.js:160
throw er; // Unhandled 'error' event
^
Error: unexpected server response (429)
at ClientRequest._req.on (/Users/germoroney/Development/cryptoboard/node_modules/ws/lib/WebSocket.js:653:21)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:473:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
at TLSSocket.socketOnData (_http_client.js:362:20)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at TLSSocket.Readable.push (_stream_readable.js:134:10)
[nodemon] app crashed - waiting for file changes before starting...
The number of clients connecting to redis to read data were initially thought to be related but this was found to be misleading. Happens with 1, 2 or 3 clients connecting to REDIS.
Error message found in https://github.com/bitfinexcom/bitfinex-api-node seems to be related to BITFINEX service itself ....
{
"name": "gemini",
"docurl": "https://docs.gemini.com/websocket-api/#market-data",
"wssurl": "wss://api.gemini.com/v1/marketdata/:symbol",
"pairs": "BTCUSD, LTCUSD, LTCBTC, ETHUSD, ETHBTC, ETCUSD, ETCBTC, BFXUSD, BFXBTC, RRTUSD, RRTBTC, ZECUSD, ZECBTC",
"active": "N"
}
There will be a configuration file for each exchange containing:
{
"name": "bittrex",
"docurl": "https://www.npmjs.com/package/node.bittrex.api",
"wssurl": "???",
"pairs": "BTCUSD, LTCUSD, LTCBTC, ETHUSD, ETHBTC, ETCUSD, ETCBTC, BFXUSD, BFXBTC, RRTUSD, RRTBTC, ZECUSD, ZECBTC",
"active": "N"
}
Automated test cases for application
{
"name": "hitbtc",
"docurl": "https://api.hitbtc.com/#socket-market-data",
"wssurl": "wss://api.hitbtc.com/api/2/ws",
"pairs": "BTCUSD, LTCUSD, LTCBTC, ETHUSD, ETHBTC, ETCUSD, ETCBTC, BFXUSD, BFXBTC, RRTUSD, RRTBTC, ZECUSD, ZECBTC",
"active": "N"
}
Identify what channels are active and what are not for a particular exchange
Refactoring of main function and moving looping through configuration to separate functions
Possibly combining of functions together.
Do we need command line options if we have active = y/n in the configuration file?
Analyse records as subscriber from redis and get:
This will be part of the client in addition to the record.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.