Lens is a unified Stellar price oracle aggregating SDEX and AMM prices, gated behind x402 micropayments. Contributions welcome — docs, tests, new endpoints, ingestion improvements.
- Good first issues —
good first issue - Bug reports — use the bug report template
- Feature requests — use the feature request template
- Tests — see
area:tests
lens/
├── src/
│ ├── index.ts # Fastify entry point
│ ├── db.ts # Postgres / Supabase (Prisma)
│ ├── routes/ # REST + GraphQL handlers
│ ├── ingest/ # SDEX + AMM ingesters
│ ├── pricing/ # Best-route calculation
│ └── x402/ # Payment middleware
├── prisma/
│ └── schema.prisma
└── sql/ # Raw SQL helpers (OHLCV, etc.)
- Node.js 20+
- PostgreSQL (local or Supabase)
- Redis (optional — for BullMQ workers)
- A Stellar testnet account for x402 payments (if testing paid endpoints)
git clone https://github.com/Miracle656/Lens.git
cd Lens
npm install
cp .env.example .env # fill in DATABASE_URL, REDIS_URL, WATCHED_PAIRS
npx prisma db push
npm run devAPI runs on http://localhost:3000.
DATABASE_URL— Postgres connection string (Supabase or local)REDIS_URL— optional, enables aggregate refresh workerWATCHED_PAIRS— comma-separatedCODE:ISSUER/CODE:ISSUER(e.g.XLM:native/USDC:GBBD...)NETWORK—testnetormainnet
feat:,fix:,docs:,test:,refactor:,chore:- Keep PRs focused
npx prisma generate
npx tsc --noEmit
npm run build
npm test --if-presentTests are being set up — see area:tests. Candidates: route handlers, price math, x402 flow, ingester bisection, DB queries.
Lens uses changesets for versioning and changelog generation.
When you make a change that should appear in the changelog (a feature, fix, or any user-facing change), add a changeset in the same PR:
npx changesetPick the bump type (patch / minor / major) and write a short summary. This creates a markdown file under .changeset/ — commit it alongside your change.
- When PRs with changesets are merged into
main, the release workflow (.github/workflows/release.yml) opens (or updates) a "Version Packages" PR. - That PR consumes the pending changeset files, bumps the version in
package.json, and updatesCHANGELOG.md. - Merging the Version Packages PR bumps the version and creates a matching git tag and GitHub release.
Lens is not published to a registry, so there is no publish step — releases are tag-only (changeset tag).
Open an issue or start a discussion.