Skip to content

feat: add default quote currencies for USDC/USD-quoted connectors#175

Open
fengtality wants to merge 4 commits into
mainfrom
feat/default-quotes-usdc-connectors
Open

feat: add default quote currencies for USDC/USD-quoted connectors#175
fengtality wants to merge 4 commits into
mainfrom
feat/default-quotes-usdc-connectors

Conversation

@fengtality

@fengtality fengtality commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Two fixes for portfolio valuation and rate conversion on fresh / geo-restricted installs.

1. Default quote currencies for USDC/USD-quoted connectors

Token balance valuation in AccountsService falls back to fetching TOKEN-<default_quote> last-traded price from the exchange when the RateOracle has no rate for TOKEN-USDT. The global default quote is USDT, which fails on exchanges that don't list USDT pairs — the price resolves to 0 and the token is hidden from portfolio views.

Example: BP holdings on Backpack showed price: 0.0, value: 0.0 because the fallback requested BP-USDT, which doesn't exist on Backpack (it lists BP-USDC).

Added default_quotes entries, verified against each connector's trading-pair construction in hummingbot:

  • USDC: backpack, backpack_perpetual, cube, derive, derive_perpetual, dexalot, vertex, aevo_perpetual, pacifica_perpetual (pacifica_perpetual_web_utils hardcodes quote = "USDC")
  • USD: dydx_v4_perpetual, decibel_perpetual, architect_perpetual

Intentionally excluded:

  • grvt_perpetual, injective_v2, evedex_perpetual — USDT-quoted in hummingbot (EVEDEX's connector maps its native -USD instruments to -USDT pairs)
  • btc_markets (AUD), ndax (CAD), foxbit (BRL) — the fallback price is consumed as a USD value, so fiat quotes would mis-state portfolio value by the FX rate
  • bybit_perpetualBTC-USD is the inverse contract; linear markets are USDT

2. Default rate oracle source: binance → gate_io

Binance's API returns HTTP 451 from geo-restricted locations (US and others), which silently breaks token valuation and the anonymized-metrics volume conversion on fresh installs — every oracle request fails and tokens are valued at 0. Gate.io is accessible globally and lists the same USDT conversion pairs. Changed the shipped bots/credentials/master_account/conf_client.yml template (the always-present explicit value) plus the fallback defaults in main.py startup and routers/rate_oracle.py; explicit rate_oracle_source settings in conf_client.yml are unaffected.

Test plan

  • Verified on a live deployment: Backpack BP balance now prices via BP-USDC (price: 0.268, value: $260) instead of 0, and appears in portfolio views.
  • Verified gate_io rate source resolves USDC-USDT from a location where Binance returns 451.

🤖 Generated with Claude Code

fengtality and others added 2 commits June 12, 2026 06:58
Balance valuation falls back to fetching TOKEN-<default_quote> from the
exchange when the rate oracle has no rate. The global default is USDT,
which fails on exchanges that don't list USDT pairs, leaving tokens
priced at 0 (e.g. BP on Backpack showed $0 and was hidden from
portfolio views).

Add entries for connectors whose markets quote in USDC (backpack,
backpack_perpetual, cube, derive, derive_perpetual, dexalot, vertex,
aevo_perpetual, pacifica_perpetual) and USD (dydx_v4_perpetual,
decibel_perpetual, architect_perpetual), verified against each
connector's pair construction in hummingbot.

Co-Authored-By: Claude Fable 5 <[email protected]>
Binance's API returns HTTP 451 from geo-restricted locations, which
silently breaks token valuation and anonymized-metrics volume
conversion on fresh installs. Gate.io is accessible globally and lists
the same USDT conversion pairs.

Co-Authored-By: Claude Fable 5 <[email protected]>
fengtality and others added 2 commits June 12, 2026 08:27
The template always ships with an explicit rate_oracle_source, so the
code-level defaults never apply on real installs — the shipped value
must change too.

Co-Authored-By: Claude Fable 5 <[email protected]>
Aligns the API model default with the conf template and startup
fallbacks.

Co-Authored-By: Claude Fable 5 <[email protected]>
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