crypto-charts

command module
v0.0.0-...-693d636 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2023 License: MIT Imports: 1 Imported by: 0

README

Crypto Charts

Pulls OHLC data from a set of data sources. Generates chart in SVG format and uploads it to a place of your choice.

Purpose

Using canvas for visualizing a chart might be heavy for the browser especially if you have to render tens of charts on the same page. On top of that you have to fetch the data for each pair resulting in MBs of data and many requests. In environment where visualizing live data is not crucial server side SVG rendering sounds like a good idea.

Use

go build .
crypto-charts --help 
Config priority:
  • All flags have default values
  • Values provided from yaml config override default values
  • Values provided via flags have hightest priority

Info

Current implementation includes:

  • fetchers:
    • bitstamp
    • osmosis
    • ecb
  • synths
  • svg generators
    • simple line charts
    • more advanced charts with grids, prices, BB, SMA, ...
  • google cloud storage - persistent store for SVGs
  • .crypto-charts.yaml - contains config for fetchers, generators and uploader
  • ./deploy/Dockerfile - Dockerized cron job running the app
  • ./deploy/crontab - runs the job every 5 minutes
Add new fetcher

To add new fetcher just register it in job.NewJob func. Fetchers without config in .crypto-charts.yaml will not work

Synths

Generate new pair out of the history of other 2. In the current implementation we add new fetcher called ecb which generates artificial price series for bgneur and eurbgn. Then the new pair is used in combination with any other pair which has EUR as base or quote currency.

Demo

  • 7 day simple charts: demo
  • max period advanced: demo

TODOs:

  • extract all chart generators parameters in config
  • add compose to build and deploy with multiple configurations
  • add tests
  • add github build workflows
  • use fetchers in parallel
  • create self hosted CDN server where we can upload the SVGs
    • maybe part of the same service so we can upload to the localhost and use nginx to serve
    • orchestrate with docker compose

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
job

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL