MFN Engine
Most Favoured Nation eligibility calculation: rule layers, query-time evaluation, and mutation signals.The Most Favoured Nation engine determines which clauses each LP is eligible to elect into their side letter. It runs as a pure in-memory calculation over a pre-loaded data bundle.
Rule layers
Rules are applied in order. Each layer narrows or overrides the eligibility determined by the previous layer.
| # | Layer | Description |
|---|---|---|
| 1 | Basic rule | Fund-wide comparator gates. Dimensions: amount (commitment size), date (admission date), closing (closing sequence). Logic operator: AND or OR. If the basic rule says "OFF" on all dimensions, MFN is universal. |
| 2 | General rules | Per investor-category include/exclude. E.g. "Exclude sovereign wealth funds from fee-waiver clauses." |
| 3 | Individual rules | Per commitment include/exclude overrides. E.g. "Exclude LP X from clause Y with rationale Z." |
| 4 | Clause exclusions | Per-clause carve-outs at fund-wide, category, or commitment scope. |
Query-time evaluation
MFN eligibility is calculated when a page or API request needs eligibility results. Mutation handlers no longer diff eligibility before and after each write.
Current flow
- Load the fund's MFN rule and clause bundle
- Run
calculateMfnFromDatafor the relevant LP vehicle - Render eligibility from the result
- Record rule mutations separately with
recordFundSignal
The signal stream records that an MFN rule changed. It does not try to persist every derived eligibility flip.
Performance
The engine cost is paid by readers that need MFN results, not by every MFN-shaped mutation. Signal writes are one append to
fund_signals after the database mutation succeeds.
Caching
The MFN bundle is cached per fund for 60 seconds. Activity logging invalidates the bundle cache for MFN-shaped mutations that pass through logActivityBg.