Reference/Trade Performance Analytics Metric Contract

Trade Performance Analytics Metric Contract

Purpose

This contract defines what the Vol Dashboard means by trade performance. It also documents the current production boundary so users can distinguish sourced analytics from intentionally unavailable metrics.

The central decision question is:

Did we trade when the dashboard showed an opportunity, did we execute well, and did the trade get the expected outcome?

The answer must be separated into three families:

FamilyQuestionPrimary source
Opportunity alignmentDid the trade agree with the dashboard signal at entry?Dashboard market/regime context at trade time
Execution qualityWas the fill good versus the instrument market at execution time?TradFi option quote/mark/surface source for the traded instrument
Outcome qualityWhat happened after the trade, and under which regime/signal did it happen?Sourced forward marks, realized outcomes, market context, and lifecycle grouping

Do not collapse these into one score until each component has its own source, unit, and data-quality state. A trade can align with a signal and still execute poorly. A trade can execute well and still lose money. A trade can have no defensible outcome yet even if its entry context is complete.

Current Production Status

The current /performance screen is live and should be read as a source-quality-aware analytics view, not a complete P&L report.

Performance familyCurrent statusWhat users can safely conclude
Opportunity alignmentScored for the loaded Alpha trade sample.Users can see whether synced Alpha trades were directionally consistent with available BTC-linked dashboard opportunity context at execution time.
Source-group qualityDisplayed by context group.Users can see which context groups are available, partial, unavailable, or deliberately not sourced before trusting the alignment read. BTC proxy liquidity is market backdrop only, not execution-quality liquidity.
Execution qualityPartially benchmarked for the loaded Alpha sample where backfills sourced fresh MSTR/COIN option bid/ask quotes.Read fill-vs-mid only for quoted rows. stale and unavailable rows are excluded from execution aggregates and are not zero slippage.
Forward outcome P&LPartially available where forward outcome mark backfill sourced fresh MSTR/COIN option marks.pending means the horizon has not matured; unavailable means the horizon matured but no sourced post-trade mark exists. Neither is zero P&L.
Realized P&LNot sourced yet.Derived same-contract FIFO cashflow is not displayed as realized P&L until validated against authoritative accounting or explicit lifecycle intent.
Position coverageDerived lifecycle state is available.Users can inspect open/closed coverage, but this is not the same as authoritative realized P&L.

Current known gaps for the next phase are remaining source coverage for execution-time MSTR/COIN option quotes, authoritative adjusted 2MSTR/2COIN contract mapping, trade-level MSTR/COIN option liquidity fields, source coverage for 1d/7d/30d post-trade marks, intentionally unsourced Alpha trade-level smile richness, and authoritative realized-P&L/lifecycle accounting.

As of the 2026-05-10 production API check for source=alpha_sync, lookback_days=365, and limit=1000, the default Performance population is:

MetricCurrent countContract interpretation
Alpha execution rows751Current default Performance population.
Opportunity context749/751 scored2 rows remain insufficient; missing context is no longer the main blocker.
Execution benchmarks331/751 quotedFill-vs-mid and spread reads are valid only for quoted rows.
Execution liquidity331 partial, 250 unavailable, 170 not sourcedFull liquidity is blocked by missing contract volume/OI and unresolved adjusted-contract mapping.
7d forward outcomes177/751 available, 1 pending, 573 unavailableP&L/hit-rate reads must quote available sample size and exclude unavailable rows.
Realized P&LNot sourcedMust remain unavailable until authoritative accounting/lifecycle data exists.

Current Alpha Inputs

Production Alpha sync writes source rows into internal_trades with source='alpha_sync'.

Current production scope:

PortfolioCurrent traded underlyingDashboard opportunity/regime proxyExecution/outcome quote source
IMSTMSTRBTC-linked dashboard contextMSTR option market data
ICOICOINBTC-linked dashboard contextCOIN option market data

The proxy split is intentional. BTC-linked volatility, gamma, VRP, term-structure, and stationarity context define the opportunity backdrop for current proxy trades. BTC proxy liquidity is context/backdrop only and should not be used to judge whether a MSTR/COIN option trade was executable. BTC smile remains a market-surface read, not an Alpha trade-level proxy. Execution and outcome marks must use the actual traded option market, not BTC option quotes.

The preparatory contract for exact, adjusted, standard-root fallback, SMA/OTC derivative-equivalent, unsupported, and unmapped identity states is maintained in Derivative Identity And Proxy Mapping.

The next preparatory work is split across Data Ingestion Readiness Plan, Trade Copilot Evaluation Specification, and SMA Ingestion Requirements. These documents define the durable sourcing plan, accident-avoidance and restructuring evaluation contract, and future SMA field requirements without changing the current Performance production boundary.

Available Fields

FieldUnit / meaningCurrent reliability
source_trade_idAlpha source trade IDRequired for idempotent upsert
source_portfolioAlpha portfolioRequired for scope and sync diagnostics
trade_dateExecution timestampRequired for filled rows
underlying_symbol / currencyTraded underlying, e.g. MSTR, COINRequired
instrumentSource instrument labelRequired
directionbuy or sellRequired
option_typecall or putRequired
strikeStrike priceRequired
expiryExpiry dateRequired
quantityFilled quantity in quantity_unitRequired and positive
quantity_unitCONTRACTS or SHARESRequired
pricePer-contract/source unit price in price_currencyRequired and non-negative
price_currencyPrice currencyRequired
contract_multiplierSource multiplierRequired and positive
premium_usdTotal trade premium in USDSource-provided or calculated only when price_currency=USD
fees_usdTotal trade fees in USDOptional
trade_statusSource status, currently only filled rows are ingestedRequired
recon_statusSource reconciliation statusRequired
source_updated_atSource update timestampRequired for cursor/watermark sync

Current Field Gaps

The current Alpha feed does not provide enough data for all performance analytics.

Missing or not guaranteedConsequence
Actual traded-underlying spot at tradeAlpha does not provide authoritative MSTR/COIN spot in the trade row. BTC proxy spot may be enriched for opportunity context, but it is not a traded-instrument quote source.
Traded IVCannot directly compare fill IV to realized vol or surface IV without enrichment.
Bid / ask / mid at executionCannot compute true slippage, spread capture, or fill-vs-mid without quote enrichment.
Strategy or intent tagCannot know whether a buy was intended as long-vol, directional upside, hedge, roll, or closing trade.
Lifecycle link / parent orderCannot determine open/close pairs or position lifecycle from source row alone.
Subsequent marksCannot compute forward P&L or hit rate without sourced marks or settlement data.
Authoritative expiry settlementExpiry outcome remains unavailable unless sourced separately.

Blank or unavailable is the correct output when a required input is missing. Do not display zero for unavailable economics.

Data-Quality States

Every computed trade-performance metric must carry a quality state.

For the cross-document policy that defines which source and quality states may feed decision-grade marks, P&L, estimates, proxy outputs, and future copilot warnings, see the Source Authority Register.

StateMeaningUI/API behavior
availableComputed from direct source inputs within tolerance.Display normally with source label.
proxy_mappedComputed using an explicit market proxy such as BTC context for MSTR/COIN opportunity attribution.Display with proxy label and confidence.
estimatedComputed from a model or fallback, not a direct market/source observation.Display only if visibly labelled as estimated.
staleSource observation exists but is outside the allowed time tolerance.Display with stale warning or suppress from aggregates that require fresh data.
unavailableRequired input is absent.Display blank / no-data; do not coerce to zero.
unsupportedMetric does not apply to the instrument, state, or current implementation.Display unsupported/no-data with reason.

Recommended common metadata fields:

FieldMeaning
metric_qualityOne of the quality states above.
source_nameDirect source used, e.g. alpha, amberdata, tradfi_quote, surface_model.
source_timestampTimestamp of the source observation.
time_delta_minutesAbsolute time difference from trade execution.
missing_fieldsRequired fields that prevented a higher-quality result.
calculation_versionDeterministic version label for metric logic.

Required Direction And Sign Conventions

Direction must be explicit because buy and sell fills have opposite economics.

ConceptBuy optionSell option
Premium cash flowCash outflowCash inflow
Fill-vs-mid slippagefill_price - mid_price; positive is worsemid_price - fill_price; positive is worse
Spread capture(ask_price - fill_price) / spread where spread = ask - bid(fill_price - bid_price) / spread
Forward P&Lmark_value - entry_value - feesentry_value - mark_value - fees
IV edge, long-vol assumptionPositive if entry IV is cheap versus benchmark/realizedNegative if entry IV is rich versus benchmark/realized
IV edge, short-vol assumptionNegative if entry IV is cheap versus benchmark/realizedPositive if entry IV is rich versus benchmark/realized

If strategy intent is unknown, report both the raw component and the assumed interpretation. Do not infer that every option buy is a pure long-vol trade or that every option sell is a pure short-vol trade.

Metric Families

1. Execution Quality

Execution quality asks whether the fill was attractive relative to the actual traded instrument market at the time.

Execution benchmarks must use the traded instrument quote source. For current scope that means MSTR/COIN option data for execution marks, not BTC option data.

MetricFormula / definitionUnitRequired inputsNo-data behavior
Entry premium USDSource premium_usd; if missing and price_currency=USD, price * quantity * contract_multiplierUSDpremium_usd or (price, quantity, contract_multiplier, price_currency=USD)unavailable if non-USD price lacks source premium_usd
Fees as percent of premiumfees_usd / abs(entry_premium_usd)Percentfees_usd, entry premiumunavailable if fees or premium missing; do not assume zero fees unless source says zero
Benchmark mid price(bid + ask) / 2Price per contractBid/ask for same contract near execution timeunavailable if no sourced quote
Fill vs midBuy: fill_price - mid_price; sell: mid_price - fill_pricePrice points per contract and USD totalFill price, benchmark mid, quantity, multiplierunavailable if mid missing
Fill vs mid bpsfill_vs_mid / mid_price * 10000Basis pointsFill vs mid, positive midunavailable if mid <= 0 or missing
Spread captureBuy: (ask - fill_price) / (ask - bid); sell: (fill_price - bid) / (ask - bid)Ratio / percentBid, ask, fill priceunavailable if bid/ask missing or spread <= 0
Execution-liquidity stateavailable, partial, stale, unavailable, not_entitled, or not_sourcedQuality stateSame-contract bid/ask, quote age, optional 24h volume, optional open interestpartial when bid/ask is sourced but volume/OI are not returned; missing volume/OI stay null
Contract 24h volumeProvider-sourced field onlyContractsExplicit provider volume field for the traded MSTR/COIN optionunavailable if not returned; never substitute BTC volume
Contract open interestProvider-sourced field onlyContractsExplicit provider open-interest field for the traded MSTR/COIN optionunavailable if not returned; never substitute BTC OI
Fill vs surface markBuy: fill_price - surface_mark; sell: surface_mark - fill_pricePrice points per contract and USD totalSurface/theoretical mark for traded instrumentestimated if surface-derived; unavailable if no mark
Entry IV edgeDirection/intent-aware comparison between trade_iv_estimate and benchmark/surface IVVol pointsTraded or estimated IV, benchmark IV, strategy assumptionestimated if IV inverted/modelled; unavailable if no IV source

Minimum execution-quality API shape:

execution_quality = {
  trade_id,
  source_trade_id,
  fill_price,
  benchmark_bid,
  benchmark_ask,
  benchmark_mid,
  fill_vs_mid,
  fill_vs_mid_bps,
  spread_capture,
  fill_vs_surface_mark,
  entry_iv_edge,
  source_name,
  source_timestamp,
  time_delta_minutes,
  metric_quality,
  missing_fields
}

2. Opportunity Alignment

Opportunity alignment asks whether the trade was entered when dashboard signals indicated a coherent opportunity. It is a signal-consistency measure, not a P&L measure.

The current MSTR/COIN scope should use BTC-linked dashboard context for these metrics unless a later decision changes the proxy mapping.

