Independent project, 2026

FX Risk Desk

I built a small FX risk desk to see what happens to a hypothetical book when I hedge part of its euro exposure. It shows the cost of the hedge, the size of losses, and how often they cross the forecast threshold.

Role
Solo project. Data pipeline, risk and forecast evaluation, API, and interface.
Stack
Python, XGBoost, FastAPI, React, TypeScript
Links
Live demo, GitHub, npm client

01

The book

The example book holds a EUR receivable and a JPY payable. I used daily ECB reference rates to mark both legs in USD. The demo lets you hedge 0%, 25%, 50%, 75%, or 100% of the EUR leg, with an explicit daily cost. The JPY leg stays open.

There is also a separate USD to NPR payout scenario based on a public Nepal Rastra Bank reference quote.

02

Measuring the hedge

I estimate one-day 99% VaR and expected shortfall from the preceding 250 P&Ls. Each new observation is scored against the threshold available at the time. Kupiec and Christoffersen tests check the frequency and clustering of breaches.

In the saved run, the 50% EUR hedge lowered estimated next-day VaR from $11,856 to $7,655. The fully hedged EUR leg left the JPY exposure open and produced a VaR of $12,262. You can see each policy’s P&L and breach count in the demo.

03

Forecasts and pricing

Forecast

How wide does the interval need to be?

I retrain XGBoost each year on data available before that year’s first forecast outcome. On the 255-observation 2025 holdout, the nominal 80% band covered 82.0% of observed returns. The rolling baseline covered 74.9% with a narrower band and slightly lower loss at the 10th percentile.

Pricing

What changes when spot moves?

The option panel uses Garman–Kohlhagen to price European EUR/USD calls and puts. You can change the strike, expiry, and assumed volatility and see the premium and the P&L from a spot shock.

04

What I checked

The source repo includes tests for quote direction, hedge costs, look-ahead, option parity, and API validation. GitHub Actions installs the packed TypeScript client and tests it against the local API. Install the client with npm install @itsm0rty/fx-risk-desk-client. The browser demo runs from saved calculations and uses option presets generated by the same Python pricer.

The book and hedge costs are hypothetical. Prices are daily reference marks, and the hedge uses a spot-offset model. Historical order-book replay is pending suitable public data.

Try the live demo View the source on GitHub

Next case studyOpen Switch →