from dataclasses import dataclass
from enum import Enum, auto


@dataclass(frozen=True)
class Quote:
  timestamp: int
  open: float
  high: float
  low: float
  close: float
  volume: int  # todo: crypto volume is float


class SecurityType(Enum):
  CRYPTO = auto()
  EQUITY = auto()
  FUTURE = auto()
  OPTION = auto()


@dataclass(frozen=True)
class Instrument:
  symbol: str
  security_type: SecurityType
  multiplier: int


@dataclass
class Position:
  instr: Instrument
  quantity: int  # todo: crypto has fractional shares
  price: float
