Commit Graph

112 Commits

Author SHA1 Message Date
jgrusewski
8da219dfa3 docs: plan — IBKR consolidation (OPRA-backed XSP-VRP + UCITS routing), 9 tasks
Component A (Tasks 1-7): VRP on real OPRA data — pure BS/IV/parity helpers, OPRA
options adapter path, xsp_option_bars PIT table+repo, VrpStrategy defined-risk ladder
recomputed off frozen bars, registry+anchor, vrp_nav asset (freeze slice + real ref),
IBKR XSP mleg exec twin (SUSPENDED). Component B (Task 8): US->UCITS execute routing
(--venue ucits) + suspended monthly CronJob. Task 9: local cockpit verify.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 22:46:16 +02:00
jgrusewski
938ea3f0cd docs: spec — IBKR consolidation (OPRA-backed XSP-VRP + UCITS multistrat routing)
One fused venue-consolidation spec, two bounded components, execution coded-but-suspended:

- Component A (centerpiece): a `vrp` sleeve rebuilt on REAL OPRA option data (XSP
  put-credit-spreads, 2013→). Databento OPRA.PILLAR verified empirically (XSP/SPX bars
  back to 2013-04-01). Put-call-parity forward + IV-inversion 20Δ strike + real-mark
  defined-risk P&L, frozen into an xsp_option_bars PIT table. Wired to forward engine +
  reconciliation gate + merged CVaR sizing + cockpit. Supersedes the parked flat-VIX
  synthetic spec (biased placeholder).
- Component B (thin): UCITS-legal execution routing for the existing multistrat — modeled
  track UNCHANGED (models US underlyings, long history); adds a US→UCITS instrument map +
  `--venue ucits` execute path. PRIIPs blocks US ETFs on a Dutch retail account.

