Add event bus and storage layer
This commit is contained in:
parent
9ba51d8e96
commit
488ae82ed6
19 changed files with 537 additions and 21 deletions
29
packages/storage/src/option-prints.ts
Normal file
29
packages/storage/src/option-prints.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import type { OptionPrint } from "@islandflow/types";
|
||||
|
||||
export const OPTION_PRINTS_TABLE = "option_prints";
|
||||
|
||||
export const optionPrintsTableDDL = (): string => {
|
||||
return `
|
||||
CREATE TABLE IF NOT EXISTS ${OPTION_PRINTS_TABLE} (
|
||||
source_ts UInt64,
|
||||
ingest_ts UInt64,
|
||||
seq UInt64,
|
||||
trace_id String,
|
||||
ts UInt64,
|
||||
option_contract_id String,
|
||||
price Float64,
|
||||
size UInt32,
|
||||
exchange String,
|
||||
conditions Array(String)
|
||||
)
|
||||
ENGINE = MergeTree
|
||||
ORDER BY (ts, option_contract_id)
|
||||
`;
|
||||
};
|
||||
|
||||
export const normalizeOptionPrint = (print: OptionPrint): OptionPrint => {
|
||||
return {
|
||||
...print,
|
||||
conditions: print.conditions ?? []
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue