@@ -92,14 +92,22 @@ that moves against the hedge, loses money even when the net delta is zero.
9292
9393A backtest is driven by a scenario plus the strategy configuration. Money and
9494rate values are fixed-point decimal strings, never JavaScript numbers, and
95- carry at most seven decimal places. The strategy configuration exposes:
96-
97- | Option | Meaning | Safe range |
98- | ---------------------- | ------------------------------------------- | ------------------------------- |
99- | ` initialCapitalQuote ` | Starting quote capital, as a decimal string | Greater than zero |
100- | ` targetLeverage ` | Gross leverage applied to each leg | ` 1 ` to ` 20 ` inclusive |
101- | ` neutralityBandBps ` | Allowed net-delta drift, in basis points | Positive; commonly ` 20 ` to ` 50 ` |
102- | ` rebalanceSlippageBps ` | Cost applied to each rebalance fill | Small and non-negative |
95+ carry at most seven decimal places. The strategy configuration (` DeltaNeutralConfig ` )
96+ exposes:
97+
98+ | Option | Meaning | Safe range / Type |
99+ | ------------------ | ------------------------------------------------------- | ------------------------------- |
100+ | ` asset ` | Base asset held long on spot | Valid asset symbol (e.g. ` XLM ` ) |
101+ | ` targetLeverage ` | Gross leverage applied to each leg | ` 1 ` to ` 20 ` inclusive |
102+ | ` rebalanceBandBps ` | Rebalance threshold in basis points of total equity | Positive; commonly ` 20 ` to ` 50 ` |
103+ | ` fundingRate ` | Per-second funding rate applied to the short hedge | ` FundingRate ` instance |
104+ | ` priceFeed ` | Spot marks feed for the long leg and hedge venue | ` PriceFeed ` instance |
105+ | ` hedgeFeed ` | Optional perp marks for hedge (defaults to ` priceFeed ` ) | ` PriceFeed ` instance (optional) |
106+ | ` hedgeVenue ` | Optional modeled hedge execution venue | ` HedgeVenue ` (optional) |
107+ | ` id ` | Optional stable identifier recorded in the snapshot | String (optional) |
108+
109+ Scenario-level parameters (e.g. ` initialCapitalQuote ` , time steps, and seeds)
110+ configure the overall backtest runner environment rather than the strategy itself.
103111
104112The scenario that carries them is the single input a run is reproduced from:
105113the same scenario and seed always yield the same run. A scenario describes a
@@ -133,23 +141,26 @@ runs. When the run ends, the metrics collector summarizes it.
133141
134142## Reading the run summary
135143
136- The summary is the output to read. It reports the metrics the strategy is
137- judged on:
138-
139- | Metric | Meaning |
140- | ---------------------- | ------------------------------------------------------------- |
141- | ` netPnl ` | Total change in equity over the window |
142- | ` carryPnl ` | Equity earned from funding and carry |
143- | ` pricePnl ` | Equity from price moves, which should stay small when neutral |
144- | ` maxNetDeltaBps ` | Largest net-delta drift seen, in basis points |
145- | ` withinNeutralityBand ` | Whether every step stayed inside ` neutralityBandBps ` |
146- | ` totalRebalances ` | How many times the strategy traded back to neutral |
147-
148- A healthy run keeps ` maxNetDeltaBps ` inside the band, shows ` carryPnl ` as the
149- dominant contributor to ` netPnl ` , and keeps ` pricePnl ` close to zero. A run
150- where ` pricePnl ` dominates means the hedge stopped tracking; a run with a
151- large ` totalRebalances ` means the band is too narrow for the volatility and
152- fees are eating the carry.
144+ The summary is the output to read. The runner outputs a ` RunReport ` object
145+ exposing standard risk metrics, discrete event counters, and portfolio state:
146+
147+ | Metric / Field | Meaning | Status |
148+ | ---------------------------------- | -------------------------------------------------------------- | -------------- |
149+ | ` riskMetrics.maxDrawdown ` | Maximum drawdown from peak portfolio value as a ratio (0 to 1) | On ` RunReport ` |
150+ | ` riskMetrics.sharpeProxy ` | Sharpe-ratio proxy: mean excess return in stroops per step | On ` RunReport ` |
151+ | ` riskMetrics.volatility ` | Standard deviation of per-step returns | On ` RunReport ` |
152+ | ` eventCounts.rebalances ` | How many times the strategy traded back to neutral | On ` RunReport ` |
153+ | ` finalState.totalValue ` | Final total portfolio valuation in reference asset (USDC) | On ` RunReport ` |
154+ | ` netPnl ` _ (planned)_ | Total change in equity over the window | Planned |
155+ | ` carryPnl ` _ (planned)_ | Equity earned from funding and carry | Planned |
156+ | ` pricePnl ` _ (planned)_ | Equity from price moves, which should stay small when neutral | Planned |
157+ | ` maxNetDeltaBps ` _ (planned)_ | Largest net-delta drift seen, in basis points | Planned |
158+ | ` withinNeutralityBand ` _ (planned)_ | Whether every step stayed inside ` rebalanceBandBps ` | Planned |
159+
160+ A healthy run keeps net delta inside ` rebalanceBandBps ` , minimizes drawdown,
161+ and limits excessive rebalance counts so trading costs do not erode returns.
162+ Attribution metrics like ` carryPnl ` and ` pricePnl ` are planned analytical extensions
163+ to break down the components of total PnL.
153164
154165## Risks and limits
155166
0 commit comments