Stress Testing and Scenario Analysis | DeFi Risk Management | XRP Academy - XRP Academy
3 free lessons remaining this month

Free preview access resets monthly

Upgrade for Unlimited
Skip to main content
advanced60 min

Stress Testing and Scenario Analysis

Learning Objectives

Design stress scenarios across historical, hypothetical, and reverse stress testing approaches

Conduct portfolio stress tests using systematic methodology

Interpret stress test results and identify portfolio vulnerabilities

Establish action thresholds that trigger specific responses

Use stress testing for position sizing and portfolio construction decisions

Normal conditions don't test your portfolio. Extreme conditions do.

THE STRESS TESTING IMPERATIVE

In normal markets:
├── Everything seems fine
├── Risks are hidden
├── Correlations appear low
├── Liquidity is abundant
├── Yields are paid
└── Comfort breeds complacency

In stressed markets:
├── Everything breaks simultaneously
├── Correlations spike to 1
├── Liquidity disappears
├── Yields fail
├── Counterparties fail
├── Your portfolio reveals its true risk

The question:
├── BEFORE crisis: "Can my portfolio survive?"
├── DURING crisis: Too late to ask
├── AFTER crisis: Should have asked before
└── Stress testing = asking the question in advance
```


Using past crises to stress current portfolio:

HISTORICAL STRESS TESTING

Approach:
├── Identify past crisis periods
├── Extract market conditions from that period
├── Apply those conditions to current portfolio
├── Measure impact
└── "What if that happened again?"

Advantages:
├── Real conditions, not imagined
├── Credible (actually happened)
├── Includes correlation effects
├── Multiple data points
└── Easy to explain

Limitations:
├── Past may not repeat
├── Current portfolio differs from past
├── New risks not captured
├── May miss worse scenarios
└── Survivorship bias in past data

KEY HISTORICAL SCENARIOS FOR DEFI:

March 2020 COVID Crash:
├── XRP: -50% in days
├── BTC: -40% in 24 hours
├── DeFi TVL: -50%
├── Liquidation cascades
├── Gas prices spiked
└── Exit liquidity evaporated

May 2021 China Crackdown:
├── XRP: -55% over weeks
├── BTC: -55%
├── DeFi TVL: -40%
├── Sustained decline
├── Liquidations ongoing
└── Sentiment collapse

Terra/Luna (May 2022):
├── UST: -100% (de-peg then collapse)
├── LUNA: -100%
├── XRP: -30% (contagion)
├── DeFi TVL: -30%
├── Stablecoin confidence crisis
└── Protocol contagion

FTX Collapse (November 2022):
├── BTC: -25%
├── XRP: -20%
├── Centralized exchange fear
├── DeFi TVL: -20%
├── Counterparty contagion
└── Withdrawal panic

2018-2019 Crypto Winter:
├── BTC: -85% from peak
├── XRP: -95% from peak
├── Extended duration (>1 year)
├── DeFi didn't exist at scale
├── Total capitulation
└── Extreme for long-term test
```

Testing scenarios that haven't happened:

HYPOTHETICAL STRESS TESTING

Approach:
├── Design plausible disaster scenarios
├── Estimate parameter values
├── Apply to portfolio
├── Measure impact
└── "What if THIS happened?"

Advantages:
├── Can test novel scenarios
├── Not limited by history
├── Can be protocol-specific
├── Forward-looking
└── Customizable to your risks

Limitations:
├── Scenario design is subjective
├── Parameter estimates uncertain
├── May miss important scenarios
├── Correlation assumptions matter
└── Requires imagination

HYPOTHETICAL SCENARIO EXAMPLES:

XRP Regulatory Shock:
├── XRP: -70%
├── XRPL DeFi: -80%
├── RLUSD: Stable (Ripple separate)
├── Other crypto: -10% (contagion)
├── Duration: Weeks to months
└── Specific to XRP holders

Major DEX Exploit:
├── Affected DEX: -100%
├── Other DeFi: -15% (contagion fear)
├── Market: -10%
├── Duration: Days
└── Protocol-specific

