Part 1 · The idea
1Why not one attribution vector?
Under the internal-models approach of the Fundamental Review of the Trading Book (FRTB-IMA), market-risk capital is set for a bank’s approved trading desks as a whole. The rules do not say how that number should be split across trades, yet risk managers, capital planners and validators ask for exactly that. The obvious answer is to compute one vector per trade, usually a gradient (Euler) allocation or one of the published FRTB allocation rules, and to use it wherever a trade-level number is needed.
That vector is then asked several different questions. A desk report needs numbers that add up to capital. A what-if screen needs the change in capital if a trade is removed. A pre-trade check needs the local sensitivity. An audit needs to know where the capital came from. These answers coincide only in special cases, and FRTB is rarely one: its expected-shortfall, stress-ratio, history and standardised-approach layers are nonsmooth, and part of today’s charge is computed from books held weeks earlier.
So FRTBTrace starts from the question. It distinguishes five of them, evaluates all five against one deterministic calculation of the full capital formula, and returns with each answer what it may be used for.
The ingredients are known. Euler and Aumann–Shapley allocation for homogeneous risk measures, the fact that removal effects do not add up, and allocation at points where the risk measure has a kink are standard results in capital allocation. What FRTBTrace adds is exact, node-by-node propagation through the whole internal-models calculation, including the history maxima and averages, the stress-ratio floor, the amber surcharge and the comparison with standardised capital; a ledger over (observation date, trade) rather than over today’s trades; the exact frozen remainder that separates the two; and answers that state their question, with an explicit outcome when there is no answer.
2Five questions
Marginal
Which trades move K locally today?
A gradient on today’s book. At a tie it is a set, not one vector.
Adds up to K: not in general
Removal
What happens to K if trade i goes?
A finite counterfactual, answered by revaluing the book without the trade.
Adds up to K: not in general
Accounting
How should K be split over current trades or desks?
A declared remap of the origin ledger onto today’s trades.
Adds up to K: yes
Origin
Which (date, trade) positions generated K?
The ledger from the reverse pass, one entry per stored date and trade.
Adds up to K: yes
Hedge choice
Which candidate action gives the lowest K?
A ranking of candidate actions by exact revaluation.
A ranking, not a sum
The questions are not five estimates of one hidden quantity. Using a marginal vector as a desk report gives numbers that need not add up; using an accounting share as a removal estimate gives a number that is not the what-if effect; and looking only at today’s book misses the capital that stored history generates. Coalition values (Shapley values over trades) are a sixth candidate, but on these books many of the sub-book capitals they need do not exist, so they have no answer.
3Ties and history
Two features of the formula pull the questions apart. The first is ties. Take capital , which is itself a two-scenario expected shortfall, at . Removing either trade leaves , so both removal effects are zero and their sum is zero, not one. The local marginal is the whole segment between and . An accounting ledger can still add up to K, but only by declaring how the tie is split.
Two trades, one tie Illustrative
The second is history. FRTB compares recent charges with moving averages of past charges (60 daily and 12 weekly observations). When an averaged branch is active, part of today’s capital is generated by books held on earlier dates. Differentiating only today’s positions cannot reach that part; at smooth points its size is exact, and we call it the frozen remainder:
Here is the book held on stored date and is today’s book. A sensitivity to today’s book can be numerically correct and still leave most of the capital unexplained.
4The method in one picture
FRTBTrace writes the full capital calculation as a graph. Expected shortfall is evaluated on blocks for each risk class, factor set and liquidity horizon, aggregated over horizons, scaled by a floored stress ratio and combined into the internal-models charge; non-modellable and default-risk charges are added; history enters through maxima against moving averages; and the result is compared with standardised-approach capital.
- One forward passCapital K is evaluated once, and every nonsmooth node records its active branch: whether the stress-ratio floor binds, which history branch is selected, which side of the final minimum is active.
- One reverse passAllocation vectors flow back through every node by local Euler rules: dual weights at each expected shortfall, the active branch at floors and maxima, the active default-quantile scenario.
- Typed answersThe origin ledger lands on (date, trade) positions and adds up to K; removal and hedge choice are exact revaluations; at a tie, one valid marginal point is returned and flagged.
5Where it runs
Exact engine tested
A deterministic finance tool, not an AI model
Evaluates capital before and after an action, with every node value and branch state, and returns the typed answer with its reconciliation check. Ties are detected at relative tolerance . The benchmark protocol and result schema give each answer one of 6 outcomes: answered, no answer on this book, not applicable, declines, fails, or not run; the engine itself does not yet emit them, and the command-line prototype returns 4 of them.
Agent tool interface Proposed
A contract for financial AI agents
Every answer states its question and use; only additive ledgers may be grouped into desk views; undefined and out-of-scope cases are explicit, never silent zeros; approximations fail closed. A command-line prototype exists; the message schema and escalation workflow are not implemented.
Part 2 · The evidence
Tested so far synthetic benchmark
- All five questions on 60 pre-registered books, with ties flagged
- Ledgers add up to the engine’s capital on every book
- The origin ledger against finite differences of capital, all 80,640 positions of the smooth main books
- Tie answers against independently built sets on 36 kink books
- Six published allocators and a numerical Euler control on the same books
Not yet Coming soon
- Bank-style portfolios and real desk groupings
- A second, independent implementation of capital
- Timing and scaling
- An agent-in-the-loop study
6A pre-registered benchmark
The benchmark has 60 books fixed before any method was run. There are 42 small tie books of 10–14 trades, 36 of them built to sit on one kink each and 6 smooth controls, and 18 main books of 96 trades: three draws of each of six portfolio types (ordinary, nonlinear, tail-difficult, regulatory near-tie, history-heavy, and held-out, a generator from a different rule family fixed once and never tuned). Each main book has 24 modellable factors, 256 current and 256 stressed scenarios per expected-shortfall block, 60 daily and 12 weekly stored observations, and a default law of 20,500 scenarios on 20 obligors.
The validation is deliberately asymmetric. For removal, origin, hedge choice and the smooth marginal, the engine’s own output defines the benchmark reference, so agreement with it proves nothing and is not counted. The evidence instead comes from checks that do not read the engine’s allocation: reconciliation, a separate chain-rule implementation, finite differences of the forward capital, and tie sets built independently.
7Results: capital on past dates
Past-date capital
14 smooth main books
61%median share of capital on past observation dates; range 21–99%.
Ledger adds up
All 60 books
5.6 × 10⁻¹⁶largest relative gap to the engine’s capital on the tie books; 4.3 × 10⁻¹⁶ on the main books.
Origin ledger vs finite differences
80,640 (date, trade) positions
80,630agree within at relative step ; median per-book maximum error 1.7 × 10⁻¹⁰.
The finite-difference check differentiates the forward capital without reading the engine’s allocation, so it tests the reverse pass through stored history directly. It was run after the benchmark, on the smooth main books rebuilt from their frozen seeds. The 10 positions outside straddle a branch change: one one-sided difference agrees and the other does not, and at step all 10 agree within 1.4 × 10⁻⁹. On the same books a separate chain-rule implementation matches the engine’s marginal to 2.9 × 10⁻¹⁸, and central differences of K match it to 1.9 × 10⁻⁶.
8Results: ties
For the 36 books built on a kink, the reference is the set of marginals that can actually be realised, constructed without reading the engine’s allocation or its tie convention: the benchmark forces the tied branches through the graph and probes 26 generic nearby books per case. Every nearby gradient lies in the reference set, every vertex of the set is observed, and the engine’s flagged representative lies within normalised distance 1.5 × 10⁻¹⁶ of the set. The representative is therefore a valid marginal point; the engine does not yet list the complete set.
Being close is not enough at a tie. Numerical Euler returns a point within 8.0 × 10⁻⁶ of the set but does not report that the marginal is non-unique. Marginal measures return points at median distance 0.20 (maximum 0.65), and Li–Xing, on the 8 kink books where it answers, at median distance 0.19.
9What other methods answer
We implemented six published allocation rules from their source equations, plus a numerical Euler control, and ran them on the same books. Each answers at most 2 of the five questions. Most gaps are structural rather than numerical: single-trade FRTB capitals are often undefined, Li–Xing does not extend through an active stress-ratio floor, and marginal measures cover only part of the graph. Removal and hedge choice are revaluations and the origin ledger is our own construct, so an uncovered column is not a failure of the published method.
The comparison is about the interface, not a ranking of accuracy. Only incremental allocation supplies a full-capital ledger on every main book, and none of the established methods says which question its vector answers. On the smooth main books, marginal measures differ from the exact marginal by up to 0.50 (median 0.083).
10One book, audited
One ordinary main book shows why the type of an answer matters. Its capital is 105.39. The origin ledger puts 75.98 (72.1%) on past dates, so today’s-book sensitivities account for 29.41. Removal effects and candidate actions can still be answered by revaluation, but Shapley values over trades have no answer: 77 of the 96 single-trade capitals they need are unavailable.
11Certified selective repricing specialist
On books whose options belong to a convex single-factor class, a certified approximation can reprice only the tail scenarios it cannot bound and still return the exact engine’s answer. Of 12 option books, 6 are in that class (American options at low volatility and at high nonlinearity); the basket and barrier books are declared not applicable. On all 6, the certified output matches the exact engine’s marginal and origin allocations within 2.2 × 10⁻¹⁶, bit for bit on 1. This is a specialist result: it says nothing about speed, and it covers no removal or hedge-choice question.
12Limitations and what didn’t work
Scope
- Synthetic books. Every book is synthetic, with at most 96 trades on 24 factors, so nothing is shown about bank-size portfolios. The non-modellable and default charges come from declared synthetic models, standardised-approach capital is a homogeneous stand-in with exact Euler allocations rather than the regulatory formula, and the multiplier on the averaged internal-models charge is fixed at 1.5 (no backtesting add-on).
- Exact, but relative to a choice. The ledger is exact relative to the implemented calculation and its allocation rule, up to double-precision rounding. It is not a regulatorily prescribed attribution. Adding up to K is an accounting property, not a test of faithfulness: the amber surcharge contains a zero-sum term whose omission leaves every total unchanged while changing desk subtotals.
- Groupings. Re-summing into desk, product or risk-class views is proved for declared remaps, but only the identity remap (each past position mapped to its current trade) has been exercised.
What the evidence does not show
- What the past-date share measures. A frozen remainder exists only while an averaged history branch binds, and one binds on all 14 smooth main books. The share therefore describes that regime and the synthetic generator (the history-heavy type was built so that the averaged branches dominate), not a typical bank. No sensitivity analysis over the multiplier or the history process has been run.
- No second implementation of capital. Reconciliation is checked against the engine’s own K. For removal, origin, hedge choice and the smooth marginal, the benchmark reference is the engine itself, so its answers there agree by construction (hatched in Figure 4) and are not wins.
- Ties. At a tie the engine returns one flagged valid representative chosen by a declared convention; it does not enumerate the complete marginal set of the whole graph, and the realisable set is built only on the small tie books, by the benchmark. One returned element does not represent all valid alternatives. Its default-risk and stress-charge nodes can list realisable vertices, but on one audited book it declines some single-trade capitals at its default-risk enumeration limit.
- No speed claim. No authoritative timing was obtained, so nothing is claimed about speed or scaling, for the exact engine or for certified repricing.
- Approximations. The certified repricing certifier has not had the adversarial review the tool contract requires and lacks an explicit pricer-error term. A separate adaptive certified approximation accumulated 4 distinct failure modes across 3 rounds of review by language models and was never run on the benchmark; it is not a result.
- An exploratory agent prototype. 12 fresh runs of one language model (Claude Opus 5.5) answered questions on 9 calibration books, half with the engine and half with conventional bump-and-revalue tools. They passed 94 of 94 items with the engine and 76 of 94 without. The whole gap is the 18 desk-accounting items, which the conventional tools cannot answer uniquely by design, so it is not evidence of a capability gain. The agents proposed and executed no trades, and no deployed agent was evaluated.
- Shapley values are never computed. “No answer” for coalition values rests on the benchmark’s domain convention, under which most single-trade sub-books have no defined capital. A different convention for small sub-books, for example extending capital below its domain, would give values; none has been computed.
Implementation and reproducibility
- Private code. The implementation and result files are held in a private repository and are not released.
- After the benchmark. The finite-difference check of the origin ledger was run after the benchmark, on books rebuilt from the frozen seeds (rebuilt capital within 1.4 × 10⁻¹⁴ of the frozen values). At the larger step , many more entries exceed , because a branch change falls inside the step.
13What comes next
These directions come from the papers’ own priorities for validation; none has been run.
Part 3 · Technical details
14The capital formula
Expected shortfall at of the loss vector , with scenario weights and caps , in its primal and dual forms:
Blocks for risk class , factor set and liquidity horizon aggregate as with . The floored stress ratio and the internal-models charge are
where , and are on the reduced stressed, full current and reduced current factor sets. With stress-charge groups and correlation , the non-modellable charge is with . Default risk is the 99.9% quantile of a finite law of default losses. History enters through
and final capital is
where , and are standardised-approach capitals for in-model, out-of-model and all desks, and is the amber coefficient.
15Node rules and identities
Allocations propagate node by node: over the children of node , with coefficients that depend on node values but not on allocations. The rules are the dual weights at each expected shortfall; at the horizons; at the stress ratio when , when , and a declared tie weight between them at a tie; the active scenario row at the default quantile; and the active branch, or a declared tie weight, at every maximum, minimum and positive part.
- Recursive reconciliation. On a finite directed acyclic graph, if every leaf allocation reconciles and every node rule satisfies the Euler condition , every node allocation reconciles. Under scenario linearity, positive homogeneity of degree one, a valid domain, homogeneous standardised-approach inputs with reconciling allocations, and stored history (assumptions A1–A5 of the papers), , including at ties for any declared tie weights.
- Re-summing. For any declared nonnegative remap with , and any grouping of the same kind, the remapped or grouped ledger still adds up to K.
- Smooth points. Where every maximum, minimum, floor and quantile is strict and every expected-shortfall dual is unique, : the ledger is the gradient (Euler) allocation, and the frozen-remainder identity of section 3 gives today’s block exactly.
- What does not add up. Removal effects need not sum to K; at ties only jointly realisable branch choices are valid marginal points, and independent local choices can add up to K while lying outside the true marginal set.
16Full tables
Main books
| Portfolio type | Seed | Capital K | On past dates | Share of K |
|---|---|---|---|---|
| Ordinary | 94101 | 105.39 | 75.98 | 72.1% |
| Ordinary | 94202 | 127.56 | 72.50 | 56.8% |
| Ordinary | 94303 | 76.42 | 37.44 | 49.0% |
| Nonlinear | 94101 | 95.42 | 46.61 | 48.8% |
| Nonlinear | 94202 | 94.27 | 54.43 | 57.7% |
| Nonlinear | 94303 | 79.59 | 44.56 | 56.0% |
| Tail-difficult | 94101 | 454.17 | 417.20 | 91.9% |
| Tail-difficult | 94202 | 352.53 | 226.73 | 64.3% |
| Tail-difficult | 94303 | 311.01 | 233.69 | 75.1% |
| History-heavy | 94101 | 67.88 | 66.92 | 98.6% |
| History-heavy | 94202 | 84.37 | 80.44 | 95.3% |
| History-heavy | 94303 | 107.54 | 101.10 | 94.0% |
| Held-out | 94101 | 97.29 | 46.20 | 47.5% |
| Held-out | 94202 | 93.62 | 19.69 | 21.0% |
| Held-out | 94303 | 99.76 | at a tie: no reference answer | |
| Regulatory near-tie | 94101 | 66.57 | at a tie: no reference answer | |
| Regulatory near-tie | 94202 | 84.15 | at a tie: no reference answer | |
| Regulatory near-tie | 94303 | 138.16 | at a tie: no reference answer | |
Questions answered, per method
| Method | Marginal | Removal | Accounting | Origin | Hedge choice |
|---|---|---|---|---|---|
| Analytical Euler (gradient) allocation | 14/14 · 6/42 | 0/18 · 0/42 | 0/18 · 0/42 | 0/18 · 0/42 | 0/18 · no answer |
| Numerical Euler (central differences), a control | 14/14 · 42/42 | 0/18 · 0/42 | 0/18 · 0/42 | 0/18 · 0/42 | 0/18 · no answer |
| Balog et al. incremental allocation | 0/14 · 0/42 | 0/18 · 0/42 | 18/18 · 42/42 | 0/18 · 0/42 | 0/18 · no answer |
| Activity-based allocation | 0/14 · 0/42 | 0/18 · 0/42 | 0/18 · 0/42 | 0/18 · 0/42 | 0/18 · no answer |
| Li–Xing Method 1 | 1/14 · 9/42 | 0/18 · 0/42 | 1/18 · 9/42 | 0/18 · 0/42 | 0/18 · no answer |
| Li–Xing Method 2 | 1/14 · 9/42 | 0/18 · 0/42 | 1/18 · 9/42 | 0/18 · 0/42 | 0/18 · no answer |
| Schulze marginal measures | 14/14 · 42/42 | 0/18 · 0/42 | 0/18 · 0/42 | 0/18 · 0/42 | 0/18 · no answer |
| FRTBTrace exact engine | 14/14 · 42/42 | 18/18 · 42/42 | 18/18 · 42/42 | 18/18 · 42/42 | 18/18 · no answer |
Each cell: main books · tie books, books answered over books where the question has an answer. Coalition (Shapley) values have no answer on any book for any method and are left out.
17Reproducibility notes
Benchmark results are read from frozen result files by a script that checks each file’s SHA-256 hash.
- Tie books
- Core results, tier S: SHA-256 prefix 8747184b
- Main books
- Core results, tier M: 717cdf51
- Option books
- Certified selective repricing: 37d6d63e
- Summary scores
- 4474986f
- Finite-difference check
- Summary 074389be, residual diagnosis 084b9c12; 14 books, 60 dates × 96 trades each
- Source revision
- Private repository, commit 61cba9e56a
Summary
18In brief
Design
Requests for a trade-level explanation of capital are sorted into five types before anything is computed. One forward and one reverse pass through the regulatory formula give a ledger indexed by stored date and trade, while what-if and action questions are revalued exactly.
Results
On 60 synthetic books the ledgers balance to the engine’s capital at the level of rounding error, and each established method covers no more than 2 of the five request types. On the typical smooth main book, 61% of the charge traces back to positions held on earlier dates.
Open questions
Whether the same holds on real bank portfolios, against an independent implementation of capital, and with the complete set of marginals at ties; and what it costs in time. Details are under Limitations and what didn’t work.
19Sources
Paper: Exact Trade-Level Attribution of FRTB-IMA Capital, arXiv 2609.32238, 26 September 2026. [arXiv]
Workshop papers, ICAIF 2026 (Milan, 14–15 November 2026), both accepted: Auditable FRTB Capital Explanations: A Tool Contract for Financial AI Agents (Yuhe Sui), Workshop on Responsible AI Operations for Finance; and What Post-hoc Attributions of FRTB-IMA Capital Answer (Yuhe Sui, Yingzhi Tang), Workshop on Interpretability and Alignment in Financial Models. ICAIF 2026 news →
The finite-difference check of the origin ledger and the agent prototype appear in the RAIOps4Fin paper, which is newer than the arXiv version; the agent prototype is exploratory.