From b380283204d663c17fd2eb92da0359fa273f7acc Mon Sep 17 00:00:00 2001 From: Codex Date: Sun, 12 Jul 2026 12:32:34 +0200 Subject: [PATCH] =?UTF-8?q?uv(parity):=20phase-2=20crawl=20=E2=80=94=20ful?= =?UTF-8?q?l=20TP/SL=20codepath=20inventory=20(cubic=20curve,=205=20SL=20m?= =?UTF-8?q?echanisms,=20AdvancedSL=20LIVE-confirmed)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UV_EXIT_DOCTRINE_PARITY_PASS_20260712.md | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/prod/docs/uv_cert/UV_EXIT_DOCTRINE_PARITY_PASS_20260712.md b/prod/docs/uv_cert/UV_EXIT_DOCTRINE_PARITY_PASS_20260712.md index 170e2cf..a9ee1c8 100644 --- a/prod/docs/uv_cert/UV_EXIT_DOCTRINE_PARITY_PASS_20260712.md +++ b/prod/docs/uv_cert/UV_EXIT_DOCTRINE_PARITY_PASS_20260712.md @@ -63,3 +63,54 @@ argument; today UV would exit on intra-bar spikes BLUE never sees. 4. Align check order (TP_FLOOR → TP → SL → MAX_HOLD) or document the tie rule. 5. Price-basis equivalence: OBF-mid feed for the ticker (C11) or a measured BingX-mark-vs-OBF-mid divergence bound in the dossier. + +--- +## PHASE 2 — full codepath crawl (operator: "assume you are a py parser") + +The matrix above UNDERSTATED both mechanisms. Live-verified inventory +(BLUE process 431423 env checked directly): + +### TP — the full stack (transcription order) +1. **Base**: `fixed_tp_pct=0.0020` (ENGINE_KWARGS trader:134). +2. **Soft cubic curve** `prod/clean_arch/tp_curve.py` (64 lines, pure): + `tp = clamp(base − 0.00013·(clamp(our_lev/2,0,1))³, floor=0.00187, base)`; + `our_leverage = notional/capital` (SYSTEM leverage, not exchange). + Applied via `_tp_curve_context` (trader:805) → `_sync_tp_threshold` + (trader:906) → `eng.set_live_tp_pct` per loop. ALSO published to HZ + `DOLPHIN_FEATURES["live_tp_threshold"]`. +3. **OB modulation** ×1.40 cascade / ×0.60 withdrawal / ×0.75 per-asset + (alpha_exit_manager:177-207) on top of the curve output. +4. **TP_FLOOR ratchet** (aem:232, DOLPHIN_TP_FLOOR=ON). +5. Evaluation price: OBF WS mid injection (trader:932). + +### SL — the mechanisms (all LIVE, transcription order) +1. **Catastrophic floor** 0.0120 (env DOLPHIN_CATASTROPHIC_FLOOR_PCT), + armed per-trade at setup (trader:2022/2287). +2. **Overlay floor** 0.0050 + **USD max-loss $500** (env, trader:464-470) + for LONG-overlay positions; `_catastrophic_floor_for_open_position` + (trader:2496) picks base vs overlay + converts USD cap to pct; + ratchet only tightens (trader:2486-2488). +3. **Bucket SL table** `_BUCKET_SL_PCT` (trader:242): 7 vol/corr buckets + 0.008–0.030 — hibernate-protect mode only (trader:2424). +4. **Withdrawal-stress hard SL 0.10** (aem:186). +5. **AdvancedSLRuntime** `adaptive_exit/advanced_sl.py` (1203 lines) — + **CONFIRMED LIVE** (`DOLPHIN_ENABLE_ADVANCED_SL_LIVE=1` in process env; + snapshot /mnt/dolphin_training/advanced_sl/latest_advanced_sl.json; + evaluate() at trader:4847, HZ-bound :2589). Scoring machine: momentum, + stall-fraction, mean-reversion snapback, market-support, V7-forecast, + pnl-decay → decisions. NOT yet parsed line-by-line — next session's + first target, then the whole stack transcribes to UV ticker qua timing + (1s ticks; curve inputs notional/capital via E-feed; OB fields via the + MAX_HOLD ingress codex built), then test-to-death per mechanism. + +### Transcription plan (UV side) +- tp_curve.py is PURE and dependency-free → vendor/import as-is into UV + ticker: recompute effective TP per tick from live notional/capital. +- OB modulation + TP_FLOOR: extend MaxHoldIngress → ExitIngress (already + carries cascade/regime/imbalance/withdrawal) — one ingress, all exits. +- SL: catastrophic floor = present (1.2%); add overlay-floor/USD-cap hooks + (UV has no LONG overlay yet — stub with loud NA); bucket table only if + hibernate mode ports; AdvancedSL LAST (biggest, needs its own pass). +- Tie order: adopt BLUE's TP_FLOOR→TP→SL→MAX_HOLD exactly. +- Tests: per-mechanism suites, mutation-RED each branch, curve property + tests (monotonic in lev, floor/cap clamps, poison inputs).