Skip to content

fix(ui): classify EUR/USD-style pairs as forex in the positions tab - #2317

Open
wavebyrd wants to merge 1 commit into
HKUDS:mainfrom
wavebyrd:fix/positions-slash-forex-pairs
Open

wavebyrd wants to merge 1 commit into
HKUDS:mainfrom
wavebyrd:fix/positions-slash-forex-pairs

Conversation

@wavebyrd

Copy link
Copy Markdown
Contributor

Summary

  • classifyAssetClass now returns forex for XXX/YYY pairs such as EUR/USD and XAU/USD, keeping BTC|ETH|BNB|SOL|ADA|DOGE/USD as crypto.

Why

The slash check treats any pair ending in /USD as crypto, so a forex run on EUR/USD or XAU/USD shows its positions under Crypto in the Run Detail positions tab. The backend (_market_hooks.py) has the same two rules in this order.

Changes

  • frontend/src/lib/positions.ts: the two backend rules, ahead of the crypto quote check.
  • positions.test.ts: EUR/USD, XAU/USD and BTC/USD rows in the existing backend-parity table.

Test Plan

  • Existing tests pass (pytest --ignore=agent/tests/e2e_backtest --tb=short -q)
  • New tests added (if applicable)
  • Tested manually (describe below)

The EUR/USD and XAU/USD rows fail before the change; npx vitest run passes (1039 tests).

Checklist

  • No changes to protected areas (src/agent/, src/session/, src/providers/) without prior discussion
  • No hardcoded values (API keys, file paths, magic numbers)
  • Code follows CONTRIBUTING.md guidelines
  • Documentation updated (if user-facing change)

Signed-off-by: wavebyrd <160968744+wavebyrd@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant