2360c501e4
- New 'intraday_bars' endpoint in PolygonMarketAdapter: fetches hourly bars for today using range_bars URL with timespan=hour, sort=asc - Scheduler expands intraday_bars global source into per-ticker jobs for all active companies (every 15 minutes via polling_interval) - Migration 025 inserts the intraday source with 900s cadence - Frontend price matching uses closest-timestamp instead of date-string matching, with 2h tolerance for intraday and 36h for daily windows - Bumped market price fetch limit to 200 for intraday granularity
16 lines
585 B
SQL
16 lines
585 B
SQL
-- Add intraday market data source (hourly bars via Polygon range endpoint).
|
|
-- The scheduler expands this into per-ticker jobs every 15 minutes.
|
|
|
|
INSERT INTO sources (source_type, source_name, config, active, company_id)
|
|
SELECT
|
|
'market_api',
|
|
'Polygon Intraday Hourly',
|
|
'{"endpoint": "intraday_bars", "provider": "polygon", "timespan": "hour", "multiplier": 1, "adjusted": true, "polling_interval_seconds": 900}'::jsonb,
|
|
true,
|
|
NULL
|
|
WHERE NOT EXISTS (
|
|
SELECT 1 FROM sources
|
|
WHERE source_type = 'market_api'
|
|
AND config->>'endpoint' = 'intraday_bars'
|
|
);
|