USDC Black Swan:
├── USDC: -50% de-peg
├── All USDC positions affected
├── Market: -30%
├── Other stables: -5% contagion
├── Duration: Days to weeks
└── Tests stablecoin concentration

XRPL Network Incident:
├── All XRPL protocols affected
├── XRP: -40%
├── XRPL DeFi: Frozen temporarily
├── Duration: Hours to days
├── Recovery uncertain
└── Tests XRPL concentration

Global DeFi Regulatory Crackdown:
├── All DeFi: -50%
├── Permissioned survives
├── Permissionless struggles
├── Duration: Months
├── Restructuring required
└── Tests regulatory assumptions
```

Finding what would break you:

REVERSE STRESS TESTING

Approach:
├── Define unacceptable outcome (e.g., 50% loss)
├── Work backwards: What would cause it?
├── Identify scenarios that lead there
├── Assess probability of those scenarios
└── "What would it take to break me?"

Advantages:
├── Focuses on survival
├── Identifies critical vulnerabilities
├── Doesn't miss deadly scenarios
├── Actionable insights
└── Worst-case thinking

1. Define failure threshold

1. Identify paths to failure

1. Assess probability

1. Mitigate or accept

EXAMPLE:
Failure threshold: 50% portfolio loss

Paths to failure:
├── Path 1: XRP -80% (40% of portfolio in XRP)
│   └── Probability: 10%/year
├── Path 2: Primary protocol exploit (35% position)
│   └── Probability: 5%/year  
├── Path 3: Stablecoin collapse (40% in one issuer)
│   └── Probability: 3%/year
├── Path 4: Multiple smaller losses compound
│   └── Probability: 15%/year
└── Total paths to failure: ~33%/year → TOO HIGH

Action: Reduce concentration to lower failure paths

SYSTEMATIC STRESS TEST DESIGN

Step 1: Select Scenario Type
├── Historical: For credibility
├── Hypothetical: For coverage
├── Reverse: For survival focus
└── Use all three for complete picture

Step 2: Define Parameters

Market parameters:
├── XRP price change: ___%
├── BTC/ETH change: ___%
├── Overall crypto market: ___%
├── Traditional markets: ___%
└── Duration: ___

Protocol parameters:
├── Protocol(s) failing: ___
├── TVL impact: ___%
├── Contagion to others: ___%
└── Recovery time: ___

Counterparty parameters:
├── Counterparty failing: ___
├── Impact on related assets: ___%
├── Contagion: ___%
└── Recovery expectations

Liquidity parameters:
├── Slippage multiplier: ___x
├── Exit time required: ___
├── Liquidity reduction: ___%
└── Available exit paths

Step 3: Document Assumptions
├── What correlations assumed?
├── What recovery assumed?
├── What interventions assumed?
├── What are key uncertainties?
└── Be explicit about limitations
```

STRESS TEST CALCULATION TEMPLATE

SCENARIO: [Name]
PROBABILITY: [X%]

Position-by-Position Impact:

Position Value Market Impact Protocol Impact Counterparty Liquidity Total Loss
Pos 1 $ % % % % $
Pos 2 $ % % % % $
Pos 3 $ % % % % $
...
TOTAL $ $

Calculation Notes:
├── Market impact: Apply market parameter to market-exposed portion
├── Protocol impact: Apply if affected protocol
├── Counterparty impact: Apply if counterparty affected
├── Liquidity impact: Exit slippage × position size
└── Total: Cumulative (careful of double-counting)

PORTFOLIO IMPACT:
├── Total loss: $_______ (%)
├── Remaining value: $
____
├── Recovery required: ___% to regain starting value
└── Time to recover (estimated): ___

SURVIVABILITY ASSESSMENT:
├── Is this loss acceptable? Y/N
├── Can you avoid margin calls/liquidations? Y/N
├── Do you have liquidity for life needs? Y/N
└── Would you panic sell? Y/N
```

INTERPRETING STRESS TEST RESULTS

What to look for:

Loss magnitude:
├── < 20%: Tolerable for most
├── 20-40%: Significant, requires recovery
├── 40-60%: Severe, lifestyle impact
├── > 60%: Critical, potential ruin
└── Calibrate to your situation

Vulnerability identification:
├── Which positions contribute most to loss?
├── Which risk factors are concentrated?
├── What would have protected you?
├── Where is diversification failing?
└── Insights for portfolio construction

Correlation effects:
├── Did diversification help?
├── Did things correlate more than expected?
├── Were exit paths available?
└── Update correlation assumptions

Recovery requirements:
├── 20% loss: Need 25% gain to recover
├── 40% loss: Need 67% gain to recover
├── 50% loss: Need 100% gain to recover
├── 60% loss: Need 150% gain to recover
└── Can you realistically recover?

RESULT CATEGORIES:

✓ Survive with acceptable loss
├── Loss within tolerance
├── No behavioral trigger (panic)
├── Can maintain for recovery
└── No changes needed

⚠ Survive but concerning
├── Loss near tolerance limit
├── Recovery challenging
├── Some changes advisable
└── Review position sizing

✗ Unacceptable loss
├── Loss exceeds tolerance
├── Lifestyle impact
├── Potential panic behavior
└── Must change portfolio


---
ACTION THRESHOLD FRAMEWORK

Pre-define responses to stress test results:

Threshold 1: Portfolio Monitoring Enhancement
├── Trigger: Scenario shows 15-25% loss
├── Response: Increase monitoring frequency
├── Timeline: Immediate
├── Reversible: Yes
└── No position changes required

Threshold 2: Position Review
├── Trigger: Scenario shows 25-35% loss
├── Response: Review largest risk contributors
├── Timeline: Within 1 week
├── Consider: Reducing concentrated positions
└── May require some changes

Threshold 3: Active Rebalancing
├── Trigger: Scenario shows 35-50% loss
├── Response: Rebalance to reduce concentrated risks
├── Timeline: Within 1-2 weeks
├── Target: Reduce scenario loss to <35%
└── Changes required

Threshold 4: Major Restructuring
├── Trigger: Scenario shows >50% loss
├── Response: Significantly restructure portfolio
├── Timeline: Immediately begin, complete within 1 month
├── Target: Reduce scenario loss to <40%
└── Substantial changes required

Threshold 5: Risk Elimination
├── Trigger: Any scenario shows potential total loss
├── Response: Eliminate that risk vector
├── Timeline: Immediately
├── Non-negotiable
└── Survival is paramount
```

SCENARIO-SPECIFIC THRESHOLDS

Market Crash Scenario (XRP -50%):
├── Acceptable loss: Up to 40%
├── Concerning loss: 40-50%
├── Unacceptable loss: >50%
├── Rationale: Market risk is accepted; comes with territory
└── Action: Manage position size, not market exposure

Protocol Exploit Scenario:
├── Acceptable loss: Up to 25%
├── Concerning loss: 25-35%
├── Unacceptable loss: >35%
├── Rationale: Protocol-specific risk is diversifiable
└── Action: Reduce concentration in any single protocol

Stablecoin De-peg Scenario:
├── Acceptable loss: Up to 15%
├── Concerning loss: 15-25%
├── Unacceptable loss: >25%
├── Rationale: Stablecoin failure shouldn't be catastrophic
└── Action: Diversify across issuers

Systemic Contagion Scenario:
├── Acceptable loss: Up to 50%
├── Concerning loss: 50-60%
├── Unacceptable loss: >60%
├── Rationale: Systemic events are partially unavoidable
└── Action: Ensure not worse than market

