Financial Risk Management

Where capital
meets consequence.

Quantitative risk frameworks built on institutional methodology — VaR, stress testing, scenario analysis, liquidation mapping. Python-powered. CFA-candidate rigour.

Monte Carlo VaR Liquidation Maps Stress Testing Order Book Analysis Macro Gauges
10K
Sim Paths
99%
VaR CI
8+
Scenarios
4
Asset Classes

Seeing where the
market is fragile.

Liquidation heatmaps reveal the price levels where leveraged positions are most concentrated — and therefore most vulnerable. By mapping open interest and estimated stop-loss clusters, we identify where cascading liquidations could occur and how to position around them.

BTC/USD Liquidation Heatmap
Open interest concentration · 7-day rolling · Exchange aggregate
Live Model
← 7 days ago · Current price: $97,420 · 7 days ahead →
Short Liquidations Medium Density Long Liquidations
Key observation: High short liquidation density at $99,800–$99,000 and long liquidation clusters at $94,200–$95,200 create a magnetic price range. Breakouts through either zone could trigger cascading moves of 2–4%.
Order Book Depth · BTC/USD
Level II data · Real-time DOM · Binance aggregate
DOM Live
PriceSize (BTC)Total
SPREAD: 12.40 $97,420.00 BID–ASK: 0.013%
Bid Side (Buy)Ask Side (Sell)
Bid Volume
$248.4M
Imbalance
+62% Bid
Ask Volume
$151.2M
Large Iceberg Orders
Hidden liquidity that replenishes — indicates institutional accumulation or distribution zones.
Spoofing Patterns
Large orders placed and rapidly cancelled — creates false impressions of support or resistance.
Thin Liquidity Zones
Price gaps where a breakout could travel fast — high-velocity move potential.

Institutional-grade tools.
Built from scratch.

Every model is built in Python, validated with real market data and designed around the same methodologies applied at hedge funds, prime brokers and risk departments at major financial institutions — from Black-Scholes to Geometric Brownian Motion, CAPM to Efficient Frontier optimisation.

Portfolio Construction & Efficient Frontier
Modern Portfolio Theory · PyPortfolioOpt · cvxpy · Sharpe Maximisation
MPT · Optimisation
portfolio_optimiser.py — PyPortfolioOpt + cvxpy
efficient_frontier.py
from pypfopt import EfficientFrontier
from pypfopt import risk_models, expected_returns

# Compute mu & covariance matrix
mu = expected_returns.mean_historical_return(prices)
S = risk_models.CovarianceShrinkage(prices).ledoit_wolf()

# Build frontier & maximise Sharpe
ef = EfficientFrontier(mu, S)
ef.add_constraint(lambda w: w >= 0.02)
ef.add_constraint(lambda w: w <= 0.40)
weights = ef.max_sharpe(risk_free_rate=0.05)
cleaned = ef.clean_weights()

# Performance metrics
ret, vol, sharpe = ef.portfolio_performance(verbose=True)
Efficient Frontier — Risk vs Return
Return % Max Sharpe Min Vol Risk (σ)
Max Sharpe
Portfolio
Min Vol
Portfolio
CML
Capital Line
Optimised Weights — Terminal Output
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▶ PORTFOLIO OPTIMISER v1.3
━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Assets: 7 · Method: Max Sharpe
Matrix: Ledoit-Wolf

Optimal Weights
BTC     28.4%
SPY     22.1%
GLD     18.6%
QQQ     14.2%
ETH     10.3%
TLT     4.2%
CASH    2.2%

Performance
Return: +24.8%
Vol:    14.2%
Sharpe: 1.62
Monte Carlo · Geometric Brownian Motion
Price path simulation · VaR · CVaR at 99%
Simulation
# GBM: dS = μS dt + σS dW
def gbm_paths(S0, mu, sigma, T, dt, n):
  steps = int(T/dt)
  Z = np.random.standard_normal((n, steps))
  drift = (mu - 0.5*sigma**2)*dt
  shock = sigma * np.sqrt(dt) * Z
  paths = S0 * np.cumprod(np.exp(drift+shock), axis=1)
  return paths

# 10,000 paths · compute VaR/CVaR
paths = gbm_paths(S0=97420, mu=0.25, sigma=0.72, T=30, dt=1, n=10_000)
VaR_99 = np.percentile(paths[:,-1], 1)
CVaR_99 = paths[:,-1][paths[:,-1]<=VaR_99].mean()
10,000 simulated price paths · 30 days · BTC/USD
VaR Day 0 Day 30
10K
Paths
GBM
Model
99% CI
Confidence
CAPM · Beta & Expected Return
Capital Asset Pricing Model · Security Market Line
CAPM
# E(r) = Rf + β(E(Rm) - Rf)
import statsmodels.api as sm

def capm_beta(asset_returns, market_returns):
  X = sm.add_constant(market_returns)
  model = sm.OLS(asset_returns, X).fit()
  return model.params[1]

