JavaScript HTML
Switch branches/tags
Nothing to show
Latest commit 46b478f Jan 17, 2018
Permalink
Failed to load latest commit information.
bin saving Oct 1, 2017
config add integration tests Jan 14, 2018
graph add ccxt integration Jan 8, 2018
logs branch from private main Dec 2, 2017
models add integration tests Jan 14, 2018
routes add integration tests Jan 14, 2018
test saving Jan 14, 2018
utils update create table query Jan 10, 2018
views saving Oct 1, 2017
.babelrc saving Oct 1, 2017
.gitignore add ccxt integration Jan 8, 2018
.travis.yml add integration tests Jan 14, 2018
LICENSE update license Dec 9, 2017
README.md Update README.md Jan 17, 2018
app.js add ccxt integration Jan 8, 2018
constants.js saving Dec 9, 2017
package-lock.json add integration tests Jan 14, 2018
package.json saving Jan 14, 2018

README.md

What is TokenPlex

TokenPlex is an express/node based framework to aggregate crypto-currency data from the web, normalize and cleanse it, and provide simple easy to digest endpoints.

It implements the ccxt public library and provides a load-balancer and query-server over 80 supported exchanges.

Build Status

Installation

npm install
npm start

To Create all tables

GET /create/create-all-tables

To start cron job for querying coin ticker data

GET /cron/query-coin-list-table 

Optional

For server side rendering of Graph data, you need to install chartjs-node. It requires canvas.js and cairo to be pre-installed in your system.

and then simply call this endpoint to start cron job for querying 24 hour data and server side graph rendering.

GET /cron/query-daily-history-table

You are now running an API load balancer for serving crypto-currency data.

HA Deployment

To run TokenPlex in a fault-tolerant manner, you should use a HA data cluster and run your API server behind a load balancer. Since NodeJS is essentially single-threaded, you should run the CRON proceess in a separate node/container so that normal requests do not get jammed up due to blocked aggregation queries. You can use YugaByte a polyglot database with unified CQL + Redis implemetation

Hosted Solution

User Interface Endpoint at https://tokenplex.io

Exchange View

This provides a snapshot view public API's of 79 exchanges. The API is implemented over the ccxt library.

Token View

This provides a list and details view of 2000 coins. The details join public aggregator API's and provide a normalized view. Data is refreshed every 10 seconds.

Portfolio View

This provides a portfolio management screen. Currently only aggregate exchanges supported. More exchange support coming soon.

API Endpoint at https://api.tokenplex.io

Tokenplex API is a hosted implementation of this repository. It currently uses an RF-1 Yugabyte node as it's database. API docs can be found here

For production applications, it is recommended that you run your own hosted solution.

How It Works

Ticker data is stored in a Redis Cache and is by default updated every 3 seconds. History Data requests have a TTL depending on sample rate of the request. For eg. minutely data table has a TTL of 30 seconds while daily sampled data tables have a TTL of 12 hours. Exchange-Markets table has a TTL of 6 Seconds. Coin-Detail tables have a TTL of 10 Seconds.

TimeSeries metrics data and token details is stored in a CQL database and is updated on last request with a TTL strategy of 120 seconds.

Additionally you can specify an S3 Image server location for server side rendering of graph images.

You can run your own load balancer and application server on top of this architecture.

Supported Exchanges