Browse lessons
On this page

Learn · Lesson

Counterparty Risk Optimization: Collateral, Risk Measures, and Margin Networks

Two portfolios can have the same aggregate market exposure but very different collateral requirements. The difference comes from where trades sit: across counterparties, enforceable netting sets, clearing houses, and collateral agreements. Counterparty risk optimization seeks a more efficient arrangement while respecting risk, legal, funding, and execution constraints.

The key question is which economic exposures must remain unchanged, and which obligations can safely be rearranged? Lower initial margin is a useful objective, but it is not identical to lower default loss, lower funding risk, or lower systemic risk.

These notes expand the supplied lecture outline. Its numbered source fragments lack a bibliography and are omitted. The worked examples are hypothetical and use explicitly simplified margin models, not a production SIMM implementation. Review Linear Rates for derivative cash flows and Linear Algebra for constrained systems.

Learning goals

  • Separate market risk, reference credit risk, and counterparty exposure.
  • Explain payment netting, close-out netting, clearing, VM, and IM.
  • Define coherent loss measures and show why VaR can fail subadditivity.
  • Formulate a constrained network optimization with consistent signs and accounting.
  • Solve a triangle example and identify where its simplifications stop working.
  • Understand numerical conditioning, trade lots, fairness, and validation.

1. A taxonomy of OTC derivative risks

RiskQuestionExample
MarketHow does value change when market inputs move?A swap loses value after a curve shift
Reference creditDoes the referenced borrower perform?A CDS pays following a specified reference-entity credit event
Counterparty creditWill the party owing us a derivative payment perform?A swap dealer defaults while our net replacement value is positive
Market liquidityCan positions be closed near modeled prices?A large unwind moves the market
Funding liquidityCan cash and collateral calls be met on time?A solvent firm cannot source eligible margin collateral quickly enough
Operational and legalWill processing, documentation, and enforceability work?A disputed valuation, settlement failure, or unenforceable netting arrangement

Counterparty risk is a form of credit risk, but the exposure is often uncertain and can switch sign as market values move. Reference-entity risk and protection-seller risk are different: buying a CDS does not eliminate the possibility that the seller cannot pay.

If V is a netting set’s value to us and C is usable collateral held, a simplified current unsecured exposure is max(V−C,0). This ignores important details such as haircuts, segregation, disputes, and close-out mechanics.

If V=5 million and usable collateral is 4 million, current unsecured exposure is 1 million. At an assumed 40% recovery, default at that instant would imply a simplified loss of 0.6 million. Future exposure can differ after market moves during liquidation. Expected exposure, potential future exposure, CVA, and IM answer different questions.

Wrong-way risk arises when exposure tends to rise as the counterparty becomes less creditworthy. A static collateral saving can therefore coexist with a worse joint exposure/default profile.

2. Netting and clearing: the boundary matters

Payment netting versus close-out netting

Payment netting combines eligible scheduled obligations, often by date and currency. Close-out netting determines a single net obligation following termination after a default or other contractual event. These are related but distinct legal mechanisms.

Suppose two eligible positions with the same counterparty have values +12 million and −9 million to us. Without enforceable close-out netting, positive exposure can be 12 million while our negative obligation is treated separately. Within an enforceable netting set, the simplified net exposure before collateral is max(12−9,0)=3 million.

Two trades with the same banking group do not automatically belong to one netting set. Legal entity, agreement, product coverage, currency provisions, insolvency law, and collateral terms matter. Offsets across different counterparties cannot simply be assumed because aggregate market risk nets to zero.

Central counterparties

A CCP can interpose itself through novation or another legally specified mechanism, becoming the buyer to a seller and seller to a buyer. This enables multilateral netting within the relevant clearing framework and centralizes default management.

Clearing changes and manages risk rather than eliminating it. Members and clients still face margin liquidity needs, clearing-member exposures, default-management arrangements, and possible loss-allocation obligations. Moving a trade into clearing can also remove an offset from a bilateral netting set, so its total margin impact must be recalculated across both locations.

Clearing mandates apply to specified products and participants under a jurisdiction’s rules, with exceptions and exemptions. “Every vanilla swap must clear, every exotic must remain bilateral” is too broad. The CFTC’s clearing-requirement overview describes covered classes of swaps; clearing eligibility, mandatory clearing, and actual clearing are separate concepts.

