Commit Graph

92 Commits

Author SHA1 Message Date
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
jgrusewski
39362263a7 docs(audit): paper-book foundation audit (going-in-circles pause)
Maps the 5-layer architecture + 6 confirmed issues (carry P&L not in equity,
gross-not-net leverage cap=6x, no warmup, 1yr-bull overfit -98.9% multi-year,
unreliable offline sweep, unmodellable carry tail) + architectural decisions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 16:44:24 +02:00
jgrusewski
3d23efd2a8 docs(carry): A5 faithful delta-neutral carry plan
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 14:56:54 +02:00
jgrusewski
ffe62307ad docs(carry): A5 faithful delta-neutral carry (spot ingest + basis) design
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 14:55:44 +02:00
jgrusewski
449007018e docs(funding): A4 addendum — xsfunding carry return-source (price-MTM can't see funding)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 12:42:17 +02:00
jgrusewski
66fa02b0cc docs(funding): A4 funding-ingest + xsfunding-replay plan
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 12:19:45 +02:00
jgrusewski
104cc19774 docs(funding): A4 funding-history ingest + replayable xsfunding design
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 12:18:00 +02:00
jgrusewski
a66c5eb7e0 docs(paper): A3h adaptive vol budget plan
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 11:13:51 +02:00
jgrusewski
6661e987d2 docs(paper): A3h ISV-adaptive vol budget design
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 11:11:49 +02:00
jgrusewski
20cafc21fd docs(paper): A3g overlay re-tune plan
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 10:56:41 +02:00
jgrusewski
d5f867adea docs(paper): A3g overlay re-tune design (30% full-Kelly, dormant wide kill, drop gate)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 10:55:48 +02:00
jgrusewski
f5d0e7f31c docs(paper): A3f compounding equity-accounting fix plan
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 09:58:01 +02:00
jgrusewski
833cec0d6a docs(paper): A3f compounding equity-accounting fix design
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 09:55:49 +02:00
jgrusewski
6c9dc00a54 docs(paper): A3e marginal-gate + cleanup implementation plan
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 09:15:27 +02:00
jgrusewski
a01875b7be docs(paper): A3e marginal-gate + cleanup design
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 09:13:13 +02:00
jgrusewski
638bfde86f docs(paper): A3d vol-target + killswitch implementation plan
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 08:04:52 +02:00
jgrusewski
f52d893163 docs(paper): A3d vol-target leverage + drawdown killswitch design
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 07:56:27 +02:00
jgrusewski
5ed54a5ea4 docs(paper): A3c implementation plan + spec return-fn signature fix
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 23:27:01 +02:00
jgrusewski
fdc721e6d8 docs(paper): A3c spec fixes from critical review (disjoint regime signal, two-sided water-fill, shared return fn, mixed-history rule)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 23:21:29 +02:00
jgrusewski
4bbae5cacc docs(paper): A3c ISV-adaptive sleeve weighting design (state-derived meta-params)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 22:47:07 +02:00
jgrusewski
27accf0458 docs(paper): A3c dynamic inverse-vol sleeve weighting design
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 22:37:42 +02:00