docs: record dated dividend cash-flow ledger session (2026-08-27)
This commit is contained in:
1 parent
5b8b6d12b7
commit
377771be65
2 files changed
+26
No files matched your search
@@ -193,6 +193,31 @@ Implement dated dividend events and a provenance-validated PIT score provider be
|
||||
|
||||
---
|
||||
|
||||
## Session 2026-08-27 — Dated dividend cash-flow ledger (verified + pushed)
|
||||
|
||||
**Branch:** main · **HEAD:** 5b8b6d1 (pushed `068dff2` + `5b8b6d1`; backend `068dff2`, frontend `5b8b6d1`)
|
||||
|
||||
### Completed this session (verified + pushed)
|
||||
- **Dated dividend ledger** `backend/app/dividend_ledger.py`: per-symbol dated store with `ex_date` / `record_date` / `pay_date` / `per_share` / `source` / `estimate` flag, validation and persistence. `credit_dividends` credits `per_share × qty` once a payment is due (on/after ex-date and pay date); no ledger entry → no credit (fail closed). `build_dps_ledger` builds per-share estimate rows from the siamchart `ratios.DPS` (price-independent, a step up from the yield % × market-value proxy).
|
||||
- **Backtest integration** `backend/app/backtest.py`: `run_backtest` accepts `dividend_ledger`; `dividend_income` comes from the ledger when set and `dividend_method` reports `dated_ledger` (real rows) | `dps_annual_proxy` (estimate) | `final_holdings_yield_proxy` (legacy, kept when no ledger). `BacktestResult` gained a `dividend_method` field surfaced in `to_dict`.
|
||||
- **API** `backend/app/__init__.py`: `POST /api/v1/backtest` accepts `use_ledger`, wiring the DPS-built ledger (works independently and alongside `use_pit`).
|
||||
- **Frontend** `frontend/src/App.vue`: maps `dividend_method` to an honest Thai label (ปันผล (ตามวันจริง) / ประมาณการปันผล/หุ้น (DPS) / ประมาณการปันผล (Proxy)) and shows a **Proxy** badge whenever the dividend is an estimate, on both the result card and saved-run history rows.
|
||||
|
||||
### Verified
|
||||
- Backend full suite **266 passed** (was 255); new: ledger store/credit (9) + backtest ledger integration (2).
|
||||
- compileall, `git diff --check`, static secret/dangerous scan clean.
|
||||
- Live route probe: `use_ledger:true` → `dividend_method=dps_annual_proxy`, `dividend_income=4151.0` (per-share) vs default proxy `5041.96` (yield×value); price P&L unchanged (5802.89).
|
||||
- Frontend build passes (bundle `index-DDD-F_cZ.js`).
|
||||
|
||||
### Honest scope / known limitations
|
||||
- `build_dps_ledger` rows are **estimates** (no ex-date history in the snapshot) — `dividend_method=dps_annual_proxy`, flagged Proxy in UI. A symbol only reports `dated_ledger` once real ex-date/per-share history is collected for it.
|
||||
- Ledger credit is end-of-run on final holdings for this milestone (not mid-window on holdings-at-ex-date); a future pass can accrue per rebalance window as ex-date history arrives.
|
||||
|
||||
### Exact next action
|
||||
Add a real per-stock **dividend-history collector** (siamchart `/stock-info/<SYMBOL>/`) that appends dated payments into the ledger so symbols can upgrade from `dps_annual_proxy` to `dated_ledger`. In parallel, add the **siamchart vintage chain** to un-partial the fundamental dimension. Do not reset or stage unrelated pre-existing working-tree changes.
|
||||
|
||||
---
|
||||
|
||||
## Session 2026-08-27 — PIT factor store + partial PIT score provider (verified + pushed)
|
||||
|
||||
**Branch:** main · **HEAD:** 1f630be (pushed `1b971ac..1f630be`)
|
||||
|
||||
Reference in new issue
Block a user