3. Variation margin and initial margin

Variation margin (VM) addresses current mark-to-market exposure. If a trade moves in our favor, the counterparty generally posts collateral or makes a settlement payment under the applicable agreement. Daily exchange is common; cleared arrangements can include intraday calls. Thresholds, minimum transfer amounts, disputes, and collateral rules affect actual exposures.

Initial margin (IM) addresses potential changes in exposure during the period needed to close out, liquidate, or hedge after a default. The margin period of risk (MPOR) reflects that vulnerable interval. IM is collateral, not an insurance policy guaranteeing full loss coverage.

The BCBS–IOSCO framework uses a stressed, one-tailed 99% confidence baseline over a ten-day horizon for non-cleared IM when VM is exchanged daily. This is a specific framework assumption, not a universal MPOR for every product, CCP, or liquidation situation. Actual requirements depend on applicable rules and model arrangements.

Why segregated IM creates a funding cost

For in-scope non-cleared arrangements, parties generally exchange IM on a gross two-way basis with segregation requirements. Receiving segregated IM is not the same as receiving freely reusable cash to finance one’s own posting. Regulatory thresholds and collateral eligibility also affect the amount and cost actually posted.

If 20 million of IM is tied up at an assumed annual incremental funding cost of 1%, the simple annual cost is 200,000, ignoring remuneration, haircuts, liquidity buffers, and future changes. Saving 5 million of IM would save 50,000 per year at that assumed spread. The IM principal itself is not a fee or an immediate profit. See ISDA’s collateral operational practices for practical distinctions.

4. Coherent risk measures: fix the sign convention first

Let L be a loss, so larger values are worse, and let ρ(L) be the required risk capital or loss measure. On a suitable domain, coherence requires:

  1. Monotonicity: L₁≤L₂ almost surely implies ρ(L₁)≤ρ(L₂).
  2. Translation invariance: ρ(L+c)=ρ(L)+c for deterministic c.
  3. Positive homogeneity: ρ(aL)=aρ(L) for a≥0.
  4. Subadditivity: ρ(L₁+L₂)≤ρ(L₁)+ρ(L₂).

With a profit rather than loss convention, the signs change. Subadditivity says aggregation should not require more measured risk than the sum of separately measured risks. It does not say every combined portfolio is less risky than each component individually.

Convexity and its qualification

Convexity means ρ(θL₁+(1−θ)L₂)≤θρ(L₁)+(1−θ)ρ(L₂) for 0≤θ≤1. Subadditivity plus positive homogeneity implies convexity. Conversely, convexity plus positive homogeneity gives subadditivity by applying convexity at θ=1/2 and scaling by two.

Without positive homogeneity, the two properties are not generally equivalent. Convexity of a risk functional also does not automatically make a full trade optimization convex: its mapping from trades to losses and its feasible constraints must be compatible.

5. VaR versus expected shortfall

Define the loss quantile VaR_α(L)=inf{l:P(L≤l)≥α}. At 99%, it is a threshold exceeded with at most 1% probability under this quantile convention. It is not the maximum possible loss or the average loss beyond the threshold.

A simple failure of VaR diversification

Let independent losses L₁ and L₂ each be 100 with probability 0.006 and zero otherwise. Each has VaR₉₉%=0, since its zero-loss probability is 0.994. For the sum:

  • Probability of zero loss is 0.994²=0.988036.
  • Probability of one loss is 2×0.006×0.994=0.011928.
  • Probability of two losses is 0.006²=0.000036.

The sum’s 99% VaR is 100, so VaR(L₁+L₂)>VaR(L₁)+VaR(L₂). VaR is not subadditive in general, though it can behave subadditively for particular distribution classes.

Expected shortfall handles tail mass carefully

For an integrable loss, define:

ES_α(L)=[1/(1−α)]∫ from α to 1 VaR_u(L) du.

This averages the worst 1−α fraction of the loss distribution, including the appropriate fraction of a probability atom at the threshold. For a continuous distribution without threshold-mass complications, it agrees with the familiar conditional tail expectation. For discrete losses, E[L | L>VaR_α] can be different.

