Skip to content

Add MegaVault and dYdX TVL Reporting to Gauntlet Adapter #15526

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

Merged
merged 6 commits into from
Jul 21, 2025

Conversation

Roni-1997
Copy link
Contributor

Summary
-Add MegaVault (MV) TVL reporting to the Gauntlet adapter.
-Add dYdX TVL reporting (currently shows 0 due to backend mapping, see notes).

Details
-MegaVault TVL is fetched and reported under the appropriate key.
-dYdX TVL is fetched and reported as uusdc (Noble USDC), but currently not displayed in CLI/website due to backend mapping—please advise if a different identifier is needed.

Testing
-Ran local tests (node test.js projects/gauntlet), all chains report expected TVL.
-No errors or crashes.

Clarification regarding Drift/Carrot logic
-The logic for Solana Drift vaults, including Carrot hJLP, is already included in a previous PR: #15519.
-This PR may temporarily include those changes until #15519 is merged. Once that PR is merged, this one will only contain the MegaVault and dYdX changes.

Notes
Please advise on the correct identifier for dYdX TVL if uusdc is not supported.

const pnlArr = data.megavaultPnl;
if (!pnlArr || !pnlArr.length) return;
const currentTvl = Number(pnlArr[pnlArr.length - 1].equity);
// Report as Noble USDC (uusdc, 6 decimals)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this asset on coingecko?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not, can you use USDC from mainnet? 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48

@waynebruce0x waynebruce0x self-assigned this Jul 17, 2025
@Roni-1997 Roni-1997 requested a review from waynebruce0x July 17, 2025 14:41
// Report as USD value (this should work with DeFiLlama's backend)
api.add('tether', (currentTvl * 1e6).toFixed(0));

} catch (error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove any try/catch

const currentTvl = Number(pnlArr[pnlArr.length - 1].equity);

// Report as USD value (this should work with DeFiLlama's backend)
api.add('tether', (currentTvl * 1e6).toFixed(0));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use coingecko:usd-coin

- Remove try/catch from MegaVault TVL function (per reviewer request)
- Report MegaVault TVL using 'coingecko:usd-coin' identifier
- Remove all debugging logs and unrelated changes
- Ensure code is clean and in sync with latest reviewer feedback
@llamabutler
Copy link

The adapter at projects/gauntlet exports TVL:

ethereum                  950.63 M
base                      118.87 M
katana                    67.57 M
unichain                  63.34 M
polygon                   61.50 M
solana                    44.85 M
hyperliquid               7.08 M

total                    1.31 B 

@Roni-1997 Roni-1997 requested a review from waynebruce0x July 18, 2025 14:10
@waynebruce0x waynebruce0x merged commit ca2c08e into DefiLlama:main Jul 21, 2025
1 check passed
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