Reverse Stress (50% loss paths):
├── Acceptable: P < 5% annual probability
├── Concerning: P 5-15%
├── Unacceptable: P > 15%
├── Rationale: High probability of ruin is unacceptable
└── Action: Reduce probability of failure paths
```

ACTION RESPONSE PLAYBOOK

Response: Monitoring Enhancement
├── Check portfolio daily instead of weekly
├── Enable additional alerts
├── Monitor relevant news closely
├── No position changes yet
└── Duration: Until stress reduces

Response: Position Review
├── Calculate position contribution to risk
├── Identify top 3 risk contributors
├── Evaluate alternatives
├── Prepare rebalancing plan
└── Timeline: Complete within 1 week

Response: Reduce Concentrated Position
├── Identify position exceeding limits
├── Calculate target reduction
├── Plan staged exit (not panic)
├── Execute over appropriate period
├── Monitor for market impact
└── Document rationale

Response: Diversify Risk Factor
├── Identify concentrated risk factor
├── Research alternatives
├── Reallocate to reduce concentration
├── May require exiting some positions
├── Re-entering in diversified manner
└── Update portfolio mapping

Response: Emergency Exit
├── Only for true emergency (survival)
├── Accept slippage
├── Exit problematic positions
├── Move to stable/safe assets
├── Document and learn
└── Rarely needed if proactive
```


COMPLETE STRESS TEST EXAMPLE

Portfolio: $100,000
├── Pos A: 35% - XRP/USDC LP on DEX X
├── Pos B: 30% - XRP Lending on Protocol Y
├── Pos C: 20% - XRP/RLUSD LP on DEX Z
├── Pos D: 15% - XRP Spot

═══════════════════════════════════════════
SCENARIO 1: Market Crash (Historical: March 2020)
═══════════════════════════════════════════

Parameters:
├── XRP: -50%
├── Market contagion: Moderate
├── Liquidity: 2x slippage
├── Protocol failures: None
├── Probability: 15%/year

Impact Calculation:

Position A ($35,000):
├── XRP component (-50%): -$8,750
├── USDC stable: $0
├── IL (50% move): -$1,000
├── Exit slippage: -$500
└── Loss: -$10,250 (29%)

Position B ($30,000):
├── XRP collateral (-50%): Liquidation risk
├── If not liquidated: -$15,000
├── If liquidated: -$18,000 (extra penalty)
├── Assume partial liquidation
└── Loss: -$16,500 (55%)

Position C ($20,000):
├── XRP component: -$5,000
├── RLUSD stable: $0
├── IL: -$600
├── Exit slippage: -$300
└── Loss: -$5,900 (30%)

Position D ($15,000):
├── XRP (-50%): -$7,500
└── Loss: -$7,500 (50%)

PORTFOLIO TOTAL:
├── Total loss: -$40,150 (40.2%)
├── Remaining: $59,850
├── Recovery required: 67% to break even
└── Assessment: AT THRESHOLD - Position B too concentrated

═══════════════════════════════════════════
SCENARIO 2: Protocol Y Exploit (Hypothetical)
═══════════════════════════════════════════

Parameters:
├── Protocol Y: -100%
├── Market contagion: -10%
├── Other protocols: Unaffected
├── Probability: 5%/year

Impact:

Position A: -10% contagion = -$3,500
Position B: -100% = -$30,000
Position C: -10% contagion = -$2,000
Position D: -10% contagion = -$1,500

TOTAL: -$37,000 (37%)
Assessment: UNACCEPTABLE for single protocol risk
Action: Reduce Protocol Y concentration to <20%

═══════════════════════════════════════════
SCENARIO 3: USDC De-peg (Hypothetical)
═══════════════════════════════════════════

Parameters:
├── USDC: -25%
├── Market contagion: -15%
├── RLUSD: Stable
├── Probability: 3%/year

Impact:

Position A: -25% on USDC component + market = -$9,500
Position B: -15% market = -$4,500
Position C: -15% market only = -$3,000
Position D: -15% market = -$2,250

TOTAL: -$19,250 (19%)
Assessment: Acceptable for low-probability event

═══════════════════════════════════════════
REVERSE STRESS TEST
═══════════════════════════════════════════

Question: What causes 50% loss?

Path 1: XRP -70% = ~55% portfolio loss (market heavy)
Path 2: Protocol Y + XRP -30% = 50% loss
Path 3: USDC collapse + XRP -50% = 55% loss

