Remove Tiingo spread monitor (indicative two-tier feed, unvalidatable)

Tiingo's free /tiingo/fx/top publishes only a two-tier indicative
spread for gold ($0.10 liquid hours / $0.70 rollover+news; verified on
273 production samples + live probes) — mid ± a posted increment, not
executable depth, so it can never validate the $0.30 backtest cost
assumption. Removed one day after shipping: tiingo_provider.py, the
sampler/quote plumbing in telegram_bot.py, the channel_spread_detail
config knob and tiingo_api_key resolver, and Module 14's Tiingo tests
(221 -> 210). CLAUDE.md documents the verdict: do not re-add a spread
display from Tiingo's free FX feed.

Claude-Session: https://claude.ai/code/session_01BoZKi67Ct6QTeiFJmybXSw
This commit is contained in:
Harwinder Sekhon
2026-07-24 10:56:55 -04:00
parent 3a95a37a0c
commit 7a810c4a4c
6 changed files with 21 additions and 571 deletions
+1 -26
View File
@@ -86,8 +86,7 @@ _VALID_LOG_LEVELS = ("DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL")
_SCANNABLE_TFS = ("M5", "M15", "H1", "H4")
_KNOWN_TOP = {"telegram", "data_providers", "scanning", "pairs", "log_level"}
_KNOWN_TELEGRAM = {"token", "chat_id", "channel_id", "alert_min_quality",
"channel_spread_detail"}
_KNOWN_TELEGRAM = {"token", "chat_id", "channel_id", "alert_min_quality"}
_KNOWN_SCANNING = {"pairs", "timeframes"}
_KNOWN_PAIR_KEYS = {"blocked_hours_utc"}
@@ -102,11 +101,6 @@ class AppConfig:
telegram_chat_id: str = ""
telegram_channel_id: str = "" # "" = channel feed disabled
alert_min_quality: str = "C"
# True = the channel is INTERNAL (testing) and may receive raw Tiingo
# bid/ask numbers. Default False: Tiingo's free tier is licensed
# internal-use-only, so a public/subscriber channel must only ever
# get the number-free wide-spread caution. Flip back before launch.
channel_spread_detail: bool = False
active_provider: str = "twelve_data"
provider_settings: Dict[str, Dict[str, Any]] = field(default_factory=dict)
scan_pairs: List[str] = field(default_factory=lambda: [XAUUSD])
@@ -155,11 +149,6 @@ def load_app_config(path: str = CONFIG_PATH) -> AppConfig:
f'config.json: telegram.alert_min_quality "{quality}" '
f"not in {_VALID_QUALITIES}")
app.alert_min_quality = quality
spread_detail = tg.get("channel_spread_detail", app.channel_spread_detail)
if not isinstance(spread_detail, bool):
raise AppConfigError(
"config.json: telegram.channel_spread_detail must be a boolean")
app.channel_spread_detail = spread_detail
dp = raw.get("data_providers")
if dp is not None:
@@ -282,20 +271,6 @@ def provider_api_key(app: Optional[AppConfig] = None) -> str:
return str(block.get("api_key", ""))
def tiingo_api_key(app: Optional[AppConfig] = None) -> str:
"""Key for the SUPPLEMENTARY Tiingo bid/ask quote provider (spread
monitor) — never a data_providers.active candidate; Twelve Data
stays the OHLCV source. Empty string = feature disabled.
Env TIINGO_API_KEY (or short TIINGO, e.g. from .env) →
config.json data_providers.tiingo.api_key → ""."""
app = app or get_app_config()
env = os.environ.get("TIINGO_API_KEY") or os.environ.get("TIINGO")
if env:
return env
block = app.provider_settings.get("tiingo", {})
return str(block.get("api_key", ""))
# ── PlatformConfig overlay ────────────────────────────────────────────
def apply_pair_overrides(