A single CRON job (here) is responsible for updating the pairs from thegraph's endpoint. It will run every 30 minutes and will run the first time the server is started.
An HTTP endpoint (/pairs
) that fetches all pairs stored in the database is used to validate that the cron is working.
- Node.js v19+
- npm v9+
- MongoDB - no install needed (part of
docker-compose.yml
) - Docker v23+
- Docker Compose v2+
npm install
# spin up the necessary infrastructure
$ docker compose up -d
# create a development-only environment variables file
$ cp .env.template .env
# generate prisma client
$ npm run generate
# sync the database
$ npm run push
# run in development mode
$ npm run start:dev