"Most theoretical monetary economists, even those who specialised in Foreign Exchanges, made relatively little use of the lessons taught by earlier periods of Foreign Exchange history. It is no wonder that practical experts responsible for devising and executing Foreign Exchange policies so often failed to benefit by the lessons of the past. Much theoretical knowledge and practical experience acquired by our forerunners is being largely wasted by being allowed to fade into oblivion."
This project aims to provide an open currency exchange API that connects the traditional foreign exchange market with cryptocurrencies. With this goal in mind,
-
coin-market-cap
crate implements a Rust client of the CoinMarketCap API while using a data caching strategy based on a migrated SQL database. -
crypto-forex
crate provides the core backend server that offers both a REST API and a high-performance RPC API, while consuming the migrated SQL database fromcoin-market-cap
.
See the README file that accompanies each crate for details about the implementation.
Disclaimer: I don't have any type of relationship with CoinMarketCap or Coinbase.
Take a look at your system setup section below for details.
- Install
curl
,git
. - Install Rust.
- Install Docker.
- Install PostgreSQL interactive terminal
psql
. - Install SQLx's command-line utility for managing databases
sqlx-cli
. - Obtain an API key from CoinMarketCap.
Please note that we keep all settings locally in each crate to avoid unnecessary dependencies.
For details on how to configure a development environment, take a look at
coin-market-cap
setup section and
crypto-forex
setup section, respectively.
Arch Linux
If you are using Arch Linux or a derivative, you could install all the development dependencies by running the following commands.
sudo pacman -S curl git rust docker postgresql
# Install sqlx-cli only for postgres
cargo install sqlx-cli --no-default-features --features postgres
Debian
If you are using Debian or a derivative (e.g. Ubuntu, Linux Mint), it is recommended to install Rust using the standard installation script. You could install all the development dependencies by running the following commands.
# sqlx-cli needs libssl-dev
sudo apt install curl git docker postgresql-client libssl-dev
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install sqlx-cli only for postgres
cargo install sqlx-cli --no-default-features --features postgres
macOS
If you are using macOS you could install all the development dependencies using Homebrew by running the following commands.
brew install curl git docker postgresql
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install sqlx-cli only for postgres
cargo install sqlx-cli --no-default-features --features postgres
Windows
If you are using Windows, you could install all the required dependencies using the
winget
CLI tool by running the following commands.
winget install --id Git.Git
winget install --id Docker.DockerDesktop
winget install --id Rustlang.Rust.MSVC
winget install --id PostgreSQL.PostgreSQL
# Install sqlx-cli only for postgres
cargo install sqlx-cli --no-default-features --features postgres
You will be able to run the scripts on your Windows system if you use Git Bash. Otherwise, you could use the Windows Subsystem for Linux (WSL).
See the usage section of each crate's README file.
At this time it is possible to deploy coin-market-cap
using one of the Docker
recipes in the crate. But the plan is to make the
full project deployment using Kubernetes (see the roadmap).
Thanks to all the developers of the libraries used throughout the project.
This project is licensed under the MIT license.