MetricFormula / definitionUnitRequired inputsNo-data behavior
Market proxyExplicit mapping from trade underlying/portfolio to dashboard market context, e.g. MSTR -> BTCLabelTrade underlying or portfolio, mapping configunmapped / unsupported; never silently default to BTC
DVol percentile at entryPercentile rank of DVol at trade time over configured lookbackPercentile 0-100Trade-time DVol, lookback distributionunavailable if no timestamp-matched DVol
VRP at entryimplied_volatility - realized_volatilityVol pointsIV/DVol/ATM IV and RV contextunavailable if either side missing
VRP bucketBucketed VRP state, e.g. cheap_vol, neutral, rich_volLabelVRP and thresholdsunavailable if VRP missing
Smile rich/cheap bucketTrailing z-score or equivalent surface-deviation bucket for relevant tenor/deltaLabel plus z-scoreSurface point and trailing baselinenot_sourced for current Alpha MSTR/COIN trade rows; otherwise unavailable if no comparable surface history
Gamma regimeshort_gamma, neutral, or long_gamma from GEX imbalance percentilesLabelGEX imbalance history near trade timeunavailable if no GEX context
Stationarity statusstable, unstable, or insufficient for regime-forward-return relationshipLabelStationarity calculation near trade timeinsufficient or unavailable as appropriate
Term structure stateFront/back IV relationship such as inverted, flat, or contangoLabelIV by tenor near trade timeunavailable if tenors missing
Flow confirmationWhether contemporaneous block/flow/put-call signals agree with trade direction/vol stanceScore or labelFlow data, rule contractunavailable if no flow data
Alignment scoreDeterministic weighted score from available drivers and detractors0-100At least one signal and stated assumptionunavailable if no reliable signal context
Alignment confidenceConfidence reduction from stale data, proxy mapping, stationarity, missing fields0-1 or labelQuality states for driversMust reduce confidence when inputs are stale/proxy/estimated

Candidate alignment interpretation:

Trade assumptionSupportive signalsDetracting signals
Long volatility / option buyLow DVol percentile, low/negative VRP, unstable/short-gamma regime, favorable convexityHigh VRP, stable long-gamma regime without catalyst
Short volatility / option sellHigh DVol percentile, positive/rich VRP, stable/long-gamma regimeLow VRP, unstable short-gamma regime
Directional call buyUpside flow, call demand, favorable conditional upside density, stable enough regimePut-heavy protection flow, downside conditional skew
Directional put buyDownside flow, protection demand, negative/unstable spot-vol/gamma contextUpside flow, stable long-gamma pinning context

Because Alpha currently lacks strategy intent, the first implementation should store the assumption used to calculate alignment.

Minimum opportunity-alignment API shape:

opportunity_alignment = {
  trade_id,
  source_trade_id,
  market_proxy,
  mapping_method,
  mapping_confidence,
  assumed_trade_intent,
  alignment_score,
  alignment_label,
  drivers,
  detractors,
  confidence,
  context_timestamp,
  context_time_delta_minutes,
  metric_quality,
  missing_fields
}

3. Outcome Quality

Outcome quality asks what happened after the trade and whether outcomes cluster by regime or signal.

Outcome metrics should operate on both execution rows and lifecycle/position groups once lifecycle grouping exists. Per-trade outcome is useful, but position-level outcome is often the more defensible trading answer.

The backend persists sourced 1d/7d/30d marks in trade_forward_outcome_marks through /api/internal/trades/outcomes/backfill. Performance APIs read those persisted rows by default so user-facing P&L is repeatable and carries source quality.