In the example, each individual 99% ES is 60: the worst 1% consists of 0.6% probability at loss 100 and 0.4% at zero. The sum’s ES is 100.36, from [200×0.000036+100×0.009964]/0.01. It is below the sum of individual ES values, 120.

Why ES is convenient for optimization

For scenario losses ℓ_s(w) with probabilities π_s summing to one:

ES_α(w)=min_η{η+[1/(1−α)]Σ_sπ_s max(ℓ_s(w)−η,0)}.

Introduce auxiliary variables u_s≥ℓ_s(w)−η and u_s≥0. If scenario losses are affine in decisions w and the other constraints are linear, minimizing η+[1/(1−α)]Σ_sπ_su_s is a linear program. Nonlinear payoffs, decision-dependent scenarios, or integer trade lots can change that problem class. The formulation is associated with Rockafellar and Uryasev’s work on CVaR.

6. What SIMM contributes—and what it does not imply

The ISDA Standard Initial Margin Model is a widely used sensitivity-based methodology for regulatory IM on non-cleared derivatives. Its risk classes include interest rates, FX, equities, commodities, and qualifying/non-qualifying credit. The framework includes delta, vega, curvature, and additional basis or concentration treatments as specified by the applicable methodology.

SIMM is not simply ES applied to one arbitrary scenario list. Actual aggregation uses risk weights, correlations, buckets, concentration rules, and other specified calculations. CCPs use their own approved margin models rather than universally applying SIMM.

A quadratic expression sqrt(sᵀCs) is convex in sensitivities s if C is positive semidefinite. This is a useful simplified margin building block. It does not prove that every full SIMM or CCP implementation, composed with arbitrary trades and constraints, is globally convex. Verify the actual model and any approximation used.

Version, calibration, and effective date matter. This lesson does not hard-code a supposedly permanent SIMM parameter set; ISDA’s publication archive documents updates. Any production optimizer must revalue its output with the applicable authoritative margin implementation and permitted use arrangements.

7. Formulating multilateral margin optimization

Let x_h,p,q be the new signed trade amount in hedge instrument h from party p’s perspective against q. Let s⁰_p,q be existing netting-set sensitivities and K_h,p,q the sensitivity vector per unit of the trade. Then:

s_p,q(x)=s⁰_p,q+Σ_hK_h,p,q x_h,p,q.

Distinguish a new trade x from a final position x⁰+x. Mixing those definitions can accidentally optimize the wrong quantity.

Define the accounting objective

One possible objective is:

min_x Σ_pΣ_q≠p IM_posted,p→q(x)+Σ_pΣ_c IM_posted,p→c(x)+execution_cost(x).

The bilateral sum here is deliberately over directed postings: p’s posted segregated IM and q’s posted IM are distinct pools of collateral, even when equal. If instead a model uses one charge per unordered relationship, sum over p<q and define whether it represents one side or both. Do not count the same collateral again as both posted and received in a total-posted objective. Likewise, do not count both member-to-CCP and client-to-member collateral without defining the reporting boundary.

Minimizing funding cost rather than total collateral might weight each posting by its expected funding cost. Thresholds, existing collateral, eligible assets, haircuts, and fees can change both the objective and its smoothness. A total-network saving can still leave one participant worse off.

Constraint 1: two parties must agree on the trade

For the same economically defined instrument and contract terms:

x_h,p,q=−x_h,q,p.

This is consistency between opposite perspectives, not an assumption that every party has a symmetric risk or funding model. Eligibility, credit lines, and clearing access can rule out particular edges.

Constraint 2: preserve the chosen market-risk representation

If every edge uses an identical hedge instrument, exact per-party instrument flatness can be written Σ_qx_h,p,q=0. With CCP positions, include those exposures with consistent signs. This strong condition preserves net instrument amounts, but does not generally preserve which counterparty owes each cash flow.

A more flexible formulation preserves selected sensitivities:

Σ_qΣ_hD_h,p,q,m x_h,p,q=0 for each party p and risk factor m.

This is risk-flat only in the selected representation. Delta neutrality does not guarantee vega, convexity, basis, cash-flow, credit, or stress neutrality. Exact matching of all contractual market cash flows is stronger than matching a finite vector of Greeks. Neither notion is the same as a risk-neutral probability measure Q.

Constraint 3: tolerate only permitted bilateral changes

For each legal netting set and monitored factor m:

−T⁻_p,q,m≤Σ_hD_h,p,q,m x_h,p,q≤T⁺_p,q,m.

Specify whether the bound applies to the change, as written, or the final risk after adding the existing position. Additional constraints can limit counterparty exposure, settlement cash, IM increases per party, gross notional, concentration, and funding needs. Market-risk conservation alone does not establish that CVA or default losses are unchanged.

8. A three-party triangle solved by a median

Use one identical instrument and three directed edges AB, BC, CA. A positive amount is long to the first named party and short to the second. Existing signed positions are:

z_AB=10; z_BC=7; z_CA=4.

The unit can be a standardized exposure unit. In this toy model only, take the total relationship margin proxy as |z_AB|+|z_BC|+|z_CA|. It starts at 21 units; it is not SIMM or an actual collateral quotation.

Add the same circulation −t on each edge:

z′_AB=10−t; z′_BC=7−t; z′_CA=4−t.

Each party’s net position remains unchanged because it has one incoming and one outgoing edge:

PartyBeforeAfter, for any t
A10−4=6(10−t)−(4−t)=6
B7−10=−3(7−t)−(10−t)=−3
C4−7=−3(4−t)−(7−t)=−3

The objective becomes f(t)=|10−t|+|7−t|+|4−t|. A median minimizes a sum of absolute deviations, so t=7 is optimal. The final edges are [3,0,−3], and the objective falls to 6: a reduction of 15/21≈71.43%.

This also matches the unconstrained minimum gross edge exposure for this network: A needs net +6, and B and C each need −3. At least six absolute edge units are required to transfer that net exposure, and the solution attains it.

What the example does and does not establish

The executed adjustment is seven units on each of three edges: 21 units of new trade volume, despite reducing final gross exposure by 15. Fees or package costs can alter whether the exercise is worthwhile. Setting t=4 would also preserve each party’s risk but leave gross exposure 9, so feasible is not synonymous with optimal.

With unequal margin weights, the unconstrained optimum becomes a weighted median; with a bound such as 0≤t≤5, the constrained optimum is t=5, giving final edges [5,2,−1] and total absolute exposure 8. Multiple risk factors, nonlinear margin aggregation, and restricted edges need not admit this scalar median solution.

The example removes a redundant circulation. It does not prove that every constrained multi-factor network can leave each institution purely long or purely short on every factor, or that all risks disappear. Party A still has its original directional exposure +6.

9. Computation: exploit structure without assuming instant solutions

Party-level conservation equations produce a sparse network-incidence structure. Some blocks are local, but shared bilateral trades couple different parties’ constraints. The whole optimization is not generally block diagonal. Incidence matrices also contain redundant conservation equations: summing net risk over all parties gives zero automatically.

Recognize and remove or appropriately handle redundant rows, scale notionals and sensitivities, and inspect singular values or condition estimates. Nearly parallel risks or mismatched units can make residual tolerances economically significant. The inability to represent 1/3 exactly in binary arithmetic is routine; instability comes from conditioning, scaling, tolerances, and model structure rather than that fact alone.

Regularization can stabilize an approximate solve but also change the objective or relax neutrality. Report the resulting residual risk in business units. Check feasibility against the original, unscaled constraints after solving.

Solvers such as Gurobi can handle linear, quadratic, and mixed-integer formulations supported by their interfaces. Runtime depends on problem size, model class, conditioning, warm starts, and tolerances. “Milliseconds” is a benchmark claim requiring a specified dataset and machine, not a general guarantee for a real margin network.

10. Trade lots, package counts, and fairness

Rounding belongs inside the problem when neutrality is strict

If trade h must be a multiple of lot ℓ_h, impose x_h,p,q=ℓ_h k_h,p,q, with integer k. This changes a continuous model into a mixed-integer formulation; nonlinear margin terms can make it a mixed-integer convex or nonlinear problem rather than a plain MILP.

Independent post-solve changes can break conservation. In the triangle, equal adjustments [−7,−7,−7] preserve risk. Executing [−7,−7,−6] after edge-specific rounding or rejection changes A’s net exposure by −1 and C’s by +1. Reconcile the package as a whole. A fixed lot size is a mechanical execution constraint; it does not imply that every institution always requires 100-million trades.

