Risk Calculation

v1.3.1
io.github.mselcukozturk/risk-calculation Checked 1 hour ago Published 8 days ago

Local IRB and standardised credit risk weights, RWA and capital under EU CRR/CRR3 and BDDK.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_risk_capabilities Credit risk calculation scope

List supported rule books, current/draft status, exposure classes, input units and calculation limits. Use before selecting a credit-risk calculation; does not cover market, operational or liquidity risk.

calculate_irb IRB credit risk weight and capital

Calculate single-exposure IRB risk weight, correlation, effective PD/LGD floors, RWA and 8% capital. Supports corporate/SME, institutions, central governments, retail, defaulted exposures (PD 100 with ELBE) and the 1.25 financial sector multiplier under EU CRR/CRR3 or BDDK current/draft. Requires explicit regime; PD 1 means 1%.

ParameterTypeDescription
exposureClass *string
lgd *numberLoss given default in percentage points: 40 means 40%.
pd *numberProbability of default in percentage points: 1 means 1%, not 0.01. 100 means a defaulted exposure and requires elbe unless foundation is true.
regime *stringRequired rule book. bddk is current Turkish rules; bddkDraft is a draft, not current law. Never infer jurisdiction from the conversation language.
annualSalesnumberRequired for corporateSme: consolidated annual turnover in EUR millions for EU, TRY millions for BDDK.
currencystringOptional three-letter currency label; no currency conversion is performed.
eadnumberOptional exposure at default in currency units. No customer identifiers.
elbenumberRequired for a defaulted exposure (pd 100) with own LGD: best estimate of expected loss in percentage points.
financialSectorbooleancorporate and institution only: true for a large regulated or an unregulated financial sector entity, which multiplies correlation by 1.25. Under crr3 and bddkDraft it also requires foundation. Never…
foundationbooleancorporate, corporateSme, institution and sovereign only: true for the foundation approach. Required for institution under crr3 and bddkDraft and for sovereign under bddkDraft. Pass the supervisory LGD…
maturitynumberCorporate, institution or sovereign maturity in years; omitted means 2.5. Not applicable to retail or defaulted exposures.
qrreTransactorbooleanCRR3 qrre only: true for a QRRE transactor (balance repaid in full at each scheduled date over the previous 12 months, or overdraft not drawn in that period), which uses the 0.05% PD floor instead of…
smeLimitnumberRequired Board limit C in TRY millions for bddkDraft corporateSme. Current BDDK uses 1000; EU uses 50 EUR million.

calculate_standardised Standardised credit risk weight and capital

Calculate single-exposure standardised risk weight, CCF, RWA and 8% capital under EU CRR/CRR3 or BDDK current/draft. Explicit class-specific facts required; do not infer eligibility. Output floor rate is informational, never applied to a single exposure.

ParameterTypeDescription
exposureClass *string
item *string
regime *stringRequired rule book. bddk is current Turkish rules; bddkDraft is a draft, not current law. Never infer jurisdiction from the conversation language.
year *integerCalculation year for CRR3 phase-ins; does not make draft BDDK rules current law.
adcQualifyingboolean
amountnumberAmount after provisions and before credit conversion, in currency units; maximum 1e15.
annualSalesnumberConsolidated turnover in EUR millions for EU supporting factor, TRY millions for BDDK SME assessment.
averageRwnumber
ciuMethodstring
counterpartyRwnumberUnsecured counterparty risk weight in percentage points.
currencystring
currencyMismatchbooleanExplicit confirmation of the regulatory currency mismatch conditions for retail/residential.
defaultedSecuredstring
domesticbooleanExplicit confirmation that domestic-currency sovereign preferential conditions are met.
equityTypestring
iprebooleanWhether repayment materially depends on property cash flows.
issuerRwnumber
lendingTypestring
leveragenumber
longTermbooleanRequired for legacy commitments: whether original maturity exceeds one year.
ltvnumberLoan-to-value percentage points, e.g. 70 for 70%.
mdbListedbooleanExplicit confirmation that the MDB meets the listed zero-weight conditions.
otherTypestring
provisionRationumber
qualifyingbooleanExplicit confirmation of all preferential property conditions, including first lien where required.
ratingstringCredit quality step as a string, or unrated; not a rating agency label.
retailTypestring
scrastring
shortTermboolean
shortTermRatingstring
smebooleanRequest BDDK draft corporate SME assessment using annualSales and smeLimit; never infer eligibility.
smeFactorbooleanExplicit confirmation of Article 501 eligibility; EU only, supported classes only.
smeLimitnumberApplicable BDDK Board limit in TRY millions. Turnover must be strictly below it.
smeTotalnumberArticle 501 total amount owed E* in EUR, separate from amount and its currency.
sovereignRatingstring
thirdPartyboolean