Add equity investments in funds (CRE60) — v0.22.0#27
Conversation
New rwa/equity_in_funds.py implementing the CRE60 hierarchy. - fund_average_risk_weight / fund_leverage: the fund's average risk weight (underlying RWA / total assets) and leverage (assets / equity). - look_through_rwa / mandate_based_rwa: RWA = min(avg_RW * leverage, 1250%) * investment for the Look-Through and Mandate-Based approaches. - fall_back_rwa: the 1250% Fall-Back Approach. Each returns a FundRWAResult with the effective risk weight, RWA, and a cap-binding flag. 13 new tests; module at 100% coverage. Full suite 2,761 passing, 100% line coverage, mypy and ruff clean. Bumps to 0.22.0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PktGA7a3zzvbAczr6UhrsT Signed-off-by: Claude <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 24 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d7abdd273
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| investment=round(investment, 6), | ||
| effective_risk_weight=_MAX_RISK_WEIGHT, | ||
| rwa=round(_MAX_RISK_WEIGHT * investment, 6), | ||
| capped=True, |
There was a problem hiding this comment.
Mark fall-back results as uncapped
When fall_back_rwa() is used because neither LTA nor MBA applies, the 1250% weight is the approach itself, not the CRE60 cap on an avg_RW × leverage calculation. Setting capped=True makes every fall-back exposure look like a cap-binding LTA/MBA result, which conflicts with the FundRWAResult.capped contract and can mislead audit/reporting consumers that distinguish fallback from capped look-through results.
Useful? React with 👍 / 👎.
Summary
New
rwa/equity_in_funds.pyimplementing the BCBS CRE60 hierarchy for risk-weighting a bank's equity investments in funds.What's new
fund_average_risk_weight(underlying_rwa, fund_total_assets)andfund_leverage(total_assets, total_equity)— the two LTA/MBA inputslook_through_rwa(...)/mandate_based_rwa(...)—RWA = min(avg_RW × leverage, 1250%) × investmentfall_back_rwa(investment)— the 1250% Fall-Back ApproachEach returns a
FundRWAResult(approach, effective risk weight, RWA, cap-binding flag); the avg-RW × leverage product is capped at 1250% per CRE60.7.Tests
13 new tests covering the average-RW and leverage helpers, the LTA/MBA calculation, the 1250% cap binding, the fall-back, and validation. Module at 100% coverage.
Full suite: 2,761 passing, 100% line coverage (8,337 statements),
mypyclean (171 files),ruffclean. Version 0.22.0.🤖 Generated with Claude Code
Generated by Claude Code