토스4
테이블 (15)
alerts
- id — uuid — 기본 키 — NOT NULL
- user_id — uuid — NOT NULL
- signal_id — uuid — 외래 키 → signals.id
- stock_code — varchar(20) — 외래 키 → stocks.stock_code
- title — text — NOT NULL
- message — text
- channel — varchar(20)
- is_read — boolean
- is_sent — boolean
- payload — jsonb
- created_at — timestamptz
- updated_at — timestamptz
candles
- id — bigserial — 기본 키 — NOT NULL
- stock_code — varchar(20) — 외래 키 → stocks.stock_code — NOT NULL
- timeframe — varchar(10) — NOT NULL
- open — numeric(18,2) — NOT NULL
- high — numeric(18,2) — NOT NULL
- low — numeric(18,2) — NOT NULL
- close — numeric(18,2) — NOT NULL
- volume — bigint
- trading_value — numeric(18,2)
- candle_time — timestamptz — NOT NULL
- created_at — timestamptz
- unique(stock_code, — timeframe,
daily_reports
- id — uuid — 기본 키 — NOT NULL
- report_date — date — NOT NULL
- rank — integer — NOT NULL
- stock_code — varchar(20) — 외래 키 → stocks.stock_code — NOT NULL
- stock_name — varchar(100)
- score — numeric(5,2)
- reasons — jsonb
- status — varchar(20)
- result_summary — text
- created_at — timestamptz
- updated_at — timestamptz
- unique(report_date, — rank)
journals
- id — uuid — 기본 키 — NOT NULL
- user_id — uuid — NOT NULL
- trade_id — uuid — 외래 키 → trade_logs.id
- emotion — text
- entry_reason — text
- exit_reason — text
- lesson — text
- score — integer
- ai_summary — text
- created_at — timestamptz
- updated_at — timestamptz
news
- id — uuid — 기본 키 — NOT NULL
- stock_code — varchar(20) — 외래 키 → stocks.stock_code
- title — text — NOT NULL
- source — varchar(50)
- url — text
- content — text
- keywords — text
- published_at — timestamptz
- created_at — timestamptz
orderbooks
- id — bigserial — 기본 키 — NOT NULL
- stock_code — varchar(20) — 외래 키 → stocks.stock_code — NOT NULL
- ask_prices — numeric
- ask_volumes — numeric
- bid_prices — numeric
- bid_volumes — numeric
- total_ask — numeric(18,2)
- total_bid — numeric(18,2)
- timestamp — timestamptz — NOT NULL
- created_at — timestamptz
price_breakouts
- id — uuid — 기본 키 — NOT NULL
- stock_code — varchar(20) — 외래 키 → stocks.stock_code — NOT NULL
- breakout_type — varchar(20) — NOT NULL
- reference_price — numeric(18,2) — NOT NULL
- current_price — numeric(18,2) — NOT NULL
- detected_at — timestamptz — NOT NULL
- created_at — timestamptz
profiles
- id — uuid — 기본 키 — NOT NULL
- nickname — text
- avatar_url — text
- alert_channel — text
- created_at — timestamptz
- updated_at — timestamptz
quotes
- id — bigserial — 기본 키 — NOT NULL
- stock_code — varchar(20) — 외래 키 → stocks.stock_code — NOT NULL
- price — numeric(18,2) — NOT NULL
- open_price — numeric(18,2)
- high_price — numeric(18,2)
- low_price — numeric(18,2)
- volume — bigint
- trading_value — numeric(18,2)
- change_rate — numeric(6,2)
- bid_price — numeric(18,2)
- ask_price — numeric(18,2)
- timestamp — timestamptz — NOT NULL
- created_at — timestamptz
settings
- id — uuid — 기본 키 — NOT NULL
- user_id — uuid — NOT NULL
- max_daily_loss — numeric(18,2)
- risk_per_trade — numeric(5,2)
- profit_target — numeric(5,2)
- stop_loss — numeric(5,2)
- discord_webhook — text
- slack_webhook — text
- created_at — timestamptz
- updated_at — timestamptz
signals
- id — uuid — 기본 키 — NOT NULL
- stock_code — varchar(20) — 외래 키 → stocks.stock_code — NOT NULL
- signal_type — varchar(30) — NOT NULL
- signal_time — timestamptz — NOT NULL
- price — numeric(18,2)
- reference_price — numeric(18,2)
- strength — numeric(5,2)
- reason — text
- is_triggered — boolean
- created_at — timestamptz
stocks
- stock_code — varchar(20) — 기본 키 — NOT NULL
- stock_name — varchar(100) — NOT NULL
- market — varchar(20) — NOT NULL
- sector — varchar(50)
- listed_shares — bigint
- updated_at — timestamptz
- created_at — timestamptz
trade_logs
- id — uuid — 기본 키 — NOT NULL
- user_id — uuid — NOT NULL
- stock_code — varchar(20) — 외래 키 → stocks.stock_code — NOT NULL
- trade_type — varchar(10) — NOT NULL
- order_type — varchar(10)
- price — numeric(18,2)
- quantity — integer
- total_amount — numeric(18,2)
- fee — numeric(18,2)
- profit_rate — numeric(6,2)
- is_simulated — boolean
- memo — text
- traded_at — timestamptz
- created_at — timestamptz
- updated_at — timestamptz
volume_spikes
- id — uuid — 기본 키 — NOT NULL
- stock_code — varchar(20) — 외래 키 → stocks.stock_code — NOT NULL
- current_value — numeric(18,2) — NOT NULL
- avg_value_5d — numeric(18,2) — NOT NULL
- spike_ratio — numeric(10,2) — NOT NULL
- detected_at — timestamptz — NOT NULL
- created_at — timestamptz
watchlists
- id — uuid — 기본 키 — NOT NULL
- user_id — uuid — NOT NULL
- stock_code — varchar(20) — 외래 키 → stocks.stock_code — NOT NULL
- is_active — boolean
- alert_price_above — numeric(18,2)
- alert_price_below — numeric(18,2)
- alert_volume_ratio — numeric(5,2)
- alert_channels — text
- webhook_url — text
- memo — text
- created_at — timestamptz
- updated_at — timestamptz
- unique(user_id, — stock_code)