주식 API 만들기

테이블 (5)

모의투자 (simulation_sessions)

  • id (pk) — Integer — 기본 키 — NOT NULL
  • 사용자id (user_id) — Integer — 외래 키 → 사용자.사용자id — NOT NULL
  • 코인id (coin_id) — Integer — 외래 키 → 코인정보.코인id — NOT NULL
  • 세션 상태 (status) — varchar(20)
  • 초기 자산 (initial_balance) — decimal(30,10)
  • 진행 시간 (duration_seconds) — int
  • 과거 차트 시작 시점 (replay_start_time) — datetime
  • 과거 차트 종료 시점 (replay_end_time) — datetime
  • 현재 챁트 재생 위치 (palyback_speed) — decimal(5,2)
  • 실제 세션 시작 시간 (ended_at) — datetime
  • 실제 세션 종료 시간 (Field10) — datetime

모의투자 계좌 (simulation_accounts)

  • Key — 기본 키 — NOT NULL

사용자 (users)

  • 사용자id (user_id) — Integer — 기본 키 — NOT NULL
  • 비밀번호 (password) — varchar(255)
  • 닉네임 (nickname) — varchar(50)
  • 생성일 (created_at) — datetime
  • 이메일 (email) — varcchar(255)

캔들데이터 (market_candles)

  • id (pk) — Integer — 기본 키 — NOT NULL
  • 코인id (coin_id) — Integer — 외래 키 → 코인정보.코인id — NOT NULL
  • 캔들 간격 (interval) — int
  • 캔들 시작 시간 (candle_time) — datetime — UTC 기준
  • 시가 (open_price) — decimal(30,10)
  • 고가 (high_price) — decimal(30,10)
  • 저가 (low_price) — decimal(30,10)
  • 종가 (close_price) — decimal(30,10)
  • 거래량 (volume) — decimal(30,10)

코인정보 (coins)

  • 코인id (coin_id) — Integer — 기본 키 — NOT NULL
  • 거래소 (exchange) — varchar(30)
  • 심볼 (symbol) — varchar(20)
  • 코인이름 (coin_name) — varchar(100)
  • 거래 가능 여부 (is_active) — boolean