feat: cockpit

This commit is contained in:
OpenSquared
2026-07-21 16:48:12 +02:00
parent 24e5e4b03b
commit b6e9b96dc4
10 changed files with 644 additions and 142 deletions

View File

@@ -919,6 +919,31 @@ export const useIvForTrade = (underlying: string) =>
staleTime: 60 * 60_000,
})
// ── Saxo-only IV analytics (Options Lab "Saxo" section) — computed from our own
// accumulated saxo_option_snapshots, never blended with the yfinance-based hooks above ──
export const useSaxoIvWatchlist = () =>
useQuery({
queryKey: ['saxo-iv-watchlist'],
queryFn: () => api.get('/saxo/iv-watchlist').then(r => r.data),
staleTime: 5 * 60_000,
})
export const useSaxoIvSnapshot = (symbol: string) =>
useQuery({
queryKey: ['saxo-iv-snapshot', symbol],
queryFn: () => api.get(`/saxo/iv-snapshot/${encodeURIComponent(symbol)}`).then(r => r.data),
enabled: !!symbol,
staleTime: 5 * 60_000,
})
export const useSaxoIvHistory = (symbol: string, days = 90) =>
useQuery({
queryKey: ['saxo-iv-history', symbol, days],
queryFn: () => api.get(`/saxo/iv-history/${encodeURIComponent(symbol)}`, { params: { days } }).then(r => r.data),
enabled: !!symbol,
staleTime: 5 * 60_000,
})
// ── Analytics Phase 4 — Bayesian + Clustering + Embeddings ───────────────────
export const useBayesianPosteriors = () =>