This is a nodejs api that finds forex arbitrage paths. The app consumes exchange rates from freecurencyapi, and gets the arbitrage path from a provided base currency.
This api can be consumed by the frontend I created here
To set up the api take the steps below:
Clone the repo to your working directory.
git clone https://github.com/mut1sya/forex-arbitrage-finder-api.git
We need to configure some environment keys that will be used by the app. Create a .env
file in the project root directory and add the following keys:
FREE_CURRENCY_API_KEY=free-currency-api-key
APP_PORT=port-to-use
An example of these is shown below:
FREE_CURRENCY_API_KEY=ba1d-xxxx-xxxx-xxxx-0562655badd6
APP_PORT=9000
yarn install
To run the app in development mode:
yarn dev
To run the app in production mode:
yarn start
The api has 2 endpoints. One to get the currencies and the other to get the arbitrage path.
URL | Method | description |
---|---|---|
/arbitrage/{basecurrency} | get | gets the path to arbitrage |
/currencies | get | gets all the currencies |
To run the application using docker-compose run the command below:
docker-compose up -d --build
The app will be started at:
http://localhost:9000