refactor: telegram + portfolio in-process (drop shared MCP)
Each bot now manages its own notification + portfolio aggregation: * TelegramClient calls the public Bot API directly via httpx, reading CERBERO_BITE_TELEGRAM_BOT_TOKEN / CERBERO_BITE_TELEGRAM_CHAT_ID from env. No credentials → silent disabled mode. * PortfolioClient composes DeribitClient + HyperliquidClient + the new MacroClient.get_asset_price/eur_usd_rate to expose equity (EUR) and per-asset exposure as the bot's own slice (no cross-bot view). * mcp-telegram and mcp-portfolio removed from MCP_SERVICES / McpEndpoints and the cerbero-bite ping CLI; health_check no longer probes portfolio. Docs (02/04/06/07) and docker-compose updated to reflect the new architecture. 353/353 tests pass; ruff clean; mypy src clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ from __future__ import annotations
|
||||
from datetime import UTC, datetime
|
||||
from pathlib import Path
|
||||
|
||||
from cerbero_bite.clients.portfolio import PortfolioClient
|
||||
from cerbero_bite.config import golden_config
|
||||
from cerbero_bite.config.mcp_endpoints import load_endpoints
|
||||
from cerbero_bite.runtime import build_runtime
|
||||
@@ -51,5 +52,8 @@ def test_build_runtime_clients_pinned_to_endpoints(tmp_path: Path) -> None:
|
||||
assert ctx.macro.SERVICE == "macro"
|
||||
assert ctx.sentiment.SERVICE == "sentiment"
|
||||
assert ctx.hyperliquid.SERVICE == "hyperliquid"
|
||||
assert ctx.portfolio.SERVICE == "portfolio"
|
||||
assert ctx.telegram.SERVICE == "telegram"
|
||||
# Portfolio is now an in-process aggregator over deribit/hyperliquid/macro;
|
||||
# it has no SERVICE attribute. Telegram is also in-process and disabled
|
||||
# when env vars are unset.
|
||||
assert isinstance(ctx.portfolio, PortfolioClient)
|
||||
assert ctx.telegram.enabled is False
|
||||
|
||||
Reference in New Issue
Block a user