qis.PortfolioAccounting¶
- class qis.PortfolioAccounting(positions, net_equity, reporting_basis=ReportingBasis.NET_EQUITY, fixed_notional=None, tolerance=0.01)[source]¶
Bases:
objectReconciled reference-currency account ledger, independent of fitted coverage.
The ledger is complete even when some positions have no risk model. All marks include accrued amounts exactly once. Short and derivative liabilities remain separate from declared borrowing. Values describe accounting marks, not gross derivative risk exposure. Scenario equity includes P&L from valued holdings; missing risk coverage remains disclosed.
- Variables:
positions (pandas.DataFrame) – Unique holding-ID index; columns mtm and role (PositionRole). Optional asset_class (AccountAssetClass or its display value) and currency columns map each position to its allocation category and currency. Both columns must be supplied together. Marks remain in reference currency; allocation currency is independent of fitted-return currency.
net_equity (float) – Explicit positive account equity, reconciled to signed marks.
reporting_basis (qis.portfolio.stress.accounting.ReportingBasis) – Meaning of the portfolio’s reporting denominator.
fixed_notional (float | None) – Positive explicit denominator when using FIXED_NOTIONAL.
tolerance (float) – Absolute reference-currency reconciliation tolerance.
- Parameters:
positions (DataFrame)
net_equity (float)
reporting_basis (ReportingBasis)
fixed_notional (float | None)
tolerance (float)
- __init__(positions, net_equity, reporting_basis=ReportingBasis.NET_EQUITY, fixed_notional=None, tolerance=0.01)¶
- Parameters:
positions (DataFrame)
net_equity (float)
reporting_basis (ReportingBasis)
fixed_notional (float | None)
tolerance (float)
- Return type:
None
Methods
__init__(positions, net_equity[, ...])Add signed financing to gross invested-asset allocations by currency.
Aggregate positive marks by declared asset class and allocation currency.
reconcile_holdings(holdings)Check that every valued holding belongs to the complete dated ledger.
summary()Return reconciled balance-sheet levels and funding leverage ratios.
Attributes
Return positive drawn borrowing from declared financing rows.
Return the amount specified by the declared reporting basis.
Return the factual caption shared by report headers and exports.
Return positive accounting marks including cash and accrued amounts.
- reporting_basis: ReportingBasis = 'net_equity'¶
- gross_asset_allocation()[source]¶
Aggregate positive marks by declared asset class and allocation currency.
- Returns:
Class-by-currency reference-currency amounts in the five standard buckets. An empty table indicates that the caller supplied no allocation mapping. Liabilities remain in the reconciled balance sheet, outside gross allocation.
- Return type:
- allocation_with_borrowing()[source]¶
Add signed financing to gross invested-asset allocations by currency.
- Returns:
Class-by-currency amounts. Positive asset classes sum to gross assets; Borrowing is negative. Dividing each row by gross assets shows funding leverage without changing the 100% total invested-asset allocation.
- Return type: