feat(research): show retained final risk state (RP19)
This commit is contained in:
parent
7a86b15e27
commit
e6616fdc3d
3 changed files with 313 additions and 0 deletions
|
|
@ -88,6 +88,8 @@ export function CanonicalResults({
|
|||
const { financial, analytics, request } = result;
|
||||
const valuation = financial.projection.valuation;
|
||||
const currency = financial.view.portfolio.baseCurrency;
|
||||
const risk = financial.view.risk;
|
||||
const riskPolicy = financial.policy.matching.risk;
|
||||
const samples = [
|
||||
{
|
||||
timestamp: financial.reporting.tradeStart,
|
||||
|
|
@ -245,6 +247,62 @@ export function CanonicalResults({
|
|||
fees. Holdings are valued using the last available marks.
|
||||
</p>
|
||||
</section>
|
||||
<section aria-label="Final risk state" className="space-y-3">
|
||||
<h3 className="font-semibold">Final risk state</h3>
|
||||
<dl className="grid gap-3 sm:grid-cols-3 text-sm">
|
||||
{[
|
||||
{ label: 'Daily-loss halt', active: risk.dailyHalted },
|
||||
{ label: 'Drawdown halt', active: risk.drawdownHalted },
|
||||
].map(({ label, active }) => (
|
||||
<div key={label}>
|
||||
<dt>{label}</dt>
|
||||
<dd className={active ? 'font-medium text-warning' : 'text-text-secondary'}>
|
||||
{active ? 'Active at end' : 'Inactive at end'}
|
||||
</dd>
|
||||
</div>
|
||||
))}
|
||||
{[
|
||||
['Daily-loss limit', riskPolicy.maxDailyLoss],
|
||||
['Drawdown limit', riskPolicy.maxDrawdownAmount],
|
||||
['Daily equity baseline', risk.dailyBaseline],
|
||||
['Peak equity', risk.peakEquity],
|
||||
].map(([label, value]) => (
|
||||
<div key={label}>
|
||||
<dt>{label}</dt>
|
||||
<dd className="font-mono">{value}</dd>
|
||||
</div>
|
||||
))}
|
||||
<div>
|
||||
<dt>Risk session</dt>
|
||||
<dd>{risk.riskSession.sessionId}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Risk calendar</dt>
|
||||
<dd className="break-all">
|
||||
{risk.riskSession.calendarId} · revision {risk.riskSession.calendarRevision}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Risk session start (UTC)</dt>
|
||||
<dd>{canonicalTime(risk.riskSession.startsAt)}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Last processed risk event (UTC)</dt>
|
||||
<dd>{canonicalTime(risk.lastEventTime)}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<p className="text-xs text-text-secondary">
|
||||
Amounts are in {currency} and come from the retained Rust state and policy. An active halt
|
||||
blocks risk-increasing orders; exposure-reducing orders remain permitted subject to other
|
||||
checks. Inactive at end describes only this snapshot, not whether earlier halts or other
|
||||
rejections occurred.
|
||||
</p>
|
||||
<p className="text-xs text-text-secondary">
|
||||
Daily-loss state can reset at an account risk-session boundary. Price recovery alone does
|
||||
not clear a latched drawdown halt. The last processed risk event is not the first halt
|
||||
time; this report does not contain halt history or rejection counts.
|
||||
</p>
|
||||
</section>
|
||||
<section className="space-y-3">
|
||||
<h3 className="font-semibold">Canonical metrics</h3>
|
||||
<dl aria-label="Evaluation horizon" className="grid gap-3 sm:grid-cols-3 text-sm">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue