Skip to content

Class Diagram

The diagram below focuses on core SQLAlchemy model classes (src/ft/core/models) and their primary relationships.

classDiagram
  direction LR

  class Chain {
    +uuid chain_id
    +str slug
    +str display_name
  }
  class Network {
    +uuid network_id
    +uuid chain_id
    +str slug
    +int finality_depth
    +bool is_active
  }
  class TokenStandard {
    +uuid standard_id
    +uuid chain_id
    +str slug
  }
  class Marketplace {
    +uuid marketplace_id
    +uuid network_id
    +str slug
  }

  class RawEventRecord {
    +uuid raw_event_id
    +uuid network_id
    +str source_event_id
    +str finality_status
  }
  class NormalizedEvent {
    +uuid normalized_event_id
    +uuid network_id
    +uuid asset_id
    +str event_kind
    +str finality_status
  }
  class NormalizedEventKey {
    +int id
    +str source_event_id
    +int sub_index
    +uuid normalized_event_id
  }
  class NormalizedEventDelta {
    +int id
    +uuid normalized_event_id
    +str account_address
    +int qty_delta
  }
  class AppliedEvent {
    +str consumer_id
    +uuid normalized_event_id
  }

  class Collection {
    +uuid collection_id
    +uuid network_id
    +str contract_address
  }
  class Asset {
    +uuid asset_id
    +uuid collection_id
    +str token_id
  }

  class OutboxEvent {
    +uuid event_id
    +str topic
    +json payload
  }
  class DeadLetterItem {
    +uuid dlq_id
    +uuid event_id
    +int attempts
  }
  class SyncCursor {
    +uuid network_id
    +int last_block
  }
  class ApiKey {
    +uuid key_id
    +str key_hash
    +bool is_active
  }

  Chain "1" --> "*" Network
  Chain "1" --> "*" TokenStandard
  Network "1" --> "*" Marketplace

  Network "1" --> "*" RawEventRecord
  Network "1" --> "*" NormalizedEvent
  NormalizedEvent "1" --> "*" NormalizedEventKey
  NormalizedEvent "1" --> "*" NormalizedEventDelta
  NormalizedEvent "1" --> "*" AppliedEvent

  Network "1" --> "*" Collection
  Collection "1" --> "*" Asset

  Network "1" --> "1" SyncCursor
  OutboxEvent "1" --> "*" DeadLetterItem

Notes

  • Physical storage layout is schema-separated (ref, ingest, ledger, catalog, market, projection, system).
  • Exact column/index definitions are in migrations/001_baseline.sql.