MetricFormula / definitionUnitRequired inputsNo-data behavior
Forward mark at horizonSourced option mark at trade_date + horizon for the traded contract. If the requested horizon is after option expiry, use a sourced terminal option quote near expiry when available.Price per contractSame-contract mark/quote near horizon or terminal option quote near expiryunavailable if no sourced mark
Forward mark qualityCurrent implementation: quoted, stale, pending, unavailable; terminal expiry marks use quoted quality plus explicit terminal_mark state/source labels. Future settlement/model states must remain explicit.LabelMark source metadataRequired for every displayed mark
Forward P&LBefore fees: buy = mark_value - entry_value, sell = entry_value - mark_value; after fees subtract sourced fees when fees are available.USDEntry value, mark value, quantity, multiplier, optional feesunavailable if mark missing; never show zero by default
Forward return on premiumforward_pnl / abs(entry_premium_usd)PercentForward P&L, entry premiumunavailable if premium <= 0 or P&L missing
Spot move after trade(future_spot - entry_spot) / entry_spotPercentEntry/future spot for relevant market/underlyingunavailable if entry/future spot missing
Moneyness changeEntry moneyness versus forward moneynessPercent or ratioStrike, entry spot, future spotunavailable if spot missing
Realized vol after tradestd(log_returns) * sqrt(365 * periods_per_day) * 100 over horizonAnnualized percentSufficient spot observationsunavailable if too few observations
Realized-vol captureFor long vol: realized_vol - entry_iv; for short vol: entry_iv - realized_volVol pointsEntry/traded IV or benchmark IV, realized volunavailable if either side missing
Hit ratecount(successful outcomes) / count(available outcomes)PercentDefined success rule and available outcomesExclude unavailable outcomes from denominator and report excluded count
Average edge by regime/signalMean outcome metric grouped by regime/signal bucketUSD, percent, or vol pointsOutcome metric and trade-time contextShow sample size and quality mix

Required horizons for first implementation:

HorizonPurposeQuality requirement
1dShort-term execution/opportunity feedbackSourced mark or explicit estimate label
7dNear-term signal follow-throughSourced mark or explicit estimate label
30dMedium horizon outcomeSourced mark or explicit estimate label
expiryFinal outcomeAuthoritative source required for displayed realized P&L; expiry quote marks are terminal marks, not accounting-realized P&L

Expiry outcomes must remain unavailable unless backed by sourced quote, close, settlement, Alpha realized outcome, or equivalent authoritative mark. A model-estimated intrinsic value can only be shown as model_estimated, not as realized P&L.

Outcome states:

StateMeaning
unrealized_markP&L is computed from a fresh sourced mark at the requested horizon while the option is still live.
terminal_markP&L is computed from a fresh sourced terminal option quote near expiry because the requested horizon is after expiry. This is not authoritative realized P&L.
pendingThe requested horizon has not matured and no terminal expiry mark can be known yet.
unavailableRequired mark, entry premium, direction, quantity, or source data is unavailable.

Minimum outcome API shape:

outcome = {
  trade_id_or_position_id,
  source_trade_ids,
  horizon,
  entry_value_usd,
  mark_value_usd,
  pnl_usd,
  return_on_premium,
  realized_vol,
  realized_vol_capture,
  spot_move,
  regime_at_entry,
  signal_bucket_at_entry,
  mark_source,
  mark_timestamp,
  mark_time_delta_minutes,
  metric_quality,
  missing_fields
}

Position And Lifecycle Requirements

Raw Alpha rows are executions. Many performance questions need lifecycle grouping before they can be answered defensibly.

Minimum grouping key:

source_portfolio
underlying_symbol
instrument or option_symbol
option_type
strike
expiry
direction/sign

Required position/lifecycle metrics:

MetricFormula / definitionUnitRequired inputsNo-data behavior
Net quantitySigned sum of executionsContracts/sharesDirection, quantity, lifecycle groupingunavailable if grouping ambiguous
Average entry priceWeighted average fill price for opening executionsPrice per contractFill prices and quantitiesunavailable if open/close cannot be separated
Total entry premiumSum of signed or absolute entry premiums depending on viewUSDPremiums, direction, multiplierunavailable if any required premium missing
Total feesSum of source feesUSDFeesShow unavailable or explicit zero only if source semantics are clear
Open/closed stateWhether net quantity is zero after offsetsLabelFull execution set for contract/scopeambiguous if incomplete lifecycle
Realized closed P&LAuthoritative realized P&L from accounting or validated lifecycle cashflowUSDSource-system P&L or explicitly validated open/close pairingunavailable until sourced or validated

