pongtrader

Tables (13)

broker_accounts

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • broker — VARCHAR(20) — NOT NULL
  • account_type — VARCHAR(10) — NOT NULL
  • appkey — VARCHAR(100) — NOT NULL
  • appsecret — VARCHAR(200) — NOT NULL
  • balance — DECIMAL(15, 2) — NOT NULL
  • balance_synced_at — DATETIME
  • is_active — BOOLEAN — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

holdings

  • id — BIGINT — Primary key — NOT NULL
  • portfolio_id — BIGINT — Foreign key → portfolios.id — NOT NULL
  • stock_id — BIGINT — Foreign key → stocks.id — NOT NULL
  • quantity — INT — NOT NULL
  • average_price — DECIMAL(12, 4) — NOT NULL
  • is_hidden — BOOLEAN — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

oauth_accounts

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • provider — VARCHAR(20) — NOT NULL
  • provider_id — VARCHAR(100) — NOT NULL
  • created_at — DATETIME — NOT NULL

order_executions

  • id — BIGINT — Primary key — NOT NULL
  • order_id — BIGINT — Foreign key → orders.id — NOT NULL
  • quantity — INT — NOT NULL
  • price — DECIMAL(12, 4) — NOT NULL
  • executed_at — DATETIME — NOT NULL

orders

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • strategy_id — BIGINT — Foreign key → strategies.id
  • broker_account_id — BIGINT — Foreign key → broker_accounts.id — NOT NULL
  • stock_id — BIGINT — Foreign key → stocks.id — NOT NULL
  • order_type — VARCHAR(10) — NOT NULL
  • price_type — VARCHAR(10) — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • quantity — INT — NOT NULL
  • price — DECIMAL(12, 4)
  • filled_quantity — INT — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

portfolios

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

stock_candles

  • id — BIGINT — Primary key — NOT NULL
  • stock_id — BIGINT — Foreign key → stocks.id — NOT NULL
  • interval — VARCHAR(10) — NOT NULL
  • trade_time — DATETIME — NOT NULL
  • open_price — DECIMAL(12, 4) — NOT NULL
  • high_price — DECIMAL(12, 4) — NOT NULL
  • low_price — DECIMAL(12, 4) — NOT NULL
  • close_price — DECIMAL(12, 4) — NOT NULL
  • volume — BIGINT — NOT NULL

stock_prices

  • id — BIGINT — Primary key — NOT NULL
  • stock_id — BIGINT — Foreign key → stocks.id — NOT NULL
  • trade_date — DATE — NOT NULL
  • open_price — DECIMAL(12, 4) — NOT NULL
  • high_price — DECIMAL(12, 4) — NOT NULL
  • low_price — DECIMAL(12, 4) — NOT NULL
  • close_price — DECIMAL(12, 4) — NOT NULL
  • volume — BIGINT — NOT NULL

stocks

  • id — BIGINT — Primary key — NOT NULL
  • code — VARCHAR(20) — NOT NULL
  • name — VARCHAR(50) — NOT NULL
  • market — VARCHAR(10) — NOT NULL

strategies

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • broker_account_id — BIGINT — Foreign key → broker_accounts.id — NOT NULL
  • stock_id — BIGINT — Foreign key → stocks.id — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • status — VARCHAR(10) — NOT NULL
  • order_quantity — INT — NOT NULL
  • last_checked_at — DATETIME
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

strategy_conditions

  • id — BIGINT — Primary key — NOT NULL
  • strategy_id — BIGINT — Foreign key → strategies.id — NOT NULL
  • type — VARCHAR(10) — NOT NULL
  • indicator — VARCHAR(50) — NOT NULL
  • params — JSON — NOT NULL
  • created_at — DATETIME — NOT NULL

users

  • id — BIGINT — Primary key — NOT NULL
  • email — VARCHAR(100) — NOT NULL
  • password — VARCHAR(255)
  • nickname — VARCHAR(50) — NOT NULL
  • profile_image — VARCHAR(500)
  • point_balance — BIGINT — NOT NULL
  • role — VARCHAR(20) — NOT NULL
  • login_type — VARCHAR(10) — NOT NULL
  • is_active — BOOLEAN — NOT NULL
  • deleted_at — DATETIME
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

watchlists

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • stock_id — BIGINT — Foreign key → stocks.id — NOT NULL
  • alert_price — DECIMAL(12, 4)
  • created_at — DATETIME — NOT NULL