#loader #coingecko-api #metadata #url #cache #coingecko #provenance

app coingecko_cache_loader

CoinGecko API poller for coin dominance and database loader for snapshots

1 unstable release

0.1.0 Nov 17, 2020


331 lines

CoinGecko - Coin Dominance Historical API

Since CoinGecko doesn't have a historical API for cryptocurrency coin dominance, this functions as a workaround to cache and provide historical snapshots via a REST API.

This contains the following subprojects:

  • coingecko-cache-api -- the REST API build on actix-web
  • coingecko-cache-loader -- the CoinGecko API fetcher and database loader

Building & Deploying

This project by default targets x86_64-unknown-linux-musl to allow it to be compiled statically and ran on any Linux machine without having to recompile. In other words, once you build it, you can scp the two binaries onto any Linux machine.

To build everything for production, within the project root directory, run:

cargo build --release

The release binaries will be located in target/x86_64-unknown-linux-musl/release/.


The two binaries require a Postgres instance (preferably Postgres 13, but Postgres 10 or above should work).

A docker-compose.yml is provided which will automatically setup a Postgres 13 instance and run init.sql to create the database schema for you. This requires that you have Docker Compose installed.

To create the database, within the project root directory, run:

docker-compose up

Alternatively, simply run init.sql on Postgres >=10 database and update the .env file accordingly.


Licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


~1M SLoC