feat: raise market_api rate to 20/min, add global Polygon cap at 45/min, add rate-limit API + watchlist warning

This commit is contained in:
Celes Renata
2026-04-16 07:26:10 +00:00
parent 0b3ab4ed90
commit 0ee7f26633
5 changed files with 148 additions and 9 deletions
+18
View File
@@ -717,6 +717,24 @@ export function useTrendProjection(trendId: string | undefined) {
return useGet<TrendProjection>(['trend-projection', trendId], 'query', `/api/trends/${trendId}/projection`, !!trendId);
}
// ---------------------------------------------------------------------------
// System: Rate Limits
// ---------------------------------------------------------------------------
export interface RateLimitInfo {
polygon_global_limit: number;
market_api: {
rate_per_minute: number;
cadence_seconds: number;
max_tickers_per_cycle: number;
active_sources: number;
};
}
export function useRateLimits() {
return useGet<RateLimitInfo>(['rate-limits'], 'query', '/api/system/rate-limits');
}
// ---------------------------------------------------------------------------
// Macro: Admin Toggle (Task 17.6)
// ---------------------------------------------------------------------------