Add equity candle aggregation pipeline
This commit is contained in:
parent
f889a2597b
commit
a87df21baa
13 changed files with 1188 additions and 10 deletions
29
packages/storage/src/equity-candles.ts
Normal file
29
packages/storage/src/equity-candles.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import type { EquityCandle } from "@islandflow/types";
|
||||
|
||||
export const EQUITY_CANDLES_TABLE = "equity_candles";
|
||||
|
||||
export const equityCandlesTableDDL = (): string => {
|
||||
return `
|
||||
CREATE TABLE IF NOT EXISTS ${EQUITY_CANDLES_TABLE} (
|
||||
source_ts UInt64,
|
||||
ingest_ts UInt64,
|
||||
seq UInt64,
|
||||
trace_id String,
|
||||
ts UInt64,
|
||||
interval_ms UInt32,
|
||||
underlying_id String,
|
||||
open Float64,
|
||||
high Float64,
|
||||
low Float64,
|
||||
close Float64,
|
||||
volume UInt64,
|
||||
trade_count UInt32
|
||||
)
|
||||
ENGINE = MergeTree
|
||||
ORDER BY (underlying_id, interval_ms, ts)
|
||||
`;
|
||||
};
|
||||
|
||||
export const normalizeEquityCandle = (candle: EquityCandle): EquityCandle => {
|
||||
return candle;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue