1sec: price ICP-native assets instead of dropping them#501
Open
tarun-khatri wants to merge 1 commit into
Open
Conversation
The four ICP-native assets are mapped to coingecko ids, and the coins API returns no decimals for a coingecko key. aggregate.ts skips a token when neither a decimals override nor an API decimals value is available, so all four were contributing $0 on ethereum, arbitrum and base. All four report decimals() = 8 on-chain on every one of those chains. The openchat key also carried an extra character (41 hex digits instead of 40), so it never matched the real token and fell through to a chain:address key that has no price.
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.
1sec's four ICP-native assets (ICP, BOB, CHAT, GLDT) are contributing $0 to bridge volume on ethereum, arbitrum and base.
Why
aggregate.tsskips a token outright when it has neither a decimals override nor a decimals value from the price API:These four are mapped to
coingecko:ids, and a coingecko key returns a price but nodecimalsfield:None of the four had an entry in
transformTokenDecimals, and there was nobaseblock there at all — so every transfer of them was dropped.Separately, the openchat key was malformed
One extra
b. It could never match the real address, so CHAT fell through to<chain>:0xdb95..., which returns no price on ethereum, arbitrum or base — also $0.Decimals verified on-chain
decimals()called directly on each contract:Effect
Resolving
transformTokens/transformTokenDecimalsfor all 12 token-chain combinations:Currently outstanding supply of these assets, all presently valued at $0 by the aggregator:
tsc --noEmitexits 0.