Snap Trade

Tables (10)

account_ledger

  • BIGINT (Id) — Primary key — NOT NULL
  • BIGINT (account_id) — Foreign key → accounts.BIGINT — NOT NULL
  • BIGINT (user_id) — Foreign key → accounts.BIGINT — NOT NULL
  • VARCHAR(30) (entry_type)
  • VARCHAR(20) (asset_symbol)
  • NUMERIC(36, 18) (amount)
  • NUMERIC(36, 18) (balance_before)
  • NUMERIC(36, 18) (balance_after)
  • Datetime (created_at)

accounts

  • BIGINT (Id) — Primary key — NOT NULL
  • BIGINT (user_id) — Foreign key → users.BIGINT — NOT NULL
  • VARCHAR(20) (asset_symbol)
  • NUMERIC(36, 18) (total_balance)
  • NUMERIC(36, 18) (available_balance)
  • NUMERIC(36, 18) (locked_balance)
  • INT (version)
  • Datetime (updated_at)

deposits

  • BIGINT (Id) — Primary key — NOT NULL
  • BIGINT (user_id) — Foreign key → users.BIGINT — NOT NULL
  • VARCHAR(20) (asset_symbol)
  • NUMERIC(36, 18) (amount)
  • VARCHAR(255) (from_address)
  • VARCHAR(255) (to_address)
  • VARCHAR(20) (status)
  • Datetime (created_at)
  • Datetime (confirmed_at)

klines

  • BIGINT (Id) — Primary key — NOT NULL
  • BIGINT (market_id) — Foreign key → markets.BIGINT — NOT NULL
  • VARCHAR(10) (interval)
  • Datetime (open_time)
  • NUMERIC(36, 18) (open)
  • NUMERIC(36, 18) (low)
  • NUMERIC(36, 18) (high)
  • NUMERIC(36, 18) (close)
  • NUMERIC(36, 18) (volume)
  • NUMERIC(36, 18) (quote_volume)
  • Datetime (created_at)

markets

  • BIGINT (Id) — Primary key — NOT NULL
  • VARCHAR(20) (symbol)
  • NUMERIC(36, 18) (min_notional)
  • VARCHAR(10) (status)
  • VARCHAR(20) (base_asset)
  • VARCHAR(20) (quote_asset)
  • NUMERIC(36, 18) (min_price)
  • NUMERIC(36, 18) (tick_size)
  • NUMERIC(36, 18) (min_qty)
  • NUMERIC(36, 18) (step_size)
  • Datetime (created_at)

order_events

  • BIGINT (Id) — Primary key — NOT NULL
  • BIGINT (order_id) — FK
  • BIGINT (trade_id) — FK
  • VARCHAR(30) (event_type)
  • VARCHAR(20) (status_before)
  • VARCHAR(20) (status_after)
  • NUMERIC(36, 18) (fill_qty)
  • NUMERIC(36, 18) (fill_price)
  • String (payload)
  • Datetime (occured_at)

orders

  • BIGINT (Id) — Primary key — NOT NULL
  • BIGINT (user_id) — Foreign key → users.BIGINT — NOT NULL
  • BIGINT (market_id) — Foreign key → markets.BIGINT — NOT NULL
  • VARCHAR(10) (side)
  • VARCHAR(20) (order_type)
  • NUMERIC(36, 18) (price)
  • VARCHAR(20) (time_in_force)
  • NUMERIC(36, 18) (orig_qty)
  • NUMERIC(36, 18) (excuted_qty)
  • NUMERIC(36, 18) (cumulative_quote_qty)
  • VARCHAR(20) (status)
  • BIGINT (sequence_no)
  • Datetime (created_at)
  • Datetime (updated_at)

tickers

  • BIGINT (id) — Primary key — NOT NULL
  • BIGINT (market_id) — Foreign key → markets.BIGINT — NOT NULL
  • NUMERIC(36, 18) (last_price)
  • NUMERIC(36, 18) (price_change)
  • NUMERIC(36, 18) (price_change_pct)
  • NUMERIC(36, 18) (high_24h)
  • NUMERIC(36, 18) (low_24h)
  • NUMERIC(36, 18) (volume_24h)
  • NUMERIC(36, 18) (quote_volume_24h)
  • BIGINT (trade_count_24h)
  • Datetime (updated_at)

trades

  • BIGINT (Id) — Primary key — NOT NULL
  • BIGINT (market_id) — Foreign key → markets.BIGINT — NOT NULL
  • BIGINT (maker_order_id) — Foreign key → orders.BIGINT — NOT NULL
  • BIGINT (buyer_id) — Foreign key → orders.BIGINT — NOT NULL
  • BIGINT (seller_id) — Foreign key → orders.BIGINT — NOT NULL
  • BIGINT (taker_order_id)
  • NUMERIC(36, 18) (price)
  • NUMERIC(36, 18) (quantity)
  • NUMERIC(36, 18) (quote_quantity)
  • NUMERIC(36, 18) (maker_fee)
  • NUMERIC(36, 18) (taker_fee)
  • BIGINT (sequence_no)
  • Datetime (traded_at)

users

  • BIGINT (Id) — Primary key — NOT NULL
  • VARCHAR(20) (name)
  • VARCHAR(30) (email)
  • VARCHAR(255) (password)
  • VARCHAR(20) (status)
  • Datetime (created_at)
  • Datetime (updated_at)