[Feature] Generalize portfolio currencies beyond USD / HKD / CNY
Problem or Motivation
Portfolio currently hardcodes supported valuation currencies to USD, HKD and CNY.
This is already becoming a limitation for international integrations such as INR and KRW, and would also affect common currencies such as EUR, GBP, JPY, BRL and ARS.
Instead of adding currencies one by one, it would be useful to decouple:
valid portfolio currency available FX conversion path
A portfolio denominated in a valid ISO currency should not be rejected just because that currency is not in a three-item allowlist.
If an actual FX conversion is required and no FX rate/provider exists, Vibe can keep the current fail-closed behavior.
The main hardcoded points appear to be:
agent/src/portfolio/compatibility.py
SUPPORTED_VALUE_CURRENCIES = frozenset({"USD", "HKD", "CNY"})
agent/src/portfolio/normalization.py
if currency == "HKD": fx_to_usd = Decimal("1") / usd_hkd elif currency == "CNY": fx_to_usd = Decimal("1") / usd_cny
and the Portfolio display currency validation currently only allows USD/CNY in portfolio/config.py, portfolio_routes.py, and the Web Portfolio editor.
A small generic currency/FX abstraction here could solve multiple current and future international currency limitations at once while preserving the existing safety checks.
Vibe-Trading already supports 8 UI locales: English, Chinese, Japanese, Korean, Arabic, Spanish, German and Brazilian Portuguese. As the project becomes more international, generic portfolio currency handling would better match that direction.
Useful examples include USD, EUR, GBP, CNY, HKD, JPY, KRW, INR, BRL, ARS, MXN, CHF, CAD, AUD, AED and SAR.
This request is not asking for Argentine market support or special ARS handling. ARS is only one example of a broader portfolio-currency limitation.
Proposed Solution
Allow normalized ISO-4217 currency codes for portfolio/account/position currency fields.
Keep FX support separate:
same-currency portfolio: no FX conversion required mixed-currency portfolio: require an explicit FX conversion path missing FX rate: keep the current explicit error
Examples:
ARS portfolio + ARS positions → valid
EUR portfolio + EUR positions → valid
KRW portfolio + KRW positions → valid
EUR position + USD portfolio → requires EUR/USD FX
ARS position + USD portfolio → requires ARS/USD FX
This avoids adding special cases for INR, KRW, EUR, ARS, etc. one at a time.
Area
Other
Alternatives Considered
Adding individual currencies to SUPPORTED_VALUE_CURRENCIES would work temporarily, but the same limitation would return whenever a new market or broker uses another currency.
A generic ISO currency identity plus explicit FX capability seems more maintainable.
Contribution
- I'm willing to submit a PR for this feature
Source: HKUDS/Vibe-Trading