Repository navigation
Should USDH be built-in or explicitly initialized before configuration parsing? #5263
Unanswered
seungpyoson
asked this question in
Q&A
Replies: 1 comment
|
Your option (built-in
On the test side, currencies.rs already has a string table of built-ins ( |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Would you prefer USDH to be a built-in
Currency, or should downstream Rust applications explicitly callget_usdh_currency()before parsing configuration?Our application validates configured collateral currencies before creating adapters. We need an offline configuration explicitly using USDH to validate in a fresh process, without first running market discovery.
At
f81f951776b2868a681364ceebae239fab3eb206:get_usdh_currency()helper defines and registers it on first use. Calling that helper before validation is an available downstream option.get_currency("USDH")creates"USDH", whileget_usdh_currency()creates"Hyperliquid USD". Both reuse an existing entry. This is a source observation, not a new standalone test result.My preference is a small native change:
get_usdh_currency()returnCurrency::USDH().That would keep one definition in NT and remove the application's initialization-order dependency. The tradeoff is expanding the built-in list instead of leaving registration to the application. It would preserve the per-outcome
quoteTokenbehavior from #5244 and existing explicit overwrite semantics.Is that change welcome, or is explicit application initialization the intended contract? I'd like to agree on the approach before preparing a patch.
All reactions