diff --git a/crates/aura-std/src/sim_broker.rs b/crates/aura-std/src/sim_broker.rs index 837e49d..422f8af 100644 --- a/crates/aura-std/src/sim_broker.rs +++ b/crates/aura-std/src/sim_broker.rs @@ -9,6 +9,30 @@ use aura_core::{Ctx, FieldSpec, Firing, InputSpec, Node, NodeSchema, Scalar, Sca /// Integrates `exposure * price-return` into cumulative pips. `pip_size` is /// per-instrument reference metadata (beside the hot path, C7/C15), held here, /// never streamed. +/// +/// # Input slots +/// +/// Two `f64` inputs, **order is load-bearing** (both are `f64`, so a swapped +/// wiring is *not* caught at bootstrap — it would silently produce a wrong +/// equity curve): +/// +/// - **slot 0 — exposure** ∈ [-1, +1] (the strategy's intent, e.g. from +/// [`Exposure`](crate::Exposure)). +/// - **slot 1 — price** (the instrument price the exposure is marked against). +/// +/// # Firing and warm-up +/// +/// Both inputs are [`Firing::Any`](aura_core::Firing::Any), so the broker fires +/// on **every price-fresh cycle** (price is typically the source tick). A +/// not-yet-warmed exposure leg is read as flat `0.0`, so the broker emits an +/// equity row from the **first** price tick, reading `0.0` until the exposure +/// leg produces its first value — the recorded curve therefore has one row per +/// price cycle, with leading `0.0`s during warm-up, not one row per exposure. +/// +/// # Output +/// +/// One `f64` column, the cumulative pip equity (a producer; tap it with a +/// recording sink to persist the curve). pub struct SimBroker { pip_size: f64, prev_price: Option,