"""LivePrice port — a thin read-only price source for the paper cockpit's mark-to-market. Tests inject
`FakeLivePrice`; production uses the ccxt adapter. Implementations MUST NOT raise on a fetch hiccup (the web
layer marks to last-good prices instead — never 500 the page)."""
from __future__ import annotations
from typing import Protocol


class LivePrice(Protocol):
    def get_prices(self, symbols: list[str]) -> dict[str, float]: ...


class FakeLivePrice:
    def __init__(self, prices: dict[str, float]) -> None:
        self._p = prices

    def get_prices(self, symbols: list[str]) -> dict[str, float]:
        return {s: self._p[s] for s in symbols if s in self._p}
