diff --git a/frontend/components/dashboard/ScanTerminalDashboard.tsx b/frontend/components/dashboard/ScanTerminalDashboard.tsx index 759694dc..ff98e640 100644 --- a/frontend/components/dashboard/ScanTerminalDashboard.tsx +++ b/frontend/components/dashboard/ScanTerminalDashboard.tsx @@ -142,6 +142,34 @@ function getSideRow( return null; } +function getDetailSideAsk( + scanRow: ScanOpportunityRow | null, + marketScan: MarketScan | null | undefined, + side: "yes" | "no", +) { + if (scanRow?.ask != null) return scanRow.ask; + if (side === "yes") { + if (scanRow?.yes_ask != null) return scanRow.yes_ask; + return marketScan?.yes_buy ?? null; + } + if (scanRow?.no_ask != null) return scanRow.no_ask; + return marketScan?.no_buy ?? null; +} + +function getDetailSideBid( + scanRow: ScanOpportunityRow | null, + marketScan: MarketScan | null | undefined, + side: "yes" | "no", +) { + if (scanRow?.bid != null) return scanRow.bid; + if (side === "yes") { + if (scanRow?.yes_bid != null) return scanRow.yes_bid; + return marketScan?.yes_sell ?? null; + } + if (scanRow?.no_bid != null) return scanRow.no_bid; + return marketScan?.no_sell ?? null; +} + function buildComparisonBuckets( marketScan: MarketScan | null | undefined, row: ScanOpportunityRow | null, @@ -396,24 +424,30 @@ function DetailPanel({ {isEn ? "Buy Yes" : "买入 Yes"} {displayRow.target_label || ""}
- {formatPrice(yesRow?.ask ?? marketScan?.yes_buy)} →{" "} + {formatPrice(getDetailSideAsk(yesRow, marketScan, "yes"))} →{" "} {formatProbability(yesRow?.model_probability)}
{formatPercent(yesRow?.edge_percent, true)} {isEn ? "edge" : "边际优势"}
-{isEn ? "Spread" : "点差"} {formatPrice(yesRow?.spread)}
++ {isEn ? "Bid / Ask" : "买卖价"} {formatPrice(getDetailSideBid(yesRow, marketScan, "yes"))} /{" "} + {formatPrice(getDetailSideAsk(yesRow, marketScan, "yes"))} +
- {formatPrice(noRow?.ask ?? marketScan?.no_buy)} →{" "} + {formatPrice(getDetailSideAsk(noRow, marketScan, "no"))} →{" "} {formatProbability(noRow?.model_probability)}
= 0 ? "positive" : "negative"}> {formatPercent(noRow?.edge_percent, true)} {isEn ? "edge" : "边际优势"}
-{isEn ? "Spread" : "点差"} {formatPrice(noRow?.spread)}
++ {isEn ? "Bid / Ask" : "买卖价"} {formatPrice(getDetailSideBid(noRow, marketScan, "no"))} /{" "} + {formatPrice(getDetailSideAsk(noRow, marketScan, "no"))} +