Skip to content

Fix metal price lookups for weight-suffixed symbols#736

Open
triantos wants to merge 1 commit intoafadil:mainfrom
triantos:metals-fix
Open

Fix metal price lookups for weight-suffixed symbols#736
triantos wants to merge 1 commit intoafadil:mainfrom
triantos:metals-fix

Conversation

@triantos
Copy link
Contributor

Summary

  • Strip weight suffix (e.g. "XAU-500G" → "XAU", "XAU-1KG" → "XAU") from metal symbols
    before passing to price providers
  • Weight conversion is handled separately by metal_weight_oz(), but the suffixed symbol
    was being sent to providers as-is, causing lookup failures

Test plan

  • Verify price lookups work for weight-suffixed metal symbols (XAU-500G, XAU-1KG)
  • Verify standard metal symbols (XAU, XAG) continue working
  • All existing tests pass

Strip the weight suffix from metal instrument symbols before passing
them to price providers. XAU-500G and XAU-1KG were being sent as-is,
causing both Yahoo and Metal Price API lookups to fail with "no
providers available". The weight conversion is already handled
separately by metal_weight_oz().
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