Backend (NestJS API)

Modules, responsibilities, and runtime behavior.

Stack

  • NestJS

  • TypeScript

  • PostgreSQL (Prisma)

  • Redis + BullMQ

  • Structured logging

Bootstrapping

  • CORS is controlled via CORS_ORIGINS.

  • Validation uses a global pipe (whitelist + transform).

Major modules

  • Providers: internal adapters for X1/X2/X3 route engines.

  • Quotes: aggregates candidates from all engines.

  • Routes: scoring + ranking.

  • Strategy: per-wallet preferences and custom weights.

  • AI: agent chat + tool execution.

  • API keys: create/revoke keys and track usage.

  • Tokens: chains, tokens, and price helpers.

  • Health: service health endpoints.

Last updated