Fewer trades and lower notional are separate goals

Penalizing Σ|x_h,p,q| discourages gross new notional but does not directly count tickets. A package-count objective can use binary activation variables b with −Mb≤x≤Mb, using tight valid bounds M. Fixed ticket costs then introduce discrete decisions. Lexicographic objectives can prioritize mandatory risk limits first, margin reduction second, and package simplicity afterward.

Fairness needs a stated definition

Let saving_p=IM_before,p−IM_after,p, on a consistent posting boundary. Possible participation rules include a minimum saving for every party, a cap on any party’s IM increase, or maximizing the smallest normalized improvement.

The outline proposes squared distance from ideal savings. If savings depend nonlinearly on margin, squaring that expression does not automatically preserve convexity. One must inspect the composition, choose a justified approximation, or use a suitable solver. Ideal targets and normalization also embed economic choices: equal currency savings, equal percentage savings, and savings relative to funding cost are different fairness rules.

Larger networks create more potential cycles and offsets. In a mathematical model where adding a party leaves every old decision feasible and participation can be zero, the optimal absolute objective cannot worsen relative to that unchanged baseline. Actual percentage savings need not rise monotonically: the baseline, fees, credit limits, and participation requirements can change too. A universal nonlinear percentage-reduction law does not follow from network size alone.

11. From candidate trades to a reviewable package

  1. Establish the legal entities, netting sets, collateral terms, clearing routes, and permissible products.
  2. Reconcile existing trades, sensitivities, collateral, and authoritative margin calculations.
  3. State whether neutrality means identical cash flows, specified sensitivities, or bounded changes in stress scenarios.
  4. Optimize using a documented exact model or surrogate, with funding costs, limits, lots, and participation rules as appropriate.
  5. Reprice and recompute actual margin on the proposed final portfolios. Check second-order risk, counterparty exposures, CVA implications, concentration, and liquidity.
  6. Validate exact trade matching and aggregate residuals after lots and package constraints. Compare gross savings with execution, funding, and operational costs.
  7. Stress a partial execution or participant withdrawal. A risk-flat completed package can leave directional exposure if only some legs execute.
  8. Reconcile executed trades, settlement cash, and actual collateral movements against the plan.

Lower modeled IM is a candidate efficiency gain. The economic result depends on valid netting, accepted trades, execution completeness, and collateral that can actually be released.

12. Practice questions

  1. Two enforceably netted trades have values +8 million and −6 million. What is simplified positive exposure before collateral? What if usable collateral held is 1 million?
  2. Does VM fully protect against price movements while a defaulted counterparty’s book is being closed?
  3. Is 99% VaR a maximum-loss bound? Why can the simple conditional tail average misstate ES for discrete losses?
  4. Which extra property makes subadditivity and convexity equivalent for a risk measure?
  5. In the triangle [10,7,4], what circulation minimizes the absolute-exposure proxy? What is the final objective?
  6. Do zero aggregate delta changes establish unchanged cash flows, CVA, and funding needs?
  7. Why can rounding individual legs destroy an otherwise flat package?
  8. Does adding institutions guarantee a higher percentage margin saving in every real implementation?

Answers

  1. 2 million before collateral, 1 million after the stated collateral, ignoring legal and operational complications.
  2. No. VM addresses current mark-to-market exposure; MPOR gap risk motivates IM, which still does not guarantee full protection.
  3. No. VaR is a quantile. ES must average exactly the worst specified tail fraction, including a fractional threshold atom when necessary.
  4. Positive homogeneity.
  5. Subtract 7 from each directed edge. Final positions are [3,0,−3], with objective 6 rather than 21.
  6. No. Delta flatness preserves only the selected first-order representation.
  7. Risk cancellation depends on consistent linked amounts. Unequal leg adjustments can leave net exposures even when each ticket looks acceptable alone.
  8. No. Feasibility, the changing baseline, costs, and participant constraints determine actual savings.

Further reading

An effective optimization preserves the exposures it promises to preserve, makes its collateral accounting explicit, and survives authoritative repricing and executable trade constraints.

Back to Learn