diff --git a/src/fxhnt/application/bybit_testnet_run.py b/src/fxhnt/application/bybit_testnet_run.py index 3979d9c..ae63f15 100644 --- a/src/fxhnt/application/bybit_testnet_run.py +++ b/src/fxhnt/application/bybit_testnet_run.py @@ -17,6 +17,7 @@ from typing import Any # `latest_raw_sleeve_weights` / `combined_symbol_weights` are imported at MODULE level (not locally like the # other body deps) so tests can `monkeypatch.setattr(run_mod, "latest_raw_sleeve_weights", ...)`. +from fxhnt.application.bybit_forward_track import POSITIONING_COIN_GROSS_CAP from fxhnt.application.bybit_paper_book import combined_symbol_weights, latest_raw_sleeve_weights @@ -112,9 +113,14 @@ def run_bybit_testnet(settings: Any, *, paper_envelope: float, execute: bool, try: universe = _testnet_universe(store) unlock_events = _testnet_unlock_events(s) - weights = latest_raw_sleeve_weights(store, universe=universe, unlock_events=unlock_events) + # Cap the executed testnet positions the SAME way the modeled/forward/paper-book paths do, so a single + # over-short coin can't take an outsized real position (the reconciled return is capped; the executed + # position must match). POSITIONING_COIN_GROSS_CAP is the ex-ante per-coin weight cap (0.07). + weights = latest_raw_sleeve_weights(store, universe=universe, unlock_events=unlock_events, + positioning_coin_gross_cap=POSITIONING_COIN_GROSS_CAP) _combined, as_of_day = combined_symbol_weights( - store, universe=universe, unlock_events=unlock_events) + store, universe=universe, unlock_events=unlock_events, + positioning_coin_gross_cap=POSITIONING_COIN_GROSS_CAP) marks = _testnet_marks(store, universe=universe) finally: store.close()