mirror of
https://github.com/carey314/mio-plugin-fund.git
synced 2026-08-10 05:44:31 +00:00
fix(etf): exclude LOF prefixes from ETF code routing
Prior `150...199` range caught 161/162/163/165/166/167/168/169 which are LOF (open-end fund traded on-exchange but priced by 1-day NAV, not intraday ticks). Routing LOF codes through ETFClient pulled stale/wrong-shape data from the Sina sz endpoint. Explicit-deny LOF prefixes; preserve legacy range for everything else. P0 from 2026-05-19 code review. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f485093a52
commit
b5f0d2d660
@ -68,7 +68,19 @@ actor ETFClient {
|
||||
static func isETFCode(_ code: String) -> Bool {
|
||||
guard code.count == 6, let n = Int(code) else { return false }
|
||||
let prefix = n / 1000
|
||||
// P0 fix (2026-05-19 review): the prior `150...199` range was
|
||||
// too wide — it caught LOF codes that aren't ETFs:
|
||||
// 161xxx 兴全 LOF / 162xxx 黄金 LOF / 163xxx 招商 LOF
|
||||
// 165xxx 银华 LOF / 166xxx 中欧 LOF / 167xxx 中海 LOF
|
||||
// 168xxx, 169xxx 多家 LOF
|
||||
// LOFs trade by 1-day NAV pricing, not by ETF intraday quote
|
||||
// ticks. Routing them through ETFClient would surface stale
|
||||
// or wrong-shaped data on the holding row.
|
||||
// Explicit-deny the LOF prefixes; keep everything else in the
|
||||
// legacy range routing for backwards compat.
|
||||
switch prefix {
|
||||
case 161, 162, 163, 165, 166, 167, 168, 169:
|
||||
return false
|
||||
case 510...599, 150...199:
|
||||
return true
|
||||
default:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user