chore(snapshot): sync frontend workspace state
This commit is contained in:
19
apps/visualizer/src/features/market/useDlobDepthBands.ts
Normal file
19
apps/visualizer/src/features/market/useDlobDepthBands.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { useMemo } from 'react';
|
||||
import { computeDepthBandsFromDlobL2, type ComputedDlobDepthBandRow } from './dlobDerivedMetrics';
|
||||
import { useDlobL2 } from './useDlobL2';
|
||||
|
||||
const COMPUTED_DLOB_LEVELS = 512;
|
||||
|
||||
export type DlobDepthBandRow = ComputedDlobDepthBandRow;
|
||||
|
||||
export function useDlobDepthBands(
|
||||
marketName: string
|
||||
): { rows: DlobDepthBandRow[]; connected: boolean; error: string | null } {
|
||||
const { l2, connected, error } = useDlobL2(marketName, {
|
||||
levels: COMPUTED_DLOB_LEVELS,
|
||||
grouping: 'raw',
|
||||
});
|
||||
|
||||
const rows = useMemo(() => computeDepthBandsFromDlobL2(l2), [l2]);
|
||||
return { rows, connected, error };
|
||||
}
|
||||
Reference in New Issue
Block a user