Skip to content

Mount the candles router and start its refresh worker #190

Closed

Description

@Miracle656

Background

Issue #100 shipped the SQL aggregates, the router (src/api/candles.ts:71, :101), the worker (src/workers/ohlc-refresh.ts:58) and the zod response schemas. None of it is reachable: createCandlesRouter has zero importers, src/api.ts never mounts it, and src/index.ts never starts the worker — compare startWebhookWorker() at src/index.ts:47 and startPartitionRetentionJob() at :50. The feature is closed and completely inert.

Acceptance criteria

  • createCandlesRouter() mounted at /candles in createApp()
  • startOhlcRefreshWorker() started in src/index.ts, behind an interval env var, and skipped under SKIP_INDEXER=true
  • /candles/{bucket}/{contractId} appears in the generated OpenAPI spec
  • A supertest route test that returns 404 on main and passes after

Drips Wave · Complexity: Easy · 100 points


How this repo is laid out

Wraith is a Soroban incoming-transfer indexer: it fills the gap Horizon leaves for SAC/SEP-41 token events by recipient address. Roughly 14k lines under src/, REST + GraphQL + WebSocket, Postgres via Prisma, deployed on Render.

  • Unit tests are jest (src/**/__tests__, tests/*.test.ts), with a coverage gate.
  • Integration tests are vitest (tests/integration/, vitest.integration.config.ts, Docker).
  • Don't mix the two runners in one file.

Known state of main before you start

tsc --noEmit and the unit suite are green. The Integration tests CI job is red, and so is Load test — both predate this batch. Open PRs #177 and #178 address them. If the integration job is red when you open a PR, that is not your fault; say so in the PR and carry on.

Four modules are shipped, closed as done, and imported by nothing: src/indexer/checkpoint.ts, src/ingest/reorg.ts, src/middleware/opa.ts, and src/api/candles.ts + src/workers/ohlc-refresh.ts. So the live indexer today has no reorg handling and no atomic checkpointing, despite both features being closed. Two issues below start unpicking that — don't assume a closed issue means a wired feature.

Ground rules

  • Every PR needs a test that fails before the change and passes after, unless the issue says otherwise.
  • Don't widen a Prometheus label to something unbounded — addresses and contract ids must never become label values.
  • Nothing may log or return a raw database error, a connection string, or a provider URL.
  • Don't reformat a file you're changing. A diff that is 90% whitespace hides the 10% that matters.


Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk

Activity

  1. olarh0170-netizen commented on Sep 24, 2026

    @olarh0170-netizen

    @olarh0170-netizen has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hi maintainer i would love to solve this issue.I have reviewed, i am ready to follow the guidelines and deliver a clean, tested solution.If you are willing to assign it to me i would really appreciate the oppurtunity to prove my self
    Thank you for considering me maintainer
    God bless you

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @olarh0170-netizen to this issue.

  2. ibochivincent-lang commented on Sep 26, 2026

    @ibochivincent-lang

    @ibochivincent-lang has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    I saw Issue #190 regarding mounting the inert candles router and starting its OHLC refresh worker in Miracle656/wraith, and I would love to take this on!

    Wiring up these existing components will bring our high-performance SQL aggregates and candlestick endpoints online, fully exposing them through OpenAPI documentation and automated tests.

    Here is my plan for tackling this:

    API Router Mounting (src/api.ts): Import and mount createCandlesRouter() at /candles in createApp(), ensuring that /candles/{bucket}/{contractId} is correctly registered and appears in the generated OpenAPI spec via our Zod response schemas.

    Worker Initialization (src/index.ts): Wire up startOhlcRefreshWorker() in src/index.ts, placing it behind a configurable interval environment variable while ensuring it skips execution when SKIP_INDEXER=true.

    Guardrails & Compliance: Strictly adhere to project ground rules by ensuring contract IDs and addresses are never used as Prometheus metric labels (keeping label cardinality bounded).

    Testing (tests/candles-route.test.ts): Implement a dedicated Supertest route test verifying endpoint functionality (ensuring it returns expected responses after mounting).

    Please let me know if I am good to go, and feel free to assign the issue to me!

    Would you prefer any specific default interval for the OHLC refresh worker environment variable, or should we align it with existing worker cadences?

    Best regards,

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @ibochivincent-lang to this issue.

  3. Wang1rrr commented on Sep 27, 2026

    @Wang1rrr
    Contributor

    @Wang1rrr has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    I'd like to wire up the existing candles feature. I will mount createCandlesRouter() at /candles in createApp(), start startOhlcRefreshWorker() behind a configurable interval, and ensure it is skipped when SKIP_INDEXER=true. I will check that the route appears in the generated OpenAPI spec and add a focused Supertest regression that fails before the wiring change and passes afterward. I will keep Jest unit tests separate from Vitest integration tests and report any pre-existing CI failures separately. Please consider assigning this issue to me.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Wang1rrr to this issue.

  4. boalambo commented on Sep 27, 2026

    @boalambo
    Contributor

    @boalambo has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hello maintainer, I would like to work on this issue

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @boalambo to this issue.

  5. TideX91 commented on Sep 29, 2026

    @TideX91

    @TideX91 has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    I can handle this issue and will like to work on it, Please assign thank you.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @TideX91 to this issue.

  6. drips-wave commented on Sep 29, 2026

    @drips-wave

    Congratulations, @Wang1rrr! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.

    🧑‍💻 @Wang1rrr: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  7. drips-wave commented on Oct 19, 2026

    @drips-wave

    This issue has been completed by @Wang1rrr as part of the Stellar Wave Program's 10th Wave 🥳

    😎 @Wang1rrr: You earned 100 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

  8. added a commit that references this issue on Oct 19, 2026
    962d91d
  9. added a commit that references this issue on Oct 20, 2026
    8ec6a6e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions