alert service

This commit is contained in:
yash 2026-02-25 23:52:21 +03:00
parent 0e73841b3e
commit 608561ab38
8 changed files with 283 additions and 8 deletions

View file

@ -17,12 +17,15 @@ create table if not exists instrument (
UNIQUE (base_currency_id, quoted_currency_id)
);
create type alert_condition as enum ('above', 'below');
create table if not exists alert (
id uuid primary key not null default gen_random_uuid(),
user_id uuid references users(id) not null,
instrument_id uuid references instrument(id) not null,
price text not null,
active bool not null default true
active bool not null default true,
condition alert_condition not null
);
insert into currency(symbol) values ('USDT'), ('BTC'), ('ETH'), ('SOL');