Skip to content

fix(tokens): give USDG a hub-chain address - #225

Open
dohaki wants to merge 2 commits into
masterfrom
fix/usdg-hub-chain-address
Open

fix(tokens): give USDG a hub-chain address#225
dohaki wants to merge 2 commits into
masterfrom
fix/usdg-hub-chain-address

Conversation

@dohaki

@dohaki dohaki commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

USDG is split across two symbols: USDG, holding only its Robinhood (4663) address, and USDG-MAINNET, holding only its mainnet one. One asset — identical name, decimals and coingeckoId — in two entries with no address in common.

That split makes USDG invisible to any consumer that indexes tokens by their L1 address. The relayer is the load-bearing case: TokenClient builds its token set from hub-chain tokens and resolves each per-chain balance down from a mainnet token, so a token with no mainnet entry never enters the set — and getBalance returns bnZero for it silently rather than raising. The relayer then advertises a 0 balance to the bid solver, which answers insufficient_balance, and every order delivering USDG on Robinhood no-bids regardless of actual inventory.

Measured on staging: a relayer wallet holding 103.79 USDG on 4663 no-bid three consecutive rounds on a 0.10 USDG fill. WETH@4663 is unaffected — it has a mainnet address — which isolates this to the USDG entry rather than to Robinhood support.

This adds the mainnet address to the USDG entry so it has a hub-chain anchor. Ten symbols already share a mainnet address; USDC-BNB is exactly this shape — a chain-specific symbol carrying the shared L1 address alongside its own — so this follows the existing pattern.

USDG-MAINNET is left in place: it has consumers outside this repo (integrator-api, relayer-madrid PaxosTransitUtils, frontend-v3, dapp). It is now redundant and should be deprecated once they migrate.

Verification

All three USDG deployments read on-chain — symbol, name and decimals agree, so the single decimals: 6 on the merged entry is correct and no l1TokenDecimals split is needed:

chain address symbol name decimals
1 (mainnet) 0xe343167631d89B6Ffc58B88d6b7fB0228795491D USDG Global Dollar 6
4663 (Robinhood) 0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168 USDG Global Dollar 6
57073 (Ink) 0xe343167631d89B6Ffc58B88d6b7fB0228795491D USDG Global Dollar 6

Ink's address is included above for completeness but not added here — no failing lane in evidence for it. Worth a follow-up, since its absence reproduces the same class of bug on Ink USDG lanes.

Bumped to 3.1.126. Note this skips 3.1.125, which master carried but was never released (npm latest is 3.1.124), so #222 and #224 will publish under 3.1.126 alongside this change.

🤖 Generated with Claude Code

USDG was split across two symbols: `USDG`, holding only its Robinhood (4663)
address, and `USDG-MAINNET`, holding only its mainnet one. One asset, identical
name and decimals, same coingeckoId, two entries with no address in common.

That split makes USDG invisible to every consumer that indexes tokens by their
L1 address. The relayer is the load-bearing case: `TokenClient` builds its token
set from hub-chain tokens and resolves each per-chain balance down from a
mainnet token, so a token with no mainnet entry never enters the set at all —
and `getBalance` returns `bnZero` for it silently rather than raising. The
relayer then advertises a 0 balance to the bid solver, which answers
`insufficient_balance`, and every order delivering USDG on Robinhood no-bids no
matter how much USDG the relayer actually holds. Measured on staging: a wallet
holding 103.79 USDG on 4663 no-bid three consecutive rounds on a 0.10 USDG fill.

Add the mainnet address to the `USDG` entry so it has a hub-chain anchor.
Several symbols already share one mainnet address (USDC/USDC.e/USDbC/USDzC/
USDC-BNB all share USDC's, and USDC-BNB is exactly this shape: a chain-specific
symbol carrying the shared L1 address), so this follows the existing pattern
rather than introducing a new one.

`USDG-MAINNET` is left in place — it has consumers outside this repo — but it is
now redundant and should be deprecated once they migrate.

Both addresses verified on-chain: 4663 `0x5fc5360D..d168` and mainnet
`0xe3431676..491D` each answer symbol `USDG`, name `Global Dollar`, decimals 6.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Co-Authored-By: Claude Opus 5 (1M context) <[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