π Assets & Pricing
Global financial instruments and their pricing sources. Assets are shared across all users β only the transactions referencing them are user-specific.
π ER Diagram
erDiagram
ASSET ||--o{ TRANSACTION : "referenced in"
ASSET ||--o{ PRICE_HISTORY : "has history"
ASSET ||--|| ASSET_PROVIDER_ASSIGNMENT : "priced by"
ASSET {
int id PK
string display_name
string identifier_isin
string identifier_ticker
enum asset_type "STOCK, ETF, BOND..."
string currency
json classification_params
}
PRICE_HISTORY {
int asset_id FK
date date
decimal close_price
decimal open_price
decimal high_price
decimal low_price
int volume
}
ASSET_PROVIDER_ASSIGNMENT {
int asset_id FK
string provider_code
string identifier
json provider_params
}
π Tables
π¦ ASSET
Global definition of a financial instrument. Each asset has a unique combination of identifiers (ISIN, ticker) and belongs to an Asset Type.
- π
classification_params(JSON): Stores flexible metadata like Sector, Geography, and Industry without requiring schema changes. - π°
currency: The asset's native currency (e.g., USD for Apple, EUR for ASML).
π PRICE_HISTORY
Daily OHLCV (Open, High, Low, Close, Volume) price data for each asset. Populated by asset pricing providers.
π ASSET_PROVIDER_ASSIGNMENT
Decouples the asset from its data source. This table configures which provider to use for fetching prices and metadata.
- π Example: "Use Yahoo Finance (
yfinance) for Apple (AAPL)" - βοΈ
provider_params(JSON): Provider-specific configuration (e.g., exchange suffix, custom identifier).
The provider system uses the Registry Pattern for extensibility.
π Related Documentation
- π Asset Types (Financial Theory) β Stock, ETF, Bond, Crypto, etc.
- βοΈ Asset Architecture β How asset prices are fetched and managed
- π Asset Providers List β Available pricing providers