valuation
Contain valuation visitor classes for banking and trading books.
Classes:
-
BankingBookValuationVisitor–A visitor for banking book valuation.
-
TradingBookValuationVisitor–A visitor for trading book valuation.
-
ValuationVisitor–Abstract base class for valuation visitors.
BankingBookValuationVisitor
BankingBookValuationVisitor(
market_state: MarketState,
*,
valuation_date: date | None = None,
)
Bases: ValuationVisitor
A visitor for banking book valuation.
Methods:
-
banking_book_only–Skip instruments not in the banking book.
-
set_date–Set the valuation date and relink the term structure from the MarketState.
-
visit_amortizing_fixed_rate_loan–Value an amortizing fixed rate loan.
-
visit_cash–Value cash — no pricing required.
-
visit_common_equity–Value common equity — no pricing required.
-
visit_covered_bond–Value a covered bond.
-
visit_credit_card–Value a credit card.
-
visit_deposit–Value deposit — no pricing required.
-
visit_fixed_rate_bond–Value a fixed rate bond.
-
visit_personal_loan–Value a personal loan.
-
visit_variable_rate_loan–Value a variable rate loan — delegates to the same amortizing-loan path.
banking_book_only
staticmethod
banking_book_only(method)
Skip instruments not in the banking book.
set_date
set_date(date: date) -> None
Set the valuation date and relink the term structure from the MarketState.
visit_amortizing_fixed_rate_loan
visit_amortizing_fixed_rate_loan(
instrument: AmortizingFixedRateLoan,
) -> None
Value an amortizing fixed rate loan.
visit_common_equity
visit_common_equity(instrument: CommonEquity) -> None
Value common equity — no pricing required.
visit_fixed_rate_bond
visit_fixed_rate_bond(instrument: FixedRateBond) -> None
Value a fixed rate bond.
visit_variable_rate_loan
visit_variable_rate_loan(
instrument: VariableRateLoan,
) -> None
Value a variable rate loan — delegates to the same amortizing-loan path.
TradingBookValuationVisitor
TradingBookValuationVisitor(
market_state: MarketState,
*,
valuation_date: date | None = None,
)
Bases: ValuationVisitor
A visitor for trading book valuation.
Methods:
-
set_date–Set the valuation date and relink the term structure from the MarketState.
-
trading_book_only–Skip instruments not in the trading book.
-
visit_amortizing_fixed_rate_loan–Value an amortizing fixed rate loan.
-
visit_cash–Value cash — no pricing required.
-
visit_common_equity–Value common equity — no pricing required.
-
visit_covered_bond–Value a covered bond.
-
visit_credit_card–Value a credit card.
-
visit_deposit–Value deposit — no pricing required.
-
visit_fixed_rate_bond–Value a fixed rate bond.
-
visit_personal_loan–Value a personal loan.
-
visit_variable_rate_loan–Value a variable rate loan — delegates to the same amortizing-loan path.
set_date
set_date(date: date) -> None
Set the valuation date and relink the term structure from the MarketState.
trading_book_only
staticmethod
trading_book_only(method)
Skip instruments not in the trading book.
visit_amortizing_fixed_rate_loan
visit_amortizing_fixed_rate_loan(
instrument: AmortizingFixedRateLoan,
) -> None
Value an amortizing fixed rate loan.
visit_common_equity
visit_common_equity(instrument: CommonEquity) -> None
Value common equity — no pricing required.
visit_fixed_rate_bond
visit_fixed_rate_bond(instrument: FixedRateBond) -> None
Value a fixed rate bond.
visit_variable_rate_loan
visit_variable_rate_loan(
instrument: VariableRateLoan,
) -> None
Value a variable rate loan — delegates to the same amortizing-loan path.
ValuationVisitor
ValuationVisitor(
market_state: MarketState,
*,
valuation_date: date | None = None,
)
Bases: Visitor
Abstract base class for valuation visitors.
Methods:
-
set_date–Set the valuation date and relink the term structure from the MarketState.
-
visit_amortizing_fixed_rate_loan–Value an amortizing fixed rate loan.
-
visit_cash–Value cash — no pricing required.
-
visit_common_equity–Value common equity — no pricing required.
-
visit_covered_bond–Value a covered bond.
-
visit_credit_card–Value a credit card.
-
visit_deposit–Value deposit — no pricing required.
-
visit_fixed_rate_bond–Value a fixed rate bond.
-
visit_personal_loan–Value a personal loan.
-
visit_variable_rate_loan–Value a variable rate loan — delegates to the same amortizing-loan path.
set_date
set_date(date: date) -> None
Set the valuation date and relink the term structure from the MarketState.
visit_amortizing_fixed_rate_loan
abstractmethod
visit_amortizing_fixed_rate_loan(
instrument: AmortizingFixedRateLoan,
) -> None
Value an amortizing fixed rate loan.
visit_common_equity
visit_common_equity(instrument: CommonEquity) -> None
Value common equity — no pricing required.
visit_covered_bond
abstractmethod
visit_covered_bond(instrument: CoveredBond) -> None
Value a covered bond.
visit_credit_card
abstractmethod
visit_credit_card(instrument: CreditCard) -> None
Value a credit card.
visit_fixed_rate_bond
abstractmethod
visit_fixed_rate_bond(instrument: FixedRateBond) -> None
Value a fixed rate bond.
visit_personal_loan
abstractmethod
visit_personal_loan(instrument: PersonalLoan) -> None
Value a personal loan.
visit_variable_rate_loan
visit_variable_rate_loan(
instrument: VariableRateLoan,
) -> None
Value a variable rate loan — delegates to the same amortizing-loan path.