1.0.0 • Published 2 years ago

tracker-v2 v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

DCA Tracker

Tracks DCA Program activities such as open DCA position, close DCA position, withdrawal, deposits, order fills.

Runs a forever loop to loop through events emitted by the program via Anchor's event CPI. Stores events in a Postgres DB.

Data is retrieved through DCA API

Development

  1. You will need a Postgres DB
  2. Environment Variables
    RPC="https://api.devnet.solana.com"
    EVENT_AUTHORITY="7KFbFLJ3MY74ecp65aSNmY79EKpBxbQEJ1MdQehcapuV"
    POSTGRES_USER="abc"
    POSTGRES_PASSWORD="abc"
    POSTGRES_DB="dca-tracker"
    POSTGRES_PORT="5443"
    DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:${POSTGRES_PORT}/${POSTGRES_DB}?schema=public"
    SENTRY_DSN=""
    BETTER_UPTIME_MONITOR=""
    JUP_TG_BOT_USERNAME="Hello"
    JUP_TG_BOT_PASSWORD="World"
  3. Install dependencies
    pnpm i
  4. Database Migrations
    npx prisma migrate dev # or npx prisma migrate deploy or if testing against a ready DB npm run prisma:generate
  5. Run
    npm run dev
  6. Build
    npm run build

Production

Hosted on fly.io

fly auth login
fly secrets set .... # Set env vars if necessary. (already set)
fly deploy # see fly.toml for more details