diff --git a/src/fxhnt/application/bybit_book_eval.py b/src/fxhnt/application/bybit_book_eval.py index f82552d..4112767 100644 --- a/src/fxhnt/application/bybit_book_eval.py +++ b/src/fxhnt/application/bybit_book_eval.py @@ -128,7 +128,7 @@ class _UniverseRestrictedStore: def crypto_spot_panel(self, *, suffix: str = "USDT") -> dict[str, dict[int, float]]: return self._restricted_panel("spot_close", suffix=suffix) - def __getattr__(self, name: str): + def __getattr__(self, name: str) -> Any: # read_panel, close(), and anything else fall through to the inner store unchanged. return getattr(self._inner, name) @@ -212,14 +212,14 @@ def _xsfunding_series(store: _FeatureStore, *, cost_bps: float) -> dict[int, flo captured[int(d)] = rv return orig(daily, days_meta=days_meta) - carry_mod._curve_metrics = _capture # type: ignore[assignment] + carry_mod._curve_metrics = _capture try: # universe=None: the store passed in is ALREADY the universe-restricted proxy, so its panels only # carry the liquid symbols — restricting again here would be a redundant set-intersect over an # already-bounded panel. cost_bps is the per-turnover carry haircut (same as the edge evaluator). carry_metrics_from_store(store, cost_bps=cost_bps, universe=None) finally: - carry_mod._curve_metrics = orig # type: ignore[assignment] + carry_mod._curve_metrics = orig return dict(captured) diff --git a/src/fxhnt/application/bybit_positioning_eval.py b/src/fxhnt/application/bybit_positioning_eval.py index 759b0cf..7c3276b 100644 --- a/src/fxhnt/application/bybit_positioning_eval.py +++ b/src/fxhnt/application/bybit_positioning_eval.py @@ -313,9 +313,10 @@ def positioning_returns_from_store(store: _FeatureStore, *, universe: set[str] | `capacity_capital` / `tail_cap_k` enable the gains-only capacity + tail-concentration haircuts (see `_book_breakdown`); both None (default) → the raw capturable-unaware book, unchanged. `coin_gross_cap` (None default) applies the ex-ante per-coin concentration cap (see `positioning_weights`).""" - return _book_breakdown(store, universe=universe, cost_bps=cost_bps, direction=direction, - capacity_capital=capacity_capital, tail_cap_k=tail_cap_k, - coin_gross_cap=coin_gross_cap)["net"] + net: dict[int, float] = _book_breakdown(store, universe=universe, cost_bps=cost_bps, direction=direction, + capacity_capital=capacity_capital, tail_cap_k=tail_cap_k, + coin_gross_cap=coin_gross_cap)["net"] + return net # Back-compat alias: `positioning_returns` was the original name; keep it pointing at the canonical