fix: stablecoins incorrectly marked from single character symbols#2283
fix: stablecoins incorrectly marked from single character symbols#2283slasher125 merged 1 commit intoDefiLlama:masterfrom
Conversation
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Pools are incorrectly being marked as containing stablecoins because a substring search is matching a known stablecoin symbol.
The issue though is the stablecoins (fetched from here: https://stablecoins.llama.fi/stablecoins?includePrices=true) include symbols like
U,M,R, andDwhich obviously match a lot of words/tokens when using.includes().This change enforces an exact match when the stablecoin symbol is a single character.
Testing
Example of an incorrectly marked pool:
API: https://yields.llama.fi/poolsEnriched?pool=90011ef5-44b0-4da8-ba2c-8779baf20599
UI: https://defillama.com/yields/pool/e19c3745-6e2d-4228-b7e0-c28f12b0c727
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.