Deploy-the-fund knobs: single-row fund_config (capital, target_vol, kelly)
set via 'fxhnt fund-config', read by the nightly allocation with a settings
fallback. Per-sleeve crypto allocation (promote xsfunding/unlock via
promote_on_pass, demote bybit_4edge to a research reference; generalize the
honest-inputs provider to size any crypto sleeve). Marginal LOO gate KEPT +
a predetermined falsification gate (G1 survival / G2 deployment% / G3
anti-reactive) that accepts the honest verdict either way. target_vol 0.20.
Paper scope; execution wiring a follow-on.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Upgrade of the B2a allocation engine. Tasks: 1 inverse-vol (risk-parity) base weights, 2 capacity
ceiling from an honest capacity curve, 3 compute_allocation weights inverse-vol capped (not
equal), 4 honest-reference series+ceiling provider per deploy strategy (bybit_4edge book /
positioning sleeve / equity-default), 5 record_allocation sizes from the provider + caps at
capacity, 6 policy knobs (capacity_min_sharpe, equity_default_ceiling) + ceiling shown next to the
curve. Reuses forward-gating, cross-venue, funding-decay, killswitch, vol-target, $ conversion.
Self-review flags the int-vs-str series-key conversion at the provider seam. Scope stays paper.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Focused upgrade (not a new system) of allocation_engine.compute_allocation: (1) equal-weight ->
inverse-vol (risk-parity) capped at max_strategy_weight; (2) a per-deploy-strategy capacity
ceiling from the honest-reference so a growing fund never over-scales a capacity-limited edge
(xsfunding breaks ~$350k). Everything else (forward-gating via deploy+promoted, cross-venue,
funding-decay, killswitch, vol-target, $ conversion) already exists and is reused.
Gate reality investigated: deploy-tier = only bybit_4edge + positioning (both WAIT post-re-warm);
strategy_allocation is empty because compute_allocation needs 60 forward days but the re-warm
reset tracks to ~8. So sizing basis moves to the honest-reference BACKTEST (stable, capacity-
adjusted), with the forward gate as the LIVE-DEPLOY switch only ("honest weights now, live per
gate"). Granularity: bybit_4edge needs a book-level capacity; positioning uses its sleeve curve;
multistrat (IBKR equity) gets a high default ceiling in v1 (real equity-ADV model = follow-on).
Self-critical section: Sharpe-4 not forward-proven (concentration cap + gating guard), equity
capacity stub, backtest-sizing-not-live caveat. Scope stays paper.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Research/validation-scope design for a coin-level capacity-, cost-, and leverage-honest
backtest reference, after quantifying (2026-07-15) that the book's numbers are tail-inflated:
top-10 days drive 58% of unlock / 29% of positioning; unlock's Sharpe collapses 1.03->0.19
under a P98 upside haircut; the "levered" backtest's -11.8% maxDD < the naive -15.4% (a
re-weighting artefact, not leverage).
Locked decisions (from brainstorming): coin-level ADV/impact model (turnover data verified:
818 coins, 2021-2026, USD); participation_cap 3%; AUM curve {35k,100k,350k,1M,10M} to locate
the ceiling; risk-parity/inverse-vol weighting; ex-ante risk layer with an anti-reactive gate
(G4) — reactive de-sizing stays out (A/B-rejected 3x); candidate edge #4 (pump/anomaly
detection) falsification-tested through the same honest-cost pipeline. No live cockpit change
(production gate-replacement is a follow-on). Self-critical section names the 5 ways this could
still fool us (recompute fidelity, slippage-is-modeled-not-measured, survivorship, AUM
relevance, still-a-backtest).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Consolidate /paper into ONE "Paper books" page (crypto simulated + IBKR real,
both clickable -> holdings detail); the holdings detail shows what it's holding
(assets + shares + value + %), recent trades (cost-to-trade %), value-over-time
(real vs plan) + per-strategy breakdown. Overview gets a plain "real trades"
sub-line + "behind plan" pill. HARD RULE: plain language, no dev jargon — a
single display_names map is the source of every rendered name; REAL PAPER vs
PAPER badges. Backtests page includes the IBKR tracks (D1).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add D3 (overview EXEC badge + real-vs-sim divergence chip + account rollup),
D4 (/paper/ibkr account-level view: total NAV + all positions/fills +
per-strategy breakdown), a UX & information-architecture section (3-level
progressive disclosure, one divergence signal rendered consistently), and a
strategy-tagged data model so a second executor is a new ROW, not a redesign.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bring the IBKR paper strategies to cockpit parity with the Bybit book: their
0a backtest curve in /paper/sim (D1), and capture the REAL DU paper-account
state (fills -> exec_fills, positions, NAV) rendered as a cockpit book +
reconciled vs the recomputed multistrat sim (D2) — the honest pre-live
verification. Paper-only (no live/arm), Bybit untouched (no EU testnet keys),
faithful extension of the existing exec path (IbkrBroker already reads NLV+
positions; exec_fills exists but is empty).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
One backtest->ref path (registry-driven dispatch: recompute-replay / report / none)
replacing the 3 fragmented mechanisms, so every reconciliation-gated strategy always
has a ref — a structural invariant (a gated strategy without a ref becomes a CI
failure). Fixes the live gate bugs: xsfunding (reconciliation gate, no ref -> stuck
WAIT forever) + the bybit deploy gate depending on an unscheduled Job. Timescale =
the one durable store; DuckDB repositioned as an ephemeral columnar engine that
ATTACHes Timescale (verified feasible on duckdb 1.5.3) for heavy report backtests —
no persistent DuckDB files/PVC in the live path. Heavy backtests move to a dedicated
resourced scheduled step (own memory, not the OOM-prone 4Gi daemon). Binance/Alpaca
cleanup (0b) + cockpit Ops/Fleet UI (Phase 2) + equity-factor revival are out of scope.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>