Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node/hack: Print potential USD stablecoins that appear depegged #4130

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

djb15
Copy link
Collaborator

@djb15 djb15 commented Oct 7, 2024

This addition to the governor token generation script searches for and prints and tokens that look like USD stablecoins and have deviated from the expected $1 price by more than a certain percentage (defaults to 10%). It discards any false positive matches that are specified in an array.

To start with I've only considered USD stablecoins.

Output for the current token list looks something like:

Potentially depegged USD stablecoins (>10%) = 5:
<WH_chain_id>-<WH_token_addr>-<token_symbol> = <token_price>

[
 "2-000000000000000000000000df574c24545e5ffecb9a659c229253d4111d87e1-HUSD = 0.02706502",
 "13-0000000000000000000000005c74070fdea071359b86082bd9f9b3deaafbe32b-KDAI = 0.20189",
 "13-000000000000000000000000754288077d0ff82af7a5317c7cb8c444d421d103-oUSDC = 0.247451",
 "13-000000000000000000000000cee8faf64bb97a73bb51e115aa89c17ffa8dd167-oUSDT = 0.121859",
 "16-000000000000000000000000818ec0a7fe18ff94269904fced6ae3dae6d6dc0b-USDC = 0.092542"
]

To be explicit, this change does not change the output of the generated_mainnet_tokens file, it just outputs to a txt for visibility when reviewing PRs.

@djb15 djb15 requested a review from johnsaigle October 7, 2024 20:12
@johnsaigle
Copy link
Contributor

I think it might be more robust to match on CoinGecko ID rather than symbol (could do both though), e.g. searching for usd-coin or tether

Doing an exact string match might miss some examples:

(UTF-8 I guess)

{chain: 14, addr: "00000000000000000000000048065fbbe25f71c9282ddf5e1cd6d6a887483d5e", symbol: "USDâ®", coinGeckoId: "tether", decimals: 6, price: 1},

(lowercase T)

{chain: 6, addr: "0000000000000000000000009702230a8ea53601f5cd2dc00fdbc13d4df4a8c7", symbol: "USDt", coinGeckoId: "tether", decimals: 6, price: 1},

(Variant on USDC with some branding)

{chain: 30, addr: "000000000000000000000000d9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca", symbol: "USDbC", coinGeckoId: "bridged-usd-coin-base", decimals: 6, price: 0.998167},  

(no symbol...)

{chain: 1, addr: "b7db4e83eb727f1187bd7a50303f5b4e4e943503da8571ad6564a51131504792", symbol: "", coinGeckoId: "wrapped-usdt-allbridge-from-polygon", decimals: 6, price: 1.004},

@djb15 djb15 marked this pull request as ready for review October 7, 2024 23:25
@djb15
Copy link
Collaborator Author

djb15 commented Oct 7, 2024

Thanks again for the feedback, have tweaked the search to search on "USD" as planned, and added the suggestion to also search on CoinGecko id. Currently there are 13 tokens that match, so not overly noisy, although could probably trim down this list some more by adding some to the exclusion list (don't want to be too strict though as otherwise it defeats the point of this change)

@johnsaigle johnsaigle merged commit f475e0d into main Oct 8, 2024
24 checks passed
@johnsaigle johnsaigle deleted the flag-depegged-usd-stablecoins branch October 8, 2024 13:29
kakucodes pushed a commit to kakucodes/wormhole that referenced this pull request Dec 10, 2024
…ion#4103)

The `set -u` options in these scripts caused them to fail with 'unbound
variable' errors when CLI args or env variables were unset. This commit
fixes the validation so that the scripts output usage info or helpful
errors instead of exiting with unbound variable errors that the user
must read the source to diagnose.

for the script `ethereum/sh/upgrade_all_testnet.sh`, the commit updates
a variable name that appears incorrect.

node/hack: Print potential USD stablecoins that appear depegged (wormhole-foundation#4130)

* node/hack: Print potential USD stablecoins that appear depegged

* PR feedback

whitepapers: Clarify CCQ sol_pda support (wormhole-foundation#4129)

GitHub: Update code owners for go sdk (wormhole-foundation#4133)

Deploy Unichain testnet (wormhole-foundation#4134)

* Deploy Unichain testnet

* Add snaxchain to proto

node: Governor token list update (wormhole-foundation#4126)

* node: governor token list update

* Manually fix token price

---------

Co-authored-by: djb15 <[email protected]>

docs: Update SECURITY.md

Replace Guardian Key with abstracted Guardian Signer (wormhole-foundation#4120)

* node: add guardiansigner node/pkg

* node: replace use of guardian key with guardian signer

* node: replace use of vaa.AddSigner with guardian signer

* node: add nolint for armor import and fix test

* node: handle error returned from signing

* apply draft review suggestions

* apply pr reviews

* apply pr reviews

* apply pr reviews

* apply pr reviews

---------

Co-authored-by: pleasew8t <[email protected]>

Deploy Worldchain testnet (wormhole-foundation#4140)

* Deploy Worldchain testnet

* Update WETH address

* Fix cli test and add token bridge VAAs

add deprecation warning to the top of SDK readme (wormhole-foundation#4142)

spy: respect --port if set (wormhole-foundation#4139)

codeowners: Update for audits folder (wormhole-foundation#4144)

Deploy Monad Devnet (wormhole-foundation#4145)

* Deploy Monad Devnet

* Code review rework

docs: Audit reports (wormhole-foundation#4143)

* docs: Audit reports

* Rename

cosmwasm: add wormchain ibc receiver tests (wormhole-foundation#4121)

cosmwasm: add support for json schemas for all contracts (wormhole-foundation#4118)

* cosmwasm: add support for json schemas for all contracts

* cosmwasm: fixed formatting as per the linter

Node: Remove cutover checks (wormhole-foundation#4149)

Add interchaintest tests to wormchain
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.

3 participants