Probabilities:
├── XRP -70%: ~8%/year
├── Protocol Y + moderate crash: ~3%/year
├── USDC collapse + crash: ~1%/year
├── Total P(50% loss): ~12%/year
└── CONCERNING - should be <10%

═══════════════════════════════════════════
CONCLUSIONS
═══════════════════════════════════════════

  1. XRP concentration (100% is XRP-correlated)

  2. Protocol Y concentration (30%)

  3. Lending liquidation risk in crash

  4. Reduce Protocol Y to 20% max

  5. Reduce leverage/improve collateral ratio

  6. Consider some non-XRP assets for diversification

  7. Accept remaining market risk as feature of XRP focus

Risk-Adjusted Position Sizing:
├── Protocol Y max: 20% (down from 30%)
├── Any single position max: 25%
├── Maintain XRP focus but within concentration limits
```

STRESS TEST CADENCE

Monthly Quick Stress:
├── Apply 2-3 key scenarios
├── Check position changes affect results
├── 1-hour process
├── Update dashboard
└── Note any threshold breaches

Quarterly Full Stress:
├── Full scenario suite (5-7 scenarios)
├── Update probabilities
├── Add new relevant scenarios
├── Remove obsolete scenarios
├── 3-4 hour process
└── Strategic portfolio review

Annual Deep Stress:
├── Comprehensive scenario review
├── Methodology review
├── Historical performance review
├── Framework refinement
├── Half-day process
└── Strategic planning input

Event-Driven:
├── After major market move
├── After protocol incident
├── After portfolio change
├── After counterparty news
├── Immediate stress test
└── As-needed basis
```


Stress testing identifies vulnerabilities. Systematic testing reveals risks that intuition misses.

Pre-planned responses outperform reactive. Thinking through crises in advance leads to better decisions.

Concentration is a primary risk factor. Stress tests consistently show concentration amplifies losses.

⚠️ Scenario selection. We don't know which scenarios will occur.

⚠️ Parameter accuracy. Exact loss amounts depend on uncertain estimates.

⚠️ Correlation behavior in stress. Correlations tend to spike but by how much?

📌 Passing stress tests = safe. Tests can miss the actual disaster.

📌 Overconfidence from testing. "I stress tested" doesn't guarantee survival.

📌 Ignoring test failures. Running tests but not acting on results.


Assignment: Complete comprehensive stress test of your DeFi portfolio.

Requirements:

  • Select relevant historical events

  • Calculate position-by-position impacts

  • Document total portfolio impact

  • Assess survivability

  • Design protocol-specific scenario

  • Design counterparty scenario

  • Design regulatory/systemic scenario

  • Calculate impacts

  • Assess survivability

  • Define failure threshold

  • Identify all paths to failure

  • Estimate probabilities

  • Calculate aggregate failure probability

  • Compare results to thresholds

  • Identify required actions

  • Create action plan with timeline

  • Key vulnerabilities identified

  • Recommended portfolio changes

  • Revised position limits

Time investment: 3 hours


1. What's the main advantage of reverse stress testing?
A) It's faster B) It focuses on survival by finding what would cause unacceptable loss C) It uses historical data D) It's more optimistic

Correct Answer: B

2. Your stress test shows a scenario with 45% portfolio loss. According to typical thresholds, what action is indicated?
A) No action needed B) Monitoring enhancement C) Active rebalancing required D) Emergency exit

Correct Answer: C (35-50% triggers active rebalancing)

3. Why should stress tests be run regularly, not just once?
A) Portfolio changes affect stress results B) New scenarios emerge C) Probabilities change D) All of the above

Correct Answer: D


End of Lesson 10

Key Takeaways

1

Three stress test types complement each other.

Historical (credible), hypothetical (comprehensive), reverse (survival-focused).

2

Systematic methodology produces consistent results.

Follow the process; don't improvise.

3

Action thresholds turn tests into decisions.

Pre-define responses for different loss levels.

4

Reverse stress testing focuses on survival.

"What would break me?" is the critical question.

5

Regular testing catches emerging risks.

Monthly quick, quarterly full, annual deep. ---