Both exec legs ship SUSPENDED (C1/C2/C3 pattern) — neither XSP options nor UCITS-Euronext
can be paper-executed on the US-style DU9600528 account. Crypto stays structurally on Bybit
(perp edges; IBKR can't host). Marks 2026-07-11 synthetic-VRP spec SUPERSEDED.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 22:38:41 +02:00
jgrusewski
a68a3ff929 docs: spec — defined-risk equity-VRP modeled sleeve (SPY put-credit-spreads, recompute)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-11 21:21:45 +02:00
jgrusewski
884183a959 docs: plan — resolve Task 5 test-file reference
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-11 19:54:03 +02:00
jgrusewski
58d16db332 docs: plan — configurable ceiling + CVaR-aware sizing (B2a)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-11 19:53:35 +02:00
jgrusewski
55cd3af22b docs: spec fix — preserve vol-degenerate k_vol=0 fallback (CVaR is a pure floor)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-11 19:51:05 +02:00
jgrusewski
b73c3a5228 docs: spec — configurable paper/live capital ceiling + CVaR-aware ex-ante sizing (B2a)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-11 19:48:51 +02:00
jgrusewski
503cc47612 docs: plan — unified execution-CLI + paper envelope + exec-venue (C3, single plan)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-11 00:20:54 +02:00
jgrusewski
a88d017170 docs: spec — unify execution on CLI (bybit port) + paper envelope + exec-venue (C3, single spec)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-11 00:17:34 +02:00
jgrusewski
195955b2c8 docs: plan — paper-validation envelope + exec-venue recording (C3)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-11 00:09:41 +02:00
jgrusewski
5a601cad4f docs: spec — bybit paper-envelope via explicit Dagster Config (symmetric w/ CLI flag)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-11 00:04:52 +02:00
jgrusewski
0a126754eb docs: spec — paper-validation envelope + real exec-venue recording (C3)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 23:57:12 +02:00
jgrusewski
c39d80745c docs: plan — cockpit surfacing + mobile redesign, 6 tasks
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 11:56:21 +02:00
jgrusewski
e508f71aa5 docs: spec — cockpit surfacing + mobile redesign (observability layer)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 11:48:58 +02:00
jgrusewski
5a93176f12 docs: plan — Bybit execution leg (C2), 5 tasks (funding-net envelope-basis exec track)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 10:04:37 +02:00
jgrusewski
6639db22fe docs: spec — Bybit execution leg (C2), B2a/B3-driven envelope + funding-net observed track
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 09:42:45 +02:00
jgrusewski
a16c8e2eb0 docs: plan — funding revocation on sustained decay (B3), 5 tasks; spec cockpit-defer
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 01:09:57 +02:00
jgrusewski
7456e987fe docs: spec — funding revocation on sustained decay (B3), scoped from health layer
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 00:56:38 +02:00
jgrusewski
a5a78ffac9 docs: plan — execution engine Alpaca/multistrat loop (C1), 4 bite-sized tasks
Pure helpers: scaled_weights bridge + envelope-basis flow-excluded compute_exec_return (T1) →
multistrat_exec observed registry track (T2) → record_exec_track books the exec return via A's
run_track + carries position-state (T3) → wire execute_multistrat to the B2a envelope, flatten
on $0, record on --execute (T4). TDD, reuses ExecutionService/AlpacaBroker/A's observed machinery,
no new engine, no capital authorized (paper, dry-run default).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 23:11:02 +02:00
jgrusewski
65569d593f docs: spec — execution engine Alpaca/multistrat loop (C1)
First slice of the execution plane (layer 5) on the data-driven-pipeline north-star. Makes
execute-multistrat B2a-driven: deploy exactly strategy_allocation[multistrat] dollars into the
multistrat book on Alpaca (envelope = min(target_$, NLV); $0/absent → flatten to cash — the
killswitch/prune propagates to real positions), reconcile + place via the existing ExecutionService
(dry-run default, hard-won gates), and record the executed book's daily return as an observed
forward_record for a new multistrat_exec track (comparable to the modeled multistrat). Load-bearing:
the exec return is on B2a's envelope (not full NLV) and excludes re-allocation capital flows
(time-weighted). Paper only; real capital human-armed. Builds on A + B1 + B2a.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 22:57:47 +02:00
jgrusewski
3b43856621 docs: plan — declarative strategy-level allocation policy + capital ceiling (B2a), 6 tasks
AllocationPolicy + hash (T1) → pure helpers full-history-vol/equal-weight-marginal-prune/killswitch
(T2) → compute_allocation ex-ante composition + anti-reactive invariant (T3) → target_capital hard
ceiling (T4) → strategy_allocation table+repo (T5) → nightly records the allocation from A's records
+ B1 deploy set (T6). TDD, ex-ante only (full-history vol), no capital moved (that is C).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 20:54:56 +02:00
jgrusewski
3a91373ac4 docs: spec — declarative strategy-level allocation policy + capital ceiling (B2a)
Core of the allocation plane (layer 4, plane 2) on the data-driven-pipeline north-star.
Versioned in-code AllocationPolicy + a pure compute_allocation: equal-weight the marginal-Sharpe-
gate survivors, ex-ante vol-target leverage from the FULL-history vol (never trailing — the
anti-reactive invariant that honours the 3x-rejected reactive de-sizing conclusion: ex-ante K +
rare killswitch), a rare latching aggregate killswitch, and target_capital that caps total
deployed gross at a HARD human capital_ceiling (the one human gate, in the versioned policy).
Recorded + policy-version-stamped. No capital moved (that is C). Builds on A + B1.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 20:27:53 +02:00
jgrusewski
a1190dddca docs(policy): note promotion_min_overlap_days in the B1 spec field list (review minor)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 15:26:02 +02:00
jgrusewski
889ba74852 docs: plan — declarative gate + promotion policy (sub-project B1), 6 bite-sized tasks
GatePolicy + policy_hash (T1) → resolve_policy (T2) → wire gates to ResolvedPolicy, remove
scattered constants (T3) → forward_summary policy stamp columns (T4) → ingest stamps every
verdict (T5) → promotion correlation backstop (T6). TDD, byte-identical verdicts under current
thresholds, per-verdict audit stamp, no capital.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 13:31:33 +02:00
jgrusewski
7e9f8520b9 docs: spec — declarative gate + promotion policy (sub-project B1)
First plane of the policy layer (layer 4) on the data-driven-pipeline north-star.
Consolidates the scattered gate defaults (reconciliation_gate module constants + gate.py
inline literals + registry gate_spec) into one in-code, versioned GatePolicy; resolves the
effective per-track policy at one point; stamps each verdict with policy_version + a
content-derived policy_hash (auditability + forced version-bump); and formalizes promotion
as gate==PASS AND human promote_on_pass flag AND an automatic correlation backstop (< threshold
vs the equal-weight deploy book from A's records). Byte-identical verdicts under current
thresholds. No capital (deploy-tier is tracking; capital is B2). Builds on sub-project A.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 13:25:11 +02:00
jgrusewski
4a50c88ea5 docs: plan — deterministic forward state (sub-project A), 9 bite-sized tasks
Recompute-from-anchor implementation plan: forward_anchor table + repo (T1),
declared definition + hash (T2), append-only forward_record + book-state (T3),
pure recompute/derive_nav (T4), the anchor-lifecycle engine (T5), wire
_run_paper_tracker (T6), PIT Yahoo snapshots (T7), one-time migration (T8),
retire the state_reader JSON path (T9). TDD, WAIT-safe, idempotent, per-task commits.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 23:00:41 +02:00
jgrusewski
55b26f8d32 docs: spec update — two record modes (recompute + observed) for sub-project A
Planning surfaced that not all active tracks are recomputable: xsfunding books a
live funding snapshot with no reproducible full-history series (and combined carries
latching kill-state). Add a per-track record_mode: `recompute` (anchor + PIT data,
the majority) vs `observed` (anchor + append-only immutable booked log + minimal
carried book-state in DB). Observed removes the hand-editable PVC JSON for those
tracks and is the same machinery sub-project C reuses for execution fills.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 22:54:25 +02:00
jgrusewski
e20eae988c docs: spec — deterministic forward state (sub-project A), recompute-from-anchor
Foundation of the unified data-driven pipeline: replace mutable, hand-editable
tracker JSON state with an immutable (T0, definition_hash) anchor in Postgres;
recompute the forward record over [T0, today] from PIT warehouse data each run;
auto-re-inception on declared-definition change. Migration preserves existing T0s
and reconciles (divergence = drift, surfaced not silenced). Yahoo closes get PIT
snapshots (recompute stability); execution fills scoped out to sub-project C.
Data-driven mechanics, human-gated capital — A does not touch capital.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 22:46:34 +02:00
jgrusewski
fd9534e978 feat(exec): multistrat book on Alpaca — target-weight bridge + crypto BTC leg
Puts the adaptive multi-strat ETF book on the clean execution port:
- multistrat.target_weights(closes): exposes the final-day per-instrument weights
  (L*tw*volnorm_scale) that book_series applies but only collapses into a return.
  Refactored _volnorm via a shared _volnorm_scale so book_series stays byte-identical.
  Tested: sum(w*R[last]) reconstructs book_series's last booked return exactly.
- ExecutionService.rebalance_weights(weights, prices): a direct pre-computed-weights
  entry beside rebalance(book), sharing one _plan engine (gates + fractional sizing).
  Caller owns data<->broker symbol mapping.
- AlpacaBroker crypto-aware: a slash symbol (BTC/USD) -> time_in_force gtc; equities
  stay day. So the book's BTC-USD leg trades on Alpaca crypto alongside the 5 ETFs.
- CLI fxhnt execute-multistrat (maps BTC-USD -> BTC/USD); the alpaca-rebalancer
  CronJob now runs it (suspended until paper keys).

Full suite green (1832); +5 tests. Alpaca-crypto position-symbol form validated on
first paper run.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 00:33:22 +02:00
jgrusewski
5b2cb72500 docs: spec — Alpaca execution foundation (fractional US-equity venue)
AlpacaBroker (httpx REST, Broker port) + fractional-aware ExecutionService +
paper-first CronJob. Runs on the survivor book (fxhnt execute --broker alpaca)
end-to-end. The multi-strat ETF book's position logic is NOT on the clean port
(only its return series is; live exec is an archived out-of-repo foxhunt script),
so putting THAT book on Alpaca (weight-extraction + ExecutionService bridge +
BTC-USD leg) is an explicit follow-up reusing this foundation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 23:48:26 +02:00
jgrusewski
adc3d96d60 docs: spec update — add tail-concentration cap + drop glitch-guard (moves are real)
OHLC/spot investigation: the +150% microcap days are REAL (HUSDT +154% spot-
corroborated, $214M turnover, capturable at $100k) — NOT glitches. So the fix is
capacity-cap (scale protection) + an ISV-driven per-coin tail-concentration cap
(contribution <= K*sigma_book, gains-only) to cut the fat-right-tail dependence
(28% of return from 10 days), NOT a glitch guard (would suppress real gains).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 22:23:37 +02:00
jgrusewski
b737445a67 docs: spec — positioning capacity-aware realized returns
Cap each coin's realized GAIN by a capacity fraction min(1, pi*med_turnover/(capital*|w|))
in _book_breakdown (the SSOT for the positioning forward + gate ref + 4-edge book).
Gains-only/conservative; capital-aware (barely binds at $100k where positioning IS
capturable, caps thin names as capital scales). Fixes the microcap-squeeze overstatement
(28% of return from 10 uncapturable +150% microcap days) the investigation surfaced.
Data-glitch filtering + other sleeves are non-goals.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 22:16:39 +02:00
jgrusewski
f258222094 docs: FALSIFY H2 spec — vol-target overlay is reactive de-sizing in disguise
Ran the spec's own anti-pro-cyclical gate early (pre-build): the +0.24 OOS book
Sharpe is pure vol-shrinkage, not return (daily diff -0.31bp, t=-0.65). The
de-risk misses more upside than downside it avoids (net -10.8%) and cuts hardest
before top-decile up days (0.854 vs 0.904) = the cut-before-the-bounce signature.
In crypto-bull, high vol correlates with drawdown-then-bounce, so vol-conditioning
== the 3x-rejected drawdown de-sizing in effect. Not built; raw momentum stands.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 20:02:23 +02:00
jgrusewski
f34fa0b856 docs: spec H2 — back-compute+swap deploy, multi-condition gate 1
Q2 (deterministic warehouse-backed sleeve): drop the separate 2-3wk shadow wait.
Back-compute vol-targeted momentum + book over backtest + elapsed forward; if
gates pass, swap into bybit_4edge (re-inceptions 0/21) and let the book's own
21-day gate be the frozen-forward validation. Contrast xsfunding (live-snapshot,
un-backfillable). Q1: gate 1 becomes multi-condition (net Sharpe >=+0.15 AND DD
non-worse AND per-year consistent AND anti-pro-cyclical clean) instead of a
brittle single +0.2 point.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 19:43:33 +02:00
jgrusewski
9e3040be04 docs: spec — momentum-sleeve vol-target overlay (H2), de-risk-only, shadow-first
Ex-ante sleeve-level volatility-target overlay on crypto_tstrend (TrendRunner):
scale exposure DOWN in high-realized-vol regimes, never lever (cap=1.0). OOS
investigation (881 test days) shows +0.24 book Sharpe / -1.4pp maxDD, robust
net-of-cost to 40bp/turn and across L/floor params. Distinguished from the 3x
rejected reactive de-sizing (conditions on vol, not drawdown; improves DD).
Strict gates: net-book re-measure >=0.2 Sharpe, anti-pro-cyclical falsification,
per-year consistency. Shadow-first deploy (false-WAIT-safe).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 19:35:23 +02:00
jgrusewski
180bed28ee docs: spec — tail-budgeted levered shape (carry ~40%, bounds -20% dislocation to -8%)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 00:27:07 +02:00
jgrusewski
e706b6488c docs: plan — cockpit levered track views (Backtest measured curve + Replay toggle)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 22:33:27 +02:00
jgrusewski
95b5d9e8b0 docs: spec — surface levered shadow track in cockpit Backtest + Replay
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 22:31:44 +02:00
jgrusewski
e02907684d docs: plan — bybit_4edge levered shadow track (Phase 1, static leverage, observe-only)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 20:35:02 +02:00
jgrusewski
85a4afa7ab docs: spec — phase leverage overlay (Phase 1 = static-leverage shadow track, observe-only; Phase 2 = adaptive re-tune)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 20:31:16 +02:00
jgrusewski
09b6af4c75 docs: spec — bybit_4edge leverage overlay (re-tune existing overlay, carry 5-8x, book-gross <=1.5x, -35%/yr ruin cap)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 20:27:23 +02:00
jgrusewski
dd5500a0ed docs: plan — Bybit testnet real-paper execution leg (Phase 1 task-by-task, TDD)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 13:37:22 +02:00
jgrusewski
7ed3926a13 docs: spec — Bybit testnet real-paper execution leg (v2, post critical-review)
Execution-mechanics validation on Bybit testnet via a SEPARATE Dagster job (no CronJob),
ccxt adapter, market orders, raw-weights + overlay-re-applied-on-testnet-state, decomposed
slippage (execution vs timing, pure+tested), execution-gap verdict. Slippage-magnitude
(unlock 35bp) honestly deferred to mainnet micro-live (thin testnet alt liquidity).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 13:35:44 +02:00
jgrusewski
11ded748bf docs(spec): warehouse->TimescaleDB consolidation (hypertable+compression; we already run timescaledb-pg16)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 16:05:33 +02:00
jgrusewski
0fa36ca454 docs(spec): Bybit ingestion + carry re-validation on the live venue (funding/klines/universe, MiCA note)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 15:51:32 +02:00
jgrusewski
5563f772b5 docs(spec): interactive simulator cockpit + multi-track wiring (configurable sim, slider, 2/3-edge+carry tracks)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 14:15:16 +02:00
jgrusewski
dfe58fbd9c docs(spec): combined risk stack — K(D*) sizing + WEH structural-retirement + killswitch backstop
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 01:29:51 +02:00
jgrusewski
0149de2535 docs(spec): drawdown controller v1 design (ex-ante DD budget + per-sleeve edge-health, replace whipsaw killswitch)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 00:02:12 +02:00
jgrusewski
dd83251933 docs(carry): tail data-acquisition design (workflow research output, fact-checked)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 17:12:10 +02:00
jgrusewski
931dce4a8a docs(audit): A6 converge-to-2-edge spec (carry live-only + gross-cap + warmup + cycle-validate)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 16:52:59 +02:00