feat: add 1h and 1d lowest available price candles#12
Draft
us-oyster wants to merge 4 commits into
Draft
Conversation
us-oyster
force-pushed
the
agent/product-price-candles
branch
from
July 21, 2026 07:29
12d08e6 to
c63c9c4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds end-to-end 1-hour and 1-day OHLC price candles for canonical products. PriceAI now records the lowest eligible purchasable price every 15 minutes, serves cached public chart APIs, renders compact candles on
/channels, and renders an interactive detail chart on/products/[id].Price definition
min_order_quantity <= 1.shared_access,web_only_account, anddomestic_mirror_site.Data model
product_price_samples.product_price_candlesfor1hand Asia/Shanghai calendar-day1dOHLC.service_roleonly.UI
/channels: one global1小时 / 1天switch and one batch request for all matching products, with lightweight SVG candles on desktop and mobile./products/[id]: dynamically importslightweight-charts@5.2.0after mount and supports crosshair, touch/mouse interaction, zoom, drag, reset, and OHLC/sample tooltips.Performance
Validation
npm run test:price-historynpm run test:price-history-db(Docker PostgreSQL with the realschema.sql)npm run test:price-history-apinpm run lint(one pre-existing warning)npm run typechecknpm testnpm run check:performancenpm run check:recovery-baselinenode scripts/verify-supabase-recovery-baseline.mjs --dockernpm run audit:licensesnpm run buildnpm run build:cloudflareDatabase coverage includes eligibility filters, two confirmations, multi/single-sample OHLC, delayed and duplicate sampling, product/currency isolation, gaps, Asia/Shanghai day boundaries, historical reads without a current quote, and protected retention.
Screenshots
Validated with deterministic local fixtures. No production data is included.
Channels desktop - 1-day candles
Channels mobile - 1-hour candles
Product detail desktop - 1-day chart and tooltip
Product detail mobile - 1-hour chart and tooltip
Additional states validated locally: no-history and current-price-missing.
Limitations
1hand1d.Rollout
20260720220000_product_price_history.sql.action=samplerun and verify samples/candles/API output.Rollback should stop the scheduled jobs first and roll back the application. Keep the new history tables in place; no destructive down migration is required.