Code Monkey home page Code Monkey logo

tokenplex's Introduction

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

tokenplex's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.