The intent of this application is to detect arbitrage opportunities for the crypto coin called Solana. An arbitrage is when there's a price discrepency between two crypto marketplaces. The difference in price allows a user to buy coins on one exchange then sell on the other for a profit. Solana was chosen because it is fast and transfers are cheap, so in theory one can quickly react to the arbitrage opportunity before it disappears.
This application has three background tasks and one webserver. The background tasks pull in updated prices, calculate the price maximum price difference, and sends emails respectively. There is a web frontend that allows users to view the current prices, the current maximim price difference, and a form for users to input their email address to receive alerts when an arbitrage opportunity is detected.
- node js (developed using version 18.4.0)
- npm (developed using version 8.12.1)
- docker (developed using version 4.2.71)
- run docker containers via
docker compose up
- install dependencies via
npm install
- migrate the database via
npx prisma migrate dev
- copy .env.example to .env via
cp .env.example .env
, the default values will work for the database and message queue services, if you want to send emails you will need to enter the smtp settings
- complete the installation steps above
- run dev command via
npm run dev
- access webserver in your browser at http://localhost:3000/
- run unit tests
npm test
- run integration tests via
npm run test:integration
(make sure docker containers are running and .env file has been setup properly) - run both unit and integration tests at the same time via
npm run test:all
Note: building isn't required to run tests, it is generally used to run the app in a production environment
- install dependencies via
npm install
- run the build command via
npm build