From 45a637f545e7164660c820f31743e5933dc83716 Mon Sep 17 00:00:00 2001 From: u1 Date: Sat, 10 Jan 2026 11:26:13 +0000 Subject: [PATCH] feat(hasura): track derived dlob stats tables --- kustomize/base/hasura/hasura-bootstrap.mjs | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/kustomize/base/hasura/hasura-bootstrap.mjs b/kustomize/base/hasura/hasura-bootstrap.mjs index 7b06f08..3a881b6 100644 --- a/kustomize/base/hasura/hasura-bootstrap.mjs +++ b/kustomize/base/hasura/hasura-bootstrap.mjs @@ -95,6 +95,8 @@ async function main() { const baseTicks = { schema: 'public', name: 'drift_ticks' }; const dlobL2LatestTable = { schema: 'public', name: 'dlob_l2_latest' }; const dlobStatsLatestTable = { schema: 'public', name: 'dlob_stats_latest' }; + const dlobDepthBpsLatestTable = { schema: 'public', name: 'dlob_depth_bps_latest' }; + const dlobSlippageLatestTable = { schema: 'public', name: 'dlob_slippage_latest' }; const baseCandlesFn = { schema: 'public', name: 'get_drift_candles' }; const candlesReturnTable = { schema: 'public', name: 'drift_candles' }; @@ -252,6 +254,47 @@ async function main() { 'updated_at', ]); + await ensureDlobTable(dlobDepthBpsLatestTable, [ + 'market_name', + 'band_bps', + 'market_type', + 'market_index', + 'ts', + 'slot', + 'mid_price', + 'best_bid_price', + 'best_ask_price', + 'bid_base', + 'ask_base', + 'bid_usd', + 'ask_usd', + 'imbalance', + 'raw', + 'updated_at', + ]); + + await ensureDlobTable(dlobSlippageLatestTable, [ + 'market_name', + 'side', + 'size_usd', + 'market_type', + 'market_index', + 'ts', + 'slot', + 'mid_price', + 'best_bid_price', + 'best_ask_price', + 'vwap_price', + 'worst_price', + 'filled_usd', + 'filled_base', + 'impact_bps', + 'levels_consumed', + 'fill_pct', + 'raw', + 'updated_at', + ]); + // Return table type for candle functions (needed for Hasura to track the function). await metadataIgnore({ type: 'pg_track_table', args: { source, table: candlesReturnTable } });