If a row cannot be confidently paired, label it ambiguous_lifecycle. Do not force ambiguous rows into realized P&L. Same-contract FIFO cashflow can be retained for research, but it must not be shown as user-facing realized P&L until reconciled to source accounting.

Aggregation Contract

Aggregates are only meaningful when they expose sample size and quality composition.

Required aggregate dimensions:

DimensionExamples
PortfolioIMST, ICOI
Traded underlyingMSTR, COIN
Dashboard market proxyBTC
Date window1d, 7d, 30d, custom
Gamma regimeshort, neutral, long
Stationarity statusstable, unstable, insufficient
VRP bucketcheap, neutral, rich
DVol percentile bucketbottom decile, middle, top decile
Smile bucketnot_sourced for current Alpha MSTR/COIN trade rows; cheap/fair/rich only when an approved trade-level smile source exists
Trade intent assumptionlong-vol, short-vol, directional call, directional put, unknown
Outcome qualitysourced, estimated, stale, unavailable

Every aggregate must include:

sample_count
available_count
unavailable_count
estimated_count
stale_count
proxy_mapped_count

Aggregates must not silently exclude bad data. If unavailable rows are excluded from a calculation, show the excluded count.

First-Screen Questions

The Trade Performance screen should answer these questions in order:

  1. Is the selected Alpha scope loaded cleanly enough to interpret Performance?
  2. Which trades have enough context to score opportunity alignment?
  3. When trades were entered, were dashboard signals cheap/rich, stable/unstable, or confirming/conflicting?
  4. Which context source groups are available, partial, or unavailable?
  5. Were fills good versus the actual traded instrument market? Current answer: available only for rows with fresh sourced execution-time quotes; otherwise not benchmarked, stale, or unavailable.
  6. What happened after entry at defensible horizons? Current answer: available only for rows with persisted fresh forward marks; pending for immature horizons and unavailable for matured horizons without sourced marks.
  7. Is realized P&L sourced? Current answer: unavailable until authoritative accounting or validated lifecycle data exists.
  8. Which regimes, signals, portfolios, or underlyings are associated with better or worse outcomes? Current answer: bucket counts are available; P&L and hit-rate aggregates are available only for rows with sourced forward marks.
  9. Which results are unavailable because data is missing rather than because economics were zero?

Implementation Sequence Dependencies

This contract originally preceded implementation. It now remains the governing contract for the live Performance screen and the follow-on data-sourcing work.

Next ticketDependency from this contract
ENG-4937 market proxy mappingRequires explicit market_proxy, mapping_method, and no silent BTC fallback.
ENG-4939 trade-time contextRequires context fields, freshness tolerances, missing-field tracking, and quality states.
ENG-4940 execution benchmarksRequires direction-aware fill-vs-mid, spread capture, quote/source metadata, and no fabricated bid/ask/mid.
ENG-4942 lifecycle groupingRequires execution-to-position aggregation and ambiguous lifecycle states.
ENG-4941 opportunity alignmentRequires deterministic drivers, detractors, assumed intent, score, confidence, and data quality.
ENG-4943 outcome attributionRequires sourced/estimated/unavailable separation and horizon-specific quality states.
ENG-4944 API/UIRequires every displayed metric to include units, source, and quality state.
ENG-4945 backfill/freshness/testsRequires idempotent backfills and stale/unavailable quality reporting.

Non-Goals For This Contract

  • It does not treat missing TradFi quote coverage as zero slippage or zero P&L.
  • It does not authorize displaying a metric without source and quality state.
  • It does not authorize model-estimated expiry P&L as realized P&L.
  • It does not infer strategy intent from direction alone.
  • It does not change the Alpha sync or sync-completeness diagnostic workflow.

Review Checklist

  • Each metric has a formula or deterministic definition.
  • Each metric has a unit.
  • Each metric names required inputs.
  • Each metric defines no-data behavior.
  • Proxy underlyings are separated from quote/outcome underlyings.
  • Current Alpha field gaps are explicit.
  • Aggregates expose sample count and data-quality composition.
  • No missing input is represented as zero.