Repository navigation
token-quote-coverage: quote one USDC on BNB Chain, not 1e-12 USDC - #3308
Merged
Flotapponnier merged 2 commits intoOct 27, 2026
Merged
Conversation
USDC on BNB Chain (0x8AC76a51...580d) has 18 decimals. KyberSwap, ParaSwap, Odos and Relay sent a flat 1000000 base units on every chain, which is one USDC on Base and Robinhood Chain but 0.000000000001 USDC on BNB Chain, and ParaSwap was told srcDecimals=6. The amount and ParaSwap's srcDecimals now follow the chain's stablecoin.
ParaSwap answers "Destination Decimals Mismatch" when destDecimals does not match the token, so every 6- or 9-decimal destination counted as a miss. Left out, the API reads the token's own decimals.
Collaborator
|
Thanks a lot for this one, and the timing is good. ParaSwap started validating I pushed one small follow-up commit on top: ParaSwap now also rejects a wrong |
Flotapponnier
added a commit
that referenced
this pull request
Oct 27, 2026
) (#3309) * token-quote-coverage: quote one USDC on BNB Chain, not 1e-12 USDC USDC on BNB Chain (0x8AC76a51...580d) has 18 decimals. KyberSwap, ParaSwap, Odos and Relay sent a flat 1000000 base units on every chain, which is one USDC on Base and Robinhood Chain but 0.000000000001 USDC on BNB Chain, and ParaSwap was told srcDecimals=6. The amount and ParaSwap's srcDecimals now follow the chain's stablecoin. * paraswap: stop sending destDecimals=18 ParaSwap answers "Destination Decimals Mismatch" when destDecimals does not match the token, so every 6- or 9-decimal destination counted as a miss. Left out, the API reads the token's own decimals. --------- Co-authored-by: Hey Research Lab <hi@heyresearch.xyz> Co-authored-by: HEY Research Lab <327801004+hey-research-lab@users.noreply.github.com>
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.
What was wrong
harnesses/token-quote-coverageprobes every token with "1 USDC -> token" (README, step 3). On BNB Chain the input is USDC at0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d, whosedecimals()is 18 (read on chain). Four adapters send a flat1000000base units on every chain:cmd/monitor/kyberswap.go:53amountIn=1000000cmd/monitor/paraswap.go:52amount=1000000, and:54srcDecimals=6cmd/monitor/odos.go:64"amount": "1000000"cmd/monitor/relay.go:62"amount": "1000000"That is 1 USDC on Base and Robinhood Chain (6 decimals) but 0.000000000001 USDC on BNB Chain, so the BNB cells measure whether a provider can route dust, not 1 USDC.
ParaSwap shows it directly. Live
/priceson network 56, USDC to CAKE (0x0E09...cE82) and to a thin four.meme token (0xC3A9...5c68):amount=1000000&srcDecimals=6ESTIMATED_LOSS_GREATER_THAN_MAX_IMPACTNo routes found with enough liquidityamount=1000000000000000000&srcDecimals=18The adapter counts any non-200 as a miss, so ParaSwap's BNB coverage is understated even for CAKE. KyberSwap and Relay still answered the dust amount in the same check, so their cells are not obviously wrong today, but they are not quoting what the bench says.
How it was verified
cmd/monitor/quote_amount_test.go. It points each adapter at a recordinghttp.RoundTripper(no network) and checks the amount sent for base, robinhood and bsc, plus ParaSwap'ssrcDecimals. Before the fix it fails on bsc for all four adapters (quoted "1000000" base units of the stable, want "1000000000000000000") and onsrcDecimals="6", want "18". After the fix it passes.go vet ./...andgo test ./...inharnesses/token-quote-coveragepass. The changed files are gofmt clean.pnpm validate/typecheck/buildwere not run.What changed
helpers.go:stableDecimals(chain)(18 on bsc, 6 elsewhere) andoneStableUnit(chain).oneStableUnit(token.Chain). Base, Robinhood Chain and Solana still send1000000.srcDecimalsfromstableDecimals.1) and Jupiter (Solana only) are unchanged.Type