feat: GET /candles/:slab UDF OHLCV endpoint (Phase 3)#177
Conversation
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>
|
Warning Rate limit exceeded
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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>{ s: "ok"|"no_data"|"error", t, o, h, l, c, v }tradestable on-the-fly via JS bucketing.Works on plain Postgres today; swappable to TimescaleDB continuous
aggregates when applied (see indexer migration).
Paired with frontend
usePercolatorCandleshook inpercolator-launchPR.Test plan
pnpm vitest run— 228 passing, 9 new tests onbucketCandles+ routepnpm tsc --noEmitcleanDependencies
CREATE INDEX IF NOT EXISTS trades_slab_created_at_idx ON trades (slab_address, created_at DESC);to Supabase (tracked in indexer migration20260420_candle_support.sql).🤖 Generated with Claude Code