FX and Multi-Currency

Portfolio base currency

Each portfolio has a single base currency in which all values, returns, and gains are reported.

All positions denominated in a foreign currency are converted to the base currency using end-of-day exchange rates sourced from the European Central Bank (ECB) via Frankfurter. Conversion is performed by first expressing all rates against EUR, then cross-computing the rate to the portfolio’s base currency.

FX conversions

Exchange rates are updated daily after the ECB publishes the latest exchange rate. All rates are expressed as units of base currency per one unit of foreign currency.


For non-EUR base currency portfolios, the rate is derived by cross-dividing the EUR/foreign and EUR/base rates: rate = EUR_base / EUR_foreign.

Realized and unrealized FX P&L

FX gain or loss is calculated separately from capital gain or loss using FIFO lot matching.

For each matched buy-sell pair, the realized FX gain is: matched_quantity × sell_price × (sell_fx_rate − buy_fx_rate).

For remaining open lots, the unrealized FX gain is: quantity × current_price × (current_fx_rate − buy_fx_rate).

This isolates the portion of P&L attributable purely to exchange rate movements, independent of price changes in the security’s local currency.

FX contribution to return

Currency gains are reported as a standalone component of total return alongside capital gains and dividend gains.

Currency gains ROI is expressed as a percentage of the invested capital base (total cost of open buy positions in base currency), making it directly comparable to capital gains ROI and dividend gains ROI.

FX contribution to risk

Currency exposure is implicitly captured in portfolio volatility and drawdown metrics, as the equity curve is computed in the base currency using daily exchange rates. A depreciation of a foreign currency against the base currency will reduce the NAV of affected positions, contributing to drawdown and increasing daily return variance.

FX risk is not isolated as a separate risk metric at this time.

Cash, Cash Equivalents, and FX

Foreign currency cash balances held in the portfolio (e.g., USD cash in a EUR-based portfolio) are treated as FX positions. Their currency gain is calculated as: amount × (current_fx_rate − weighted_average_cost_fx_rate).

The weighted average cost rate is derived from the journal ledger: for each credit entry to a cash account, the booked base amount and foreign amount are accumulated, and the average rate is computed as total base credited divided by total foreign units credited.

Cash balances denominated in the portfolio’s base currency carry no FX exposure and report zero currency gains.