fix(site-finder): volume-weighted median_price_m2 (#1511) + consistent-period MTS (#1512) #1690

Merged
lekss361 merged 1 commit from fix/match-economics-1511-1512 into main 2026-06-17 18:05:15 +00:00

1 commit

Author SHA1 Message Date
6d550e00b2 fix(site-finder): volume-weighted median_price_m2 (#1511) + consistent-period months_to_sellout (#1512)
All checks were successful
CI / changes (push) Successful in 7s
CI / changes (pull_request) Successful in 7s
CI / backend-tests (push) Has been skipped
CI / frontend-tests (push) Has been skipped
CI / openapi-codegen-check (push) Has been skipped
CI / backend-tests (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Has been skipped
#1511: replace equal-weight per-row median with volume-weighted median
(sorted by price, cumulative sold_volume_m2 weight, stop at 50th percentile).
Each corpus×month row now counts proportionally to its deal volume instead of
contributing equal weight regardless of how many flats were sold.

#1512: pin latest_stock to the single most-recent month in the window (last3[0])
instead of per-corpus ROW_NUMBER latest. Stale stock from inactive corpuses no
longer inflates the MTS numerator; stock and sold_volume_m2 denominator now
refer to the same consistent period.

Also clean pre-existing ruff E401/E701/E702/E722 violations (no logic change).
2026-06-17 20:52:47 +03:00