Standalone Next.js API app with:
- Trigger.dev background jobs
- Postgres persistence
- Chainstack + optional Alchemy price fallback
- Compound v2 and v3 monthly indexing endpoints for a frontend app
POST /api/wallet-jobsGET /api/wallet-jobs/[jobId]GET /api/wallet-jobs/[jobId]/streamGET /api/reports?walletId=<walletId>&period=<YYYY-MM>GET /api/health
COMPOUND_V2_MARKETS_FILEis optional. If absent, the backend discovers Compound v2 markets onchain from Comptroller.COMPOUND_V3_MARKETS_FILEis bundled and recommended in production.- The worker builder is based on the latest user-supplied monthly builder script.
- The backend is deployment-agnostic and can run on Railway or Vercel. Trigger.dev Cloud is used for background execution.
- Copy
.env.exampleto.env.local - Create the database schema:
npm run db:init- Start Trigger.dev dev:
npm run trigger:dev- Start Next.js:
npm run dev