qis.PortfolioHolding¶
- class qis.PortfolioHolding(holding_id, name, observed_mtm, legs=(), payoff=None, kink_policy=KinkPolicy.MIDPOINT, metadata=<factory>)[source]¶
Bases:
objectOriginal position identity with an observed reference-currency mark.
- Variables:
holding_id (str) – Unique source position ID retained in every contributor table.
name (str) – Display name.
observed_mtm (float) – Signed source value in portfolio reference currency.
legs (tuple[qis.portfolio.stress.instruments.InstrumentLeg, ...]) – Vanilla decomposition; a funded holding has one DELTA_1 leg.
payoff (qis.portfolio.stress.instruments.HoldingPayoff | None) – Optional public composite, mutually exclusive with legs.
kink_policy (qis.portfolio.stress.instruments.KinkPolicy) – Common quote-derivative side for all vanilla legs.
metadata (Mapping[str, str]) – Plain string annotations such as account or liquidity tier.
- Parameters:
holding_id (str)
name (str)
observed_mtm (float)
legs (tuple[InstrumentLeg, ...])
payoff (HoldingPayoff | None)
kink_policy (KinkPolicy)
- __init__(holding_id, name, observed_mtm, legs=(), payoff=None, kink_policy=KinkPolicy.MIDPOINT, metadata=<factory>)¶
- Parameters:
holding_id (str)
name (str)
observed_mtm (float)
legs (tuple[InstrumentLeg, ...])
payoff (HoldingPayoff | None)
kink_policy (KinkPolicy)
- Return type:
None
Methods
__init__(holding_id, name, observed_mtm[, ...])get_mtm(context, baseline_context)Return observed mark plus modeled payoff change.
get_pnl(context, baseline_context)Return change in modeled value from the zero-shock anchor.
model_payoff(context)Evaluate the payoff model before adding a derivative's mark offset.
response_jacobian(context)Return local dollar derivative by shared underlying response at one scenario.
Attributes
Return whether this is a single funded holding.
- legs: tuple[InstrumentLeg, ...] = ()¶
- payoff: HoldingPayoff | None = None¶
- kink_policy: KinkPolicy = 'midpoint'¶
- model_payoff(context)[source]¶
Evaluate the payoff model before adding a derivative’s mark offset.
- Parameters:
context (PayoffContext) – Shared public scenario market view.
- Returns:
Scenario model values in reference currency.
- Return type:
- get_pnl(context, baseline_context)[source]¶
Return change in modeled value from the zero-shock anchor.
- Parameters:
context (PayoffContext) – Scenario market view.
baseline_context (PayoffContext) – Single-row zero-shock market view.
- Returns:
Scenario P&L in reference currency.
- Return type:
- get_mtm(context, baseline_context)[source]¶
Return observed mark plus modeled payoff change.
- Parameters:
context (PayoffContext) – Scenario market view.
baseline_context (PayoffContext) – Single-row zero-shock market view.
- Returns:
Scenario values in reference currency.
- Return type:
- response_jacobian(context)[source]¶
Return local dollar derivative by shared underlying response at one scenario.
- Parameters:
context (PayoffContext) – A single-scenario market view retaining original quote/FX baselines.
- Returns:
Dollar sensitivities indexed by every fitted response ID.
- Return type: