fix(tokens): give USDG a hub-chain address - #225
Open
dohaki wants to merge 2 commits into
Open
Conversation
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]>
|
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
USDGis split across two symbols:USDG, holding only its Robinhood (4663) address, andUSDG-MAINNET, holding only its mainnet one. One asset — identical name, decimals andcoingeckoId— 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:
TokenClientbuilds 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 — andgetBalancereturnsbnZerofor it silently rather than raising. The relayer then advertises a 0 balance to the bid solver, which answersinsufficient_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@4663is 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
USDGentry so it has a hub-chain anchor. Ten symbols already share a mainnet address;USDC-BNBis exactly this shape — a chain-specific symbol carrying the shared L1 address alongside its own — so this follows the existing pattern.USDG-MAINNETis left in place: it has consumers outside this repo (integrator-api, relayer-madridPaxosTransitUtils, frontend-v3, dapp). It is now redundant and should be deprecated once they migrate.Verification
All three USDG deployments read on-chain —
symbol,nameanddecimalsagree, so the singledecimals: 6on the merged entry is correct and nol1TokenDecimalssplit is needed:0xe343167631d89B6Ffc58B88d6b7fB0228795491D0x5fc5360D0400a0Fd4f2af552ADD042D716F1d1680xe343167631d89B6Ffc58B88d6b7fB0228795491DInk'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 skips3.1.125, whichmastercarried but was never released (npm latest is3.1.124), so #222 and #224 will publish under3.1.126alongside this change.🤖 Generated with Claude Code