MarketQuoteSnapshot
A market quote snapshot stores the closing price of a single symbol on a single trading date.
Purpose
Section titled “Purpose”Market data is fetched from an external provider and cached locally so charts can be rendered without re-querying the provider on every request. One row is one symbol on one day; the symbol plus trading_date pair is unique, which lets the service upsert a fetched series idempotently.
The model is written and read exclusively by the markets service and its pruning command.
app/Services/MarketsDataService.php— upserts fetched series, reads them back for charts, and replaces a symbol’s history wholesale.app/Console/Commands/MarketsPruneCommand.php— trims stored history.
Relationships
Section titled “Relationships”This model declares no Eloquent relationships.
Data shape
Section titled “Data shape”Table: market_quote_snapshots.
| Column | Type | Notes |
|---|---|---|
id |
bigint |
Auto-increment primary key |
symbol |
string(16) |
Ticker symbol |
trading_date |
date |
Cast to date |
close |
decimal(20,6) |
Cast to float |
created_at, updated_at |
timestamp |
symbol and trading_date are unique together and also carry a composite index. There is no organization_id — this is shared reference data, not tenant data.