Skip to content

feat: GET /candles/:slab UDF OHLCV endpoint (Phase 3)#177

Merged
dcccrypto merged 1 commit intomainfrom
helius-perf-upgrade
Apr 20, 2026
Merged

feat: GET /candles/:slab UDF OHLCV endpoint (Phase 3)#177
dcccrypto merged 1 commit intomainfrom
helius-perf-upgrade

Conversation

@dcccrypto
Copy link
Copy Markdown
Owner

Summary

New endpoint serving internal-trade candles in TradingView UDF format.

  • GET /candles/:slab?resolution=1|5|15|60|240|1D&from=<sec>&to=<sec>
  • Response: { s: "ok"|"no_data"|"error", t, o, h, l, c, v }
  • Aggregates the existing trades table on-the-fly via JS bucketing.
    Works on plain Postgres today; swappable to TimescaleDB continuous
    aggregates when applied (see indexer migration).

Paired with frontend usePercolatorCandles hook in percolator-launch PR.

Test plan

  • pnpm vitest run — 228 passing, 9 new tests on bucketCandles + route
  • pnpm tsc --noEmit clean
  • Post-merge: verify against live SOL/USDC slab

Dependencies

  • Apply SQL CREATE INDEX IF NOT EXISTS trades_slab_created_at_idx ON trades (slab_address, created_at DESC); to Supabase (tracked in indexer migration 20260420_candle_support.sql).

🤖 Generated with Claude Code

Aggregates the trades table into OHLCV bars on-the-fly (bucket in JS).
Works on plain Postgres — optional TimescaleDB continuous aggregates
can be layered on later for faster queries under high volume.

Resolutions: 1 / 5 / 15 / 60 / 240 / 1D (minutes and 1 day).
Response shape matches TradingView UDF so frontend can swap data sources.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

Warning

Rate limit exceeded

@dcccrypto has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 59 minutes and 41 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 59 minutes and 41 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 972494e3-c673-405b-b598-25d707979109

📥 Commits

Reviewing files that changed from the base of the PR and between 1981271 and 8580e04.

📒 Files selected for processing (3)
  • src/index.ts
  • src/routes/candles.ts
  • tests/routes/candles.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch helius-perf-upgrade

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dcccrypto dcccrypto merged commit 06c3482 into main Apr 20, 2026
3 checks passed
@dcccrypto dcccrypto deleted the helius-perf-upgrade branch April 20, 2026 09:40
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.

1 participant