-
Notifications
You must be signed in to change notification settings - Fork 970
Fix SparkDEX V3 and V3.1 adapters for proper DefiLlama integration #2067
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
base: master
Are you sure you want to change the base?
Conversation
The sparkdex-v3.1 adapter exports pools: Test Suites: 1 passed, 1 total
|
@0xNx pls split these into separate PRs, otherwise i cant' see the output here of each |
@@ -20,15 +26,20 @@ const apy = async () => { | |||
) | |||
).data[0].data; | |||
|
|||
const chain = 'Flare'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
incorrect, we want to keep the capitalised version, no need to change this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.


https://defillama.com/protocol/sparkdex
Any reason why SparkDEX v3.1 pools not displaying on the SparkDEX(Combined) Yield page, there are only v2 pools displaying.
Seems the chain name (flare vs Flare) is the reason ?
Fix SparkDEX V3 and V3.1 adapters for proper DefiLlama integration
Summary
This PR fixes critical issues in SparkDEX V3 and V3.1 adapters that were preventing pools from appearing on DefiLlama's combined page. The main issues were incorrect chain naming and APY calculation problems.
Issues Fixed
1. Chain Name Mismatch 🚨
chain: 'Flare'
(capitalized)chain: 'flare'
(lowercase) to match DefiLlama's standard2. APY Calculation Issues 🚨
3. V3 Adapter Migration 🔄
Changes Made
SparkDEX V3 Adapter (
src/adaptors/sparkdex-v3/index.js
)SparkDEX V3.1 Adapter (
src/adaptors/sparkdex-v3.1/index.js
)Technical Details
APY Calculation Safety
Data Source Migration
Testing Results
Before Fix
Infinity
or extremely large numbersAfter Fix
flare
chain nameImpact
DefiLlama Integration
Data Quality
Files Modified
src/adaptors/sparkdex-v3/index.js
- Complete rewrite with new API and fixessrc/adaptors/sparkdex-v3.1/index.js
- Chain name fix and APY safetyFiles Unchanged
src/adaptors/sparkdex-v2/index.js
- Already working correctlyTesting
All adapters pass comprehensive tests:
Breaking Changes
None. This is a bug fix that improves compatibility with DefiLlama.
Related Issues
Deployment Notes
Future Considerations
Reviewers: Please verify the chain name changes and APY calculation logic
Testing: All adapters pass tests, but manual verification on DefiLlama is recommended