Currency metrics + net_currency_pnl ranking (+ serde(default) back-compat) #121

Closed
opened 2026-06-22 18:18:19 +02:00 by Brummel · 1 comment
Owner

Extend RunMetrics (aura-engine/src/report.rs) with currency-aware fields, computed as a post-run reduction over the new currency-equity tap + the position-event table:

  • net_currency_pnl (last currency-equity value)
  • currency_max_drawdown
  • n_trades (true round-trip count from the position-event table — the real turnover signal that supersedes the exposure_sign_flips proxy)
  • total_cost (sum of spread + commission)

Mandatory back-compat fix: every new field gets #[serde(default)]. Registry::load (aura-registry/src/lib.rs:72) parses every historical runs.jsonl line into RunMetrics; without #[serde(default)] a bare new field breaks deserialization of all existing run records (C18). The existing compat module only rewrites the params wire-shape, so the default attribute is the actual fix.

Add a metric_cmp arm (aura-registry) so optimize/rank_by accept net_currency_pnl (higher-is-better). Keep the sim-optimal pip metrics unchanged for signal-quality comparison.

Not in this issue: flipping the optimizer DEFAULT objective to net-currency is a separate, explicitly-ratified step (audit-drift event under C18) — keep total_pips the default, net_currency_pnl opt-in.

depends on: derive (I3, for n_trades), RealisticBroker (I4, for currency equity)
context: delivers "optimize net of real cost" — the milestone's motivation.

Extend `RunMetrics` (aura-engine/src/report.rs) with currency-aware fields, computed as a post-run reduction over the new currency-equity tap + the position-event table: - `net_currency_pnl` (last currency-equity value) - `currency_max_drawdown` - `n_trades` (true round-trip count from the position-event table — the **real** turnover signal that supersedes the `exposure_sign_flips` proxy) - `total_cost` (sum of spread + commission) **Mandatory back-compat fix:** every new field gets `#[serde(default)]`. `Registry::load` (aura-registry/src/lib.rs:72) parses every historical `runs.jsonl` line into `RunMetrics`; without `#[serde(default)]` a bare new field breaks deserialization of all existing run records (C18). The existing compat module only rewrites the params wire-shape, so the default attribute is the actual fix. Add a `metric_cmp` arm (aura-registry) so `optimize`/`rank_by` accept `net_currency_pnl` (higher-is-better). Keep the sim-optimal pip metrics unchanged for signal-quality comparison. **Not in this issue:** flipping the optimizer DEFAULT objective to net-currency is a separate, explicitly-ratified step (audit-drift event under C18) — keep `total_pips` the default, `net_currency_pnl` opt-in. depends on: derive (I3, for n_trades), RealisticBroker (I4, for currency equity) context: delivers "optimize net of real cost" — the milestone's motivation.
Brummel added this to the Realistic broker & position-event table (C10 A-side) milestone 2026-06-22 18:18:19 +02:00
Brummel added the feature label 2026-06-22 18:18:19 +02:00
Author
Owner

Superseded by the 2026-06-28 C10 rework (ledger commit 29cdc8c): the realistic-broker / currency model is retired (real friction is not historically knowable). Cost in research is now a composable cost-model graph in R (the net-R curve); money / a real broker move to a separate live/deploy edge. See #116 (summary), #148 (cost-model graph), #149 (live/deploy edge). Closing as superseded.

Superseded by the 2026-06-28 C10 rework (ledger commit `29cdc8c`): the realistic-broker / currency model is retired (real friction is not historically knowable). Cost in research is now a composable cost-model graph in R (the net-R curve); money / a real broker move to a separate live/deploy edge. See #116 (summary), #148 (cost-model graph), #149 (live/deploy edge). Closing as superseded.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Brummel/Aura#121