Skip to content

add leaderboard rebuild job#271

Open
barry01-hash wants to merge 14 commits into
Akanimoh12:mainfrom
barry01-hash:rebuild-job
Open

add leaderboard rebuild job#271
barry01-hash wants to merge 14 commits into
Akanimoh12:mainfrom
barry01-hash:rebuild-job

Conversation

@barry01-hash

Copy link
Copy Markdown
Contributor

Closes #50

Akanimoh12 and others added 13 commits June 21, 2026 12:21
…plementation-drips

Scaffolds the workspaces where backend + oracle work will land:
- backend/  Fastify REST API (Node/TS) — package.json, tsconfig, .env.example, stub entry
- indexer/  Soroban getEvents indexer — same scaffold
- oracle/   council aggregator + data adapters + monitor — same scaffold
- db/       shared Postgres migrations dir + schema README
- infra/    docker-compose.dev.yml (Postgres + Redis) + README
- CONTRIBUTING.md describing the implementation-drips workflow
- .gitignore: ignore dist/ for the new TS services

No GitHub Actions added. All future work targets the implementation-drips branch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ion issues

- scripts/gen_issues.py — generates all 260 issues (context, what-to-build,
  acceptance criteria, file location, PR-target reminder) with area/priority
  labels + phase milestones. Idempotent: skips titles that already exist.
  Modes: --dry-run, --sample N, or full run.
- scripts/create-issues.sh — TSV-driven alternative creator.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
feat(db): add idempotent local seed script for development data (Akanimoh12#8)
fix(db): implement typed paginated getMarkets query (Akanimoh12#12)
Implement typed, parameterized data-access function for leaderboard
upserts in a simulated/local layer.

Changes:
- Add backend/package.json with typescript, vitest, @types/node
- Add backend/tsconfig.json with strict mode and @/ alias
- Add backend/vitest.config.ts for test runner config
- Add backend/src/db/leaderboard.ts with:
  - upsertLeaderboardEntry(address, pointsDelta, outcome)
  - getLeaderboardEntry(address) helper
  - clearLeaderboard() test helper
  - LeaderboardEntry and TransactionResult types
- Add backend/src/__tests__/leaderboard.test.ts with 8 tests:
  - New entry creation
  - Points accumulation
  - Win/loss counter increments
  - Mixed outcomes
  - Validation (empty address, negative points)

All inputs are parameterized (no string interpolation).
TypeScript: 0 errors. Tests: 8/8 passing.
Implement typed, parameterized data-access function for paginated
bet retrieval by market in the simulated/local layer.

Changes:
- Add backend/src/db/bets.ts with:
  - getBetsByMarket(marketId, page, limit) — 0-based pagination
  - PaginatedBets response type (bets, total, page, limit, totalPages)
  - Bet interface (address, amount, isYes, claimed)
  - seedBets() and clearBets() test helpers
- Add backend/src/__tests__/bets.test.ts with 10 tests:
  - First page retrieval
  - Second page retrieval
  - Partial last page
  - Empty result for unseeded market
  - Limit exceeding total
  - Out-of-range page
  - Negative marketId validation
  - Negative page validation
  - Zero limit validation
  - Market isolation

All inputs are parameterized (no string interpolation).
TypeScript: 0 errors. Tests: 18/18 passing.
…sert-query

feat(backend): add upsertLeaderboardEntry query function
@drips-wave

drips-wave Bot commented Jun 25, 2026

Copy link
Copy Markdown

@barry01-hash Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@barry01-hash

Copy link
Copy Markdown
Contributor Author

Please merge

@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

@barry01-hash is attempting to deploy a commit to the akanimoh12's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Akanimoh12

Copy link
Copy Markdown
Owner

Please read the branch you will make pr to

@barry01-hash

Copy link
Copy Markdown
Contributor Author

Please merge

@Akanimoh12

Copy link
Copy Markdown
Owner

Please merge

Make pr to implementation-drips branch not main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[INDEXER] leaderboard rebuild job

4 participants