31ece2e99a
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
22 lines
878 B
SQL
22 lines
878 B
SQL
create table if not exists liquidity_pools (
|
|
id bigserial primary key,
|
|
instrument_id bigint not null references instruments(id),
|
|
timeframe text not null,
|
|
side text not null,
|
|
pool_type text not null,
|
|
price_low numeric(20,10) not null,
|
|
price_high numeric(20,10) not null,
|
|
reference_ids jsonb not null default '[]'::jsonb,
|
|
status text not null default 'untouched',
|
|
created_ts timestamptz not null,
|
|
updated_ts timestamptz not null default now(),
|
|
meta jsonb not null default '{}'::jsonb,
|
|
created_at timestamptz not null default now()
|
|
);
|
|
|
|
create index if not exists idx_liquidity_pools_instr_tf_status_created_desc
|
|
on liquidity_pools (instrument_id, timeframe, status, created_ts desc);
|
|
|
|
create index if not exists idx_liquidity_pools_instr_tf_side_created_desc
|
|
on liquidity_pools (instrument_id, timeframe, side, created_ts desc);
|