# Risk-free rate · beta · market premium
Rf = 0.05; Rm = 0.12
beta_btc = capm_beta(btc_ret, spy_ret)
expected_r = Rf + beta_btc * (Rm - Rf)
# β = 1.82 → E(r) = 5% + 1.82(7%) = 17.7%

# Security Market Line plot
sml_x = np.linspace(0, 3, 100)
sml_y = Rf + sml_x * (Rm - Rf)
plt.plot(sml_x, sml_y, color='#c8f135')
Security Market Line — Beta vs Expected Return
Rf=5% BTC β=1.82 ETH β=1.45 SPY β=1.0 β=0 β=3 E(r)
1.82
BTC Beta
17.7%
Expected r
OLS
Regression
Stress Testing Engine
Historical & Hypothetical Shock Scenarios
Scenarios
SCENARIOS = {
  "GFC_2008":{"equity":-0.52, "credit":+0.45, "fx":-0.18},
  "COVID_2020":{"equity":-0.34, "vix":+3.0, "oil":-0.67},
  "FED_TAPER":{"rates":+2.0, "dur":-0.16},
  "CRYPTO_CRASH":{"btc":-0.70, "eth":-0.75},
}
Portfolio P&L under each scenario ($4.2M AUM)
GFC 2008−$682K
COVID 2020−$441K
Fed Taper−$198K
Crypto Crash−$890K
8+
Scenarios
Hist+Hyp
Both Types
Composite Risk Rating
Multi-Factor Scoring · AAA→D Grade Output
Rating
WEIGHTS = {
  "market_vol": 0.30, "credit_risk": 0.25,
  "liquidity": 0.20, "concentration": 0.15,
  "macro_regime": 0.10
}
def grade(score):
  return ("AAA" if score<2 else
    "A" if score<4 else
    "BB" if score<6 else
    "B" if score<8 else "CCC")
Current Factor Scores — Portfolio MULTI_ASSET_01
Market Volatility6.8/10
Credit Risk3.2/10
Liquidity Risk2.8/10
Concentration5.4/10
Macro Regime7.2/10
Composite Score
5.24 / 10
Risk Grade
BB
Action
Monitor

USD · Gold · BTC · ETH

Macro-level analysis across the four most systemically important assets. Cross-asset correlations, regime detection, and structural trend identification.

USD
US Dollar Index · DXY
104.28
▼ 0.31% today
Fed Tightening
Paused
Real Yields
Declining
Risk Appetite
Risk-on
BTC Correlation
−0.72
Dollar weakness driven by shifting rate expectations and growing risk appetite. The DXY–BTC inverse correlation at −0.72 remains one of the cleaner cross-asset signals for crypto positioning.
GOLD
XAU / USD · Spot
$2,318
▲ 0.82% today
Real Yields
Headwind ↑
Central Bank Demand
Record highs
Geopolitical Risk
Elevated
USD Correlation
−0.61
Gold is defying the traditional real-yield headwind — central bank reserve diversification and geopolitical uncertainty are acting as structural tailwinds. The USD correlation is weakening, suggesting a regime shift in gold's safe-haven behaviour.
BTC
Bitcoin / USD
$97,420
▲ 2.34% today
Post-Halving Cycle
Active
ETF Inflows
Strong
NVT Ratio
Neutral
Estimated Leverage
18.4× avg
Post-halving supply shock combined with ETF demand absorption is compressing available float. Elevated leverage creates acute liquidation risk on both sides. Watch the $94.2K cluster — a wick there would be a buying opportunity, not a trend reversal.
ETH
Ethereum / USD · DeFi Layer
$3,482
▲ 1.18% today
ETH/BTC Ratio
0.0357 — Low
DeFi TVL
$48.2B Rising
Staking Yield
3.8% APY
Gas Utilisation
72% capacity
ETH is underperforming BTC on this cycle — historically a signal of pending rotation. Rising DeFi TVL and strong staking yields provide fundamental support. Watch the 0.038 ETH/BTC level as a key inflection point for altcoin cycle momentum.

Fed signals. Inflation data.
What it all means.

Macro regime determines the risk environment for all asset classes. These gauges synthesise the most critical data points driving market conditions.

Fed Funds Rate
5.25–5.50%
Hawkish-hold · Cuts priced for late 2025
PCE Core YoY
2.8%
Above 2% target · Disinflation trend intact
CPI YoY
3.2%
Stalling above Fed target
10Y Treasury
4.32%
Declining from 5% peak · Duration risk easing
US Unemployment
3.9%
Near historical lows · Labour market tight
VIX — Fear Index
14.8
Below 20 · Low systemic fear · Risk-on regime
Fed Stance
Hawkish-Hold
Next Meeting
Jun 2025
Market Expects
1–2 Cuts
Regime
Risk-On
⚠ Disclaimer: All market data, models, analysis and commentary on this page are for informational and educational purposes only. Nothing here constitutes investment advice, financial advice, or a recommendation to buy or sell any financial instrument. All market prices are indicative. Past performance does not guarantee future results. Always conduct your own independent research and consult a qualified, regulated financial professional before making any investment or trading decisions.