feat: wavelets
This commit is contained in:
@@ -1852,6 +1852,28 @@ export const useUpdateSaxoSettings = () => {
|
||||
})
|
||||
}
|
||||
|
||||
// Wavelet Watchlist refresh — Saxo-priced quotes + wavelet recompute, own cadence
|
||||
// (services/wavelet_scheduler.py), independent of the once-a-day auto_cycle.
|
||||
export const useWaveletRefreshSettings = () =>
|
||||
useQuery<{ enabled: boolean; refresh_minutes: number }>({
|
||||
queryKey: ['wavelet-refresh-settings'],
|
||||
queryFn: () => api.get('/wavelet/refresh-settings').then(r => r.data),
|
||||
})
|
||||
|
||||
export const useUpdateWaveletRefreshSettings = () => {
|
||||
const qc = useQueryClient()
|
||||
return useMutation({
|
||||
mutationFn: (settings: { enabled: boolean; refresh_minutes: number }) =>
|
||||
api.put('/wavelet/refresh-settings', settings).then(r => r.data),
|
||||
onSuccess: () => qc.invalidateQueries({ queryKey: ['wavelet-refresh-settings'] }),
|
||||
})
|
||||
}
|
||||
|
||||
export const useWaveletRefreshNow = () =>
|
||||
useMutation({
|
||||
mutationFn: () => api.post('/wavelet/refresh-now').then(r => r.data as { signal_rows: number }),
|
||||
})
|
||||
|
||||
export type SaxoSnapshotRow = {
|
||||
id: string; symbol: string; snapshot_date: string; spot: number | null
|
||||
expiry_date: string; strike: number; option_type: 'call' | 'put'
|
||||
|
||||
Reference in New Issue
Block a user