Skip to content

fix merkl poolmeta and symbol#2284

Merged
0xkr3p merged 2 commits intoDefiLlama:masterfrom
0xkr3p:fix/merkl-token-pool-meta
Jan 23, 2026
Merged

fix merkl poolmeta and symbol#2284
0xkr3p merged 2 commits intoDefiLlama:masterfrom
0xkr3p:fix/merkl-token-pool-meta

Conversation

@0xkr3p
Copy link
Contributor

@0xkr3p 0xkr3p commented Jan 23, 2026

output now

  {
    pool: '0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CBWHITELIST_PER_PROTOCOL-merkl',
    chain: 'ethereum',
    project: 'merkl',
    poolMeta: 'LEND - steakUSDC',
    symbol: 'USDC',
    tvlUsd: 426560016.1653225,
    apyReward: 0.2623818741234162,
    rewardTokens: [ '0x58D97B57BB95320F9a05dC918Aef65434969c2B2' ],
    underlyingTokens: [
      '0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB',
      '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
    ],
    url: 'https://app.merkl.xyz/opportunities/ethereum/MORPHOVAULT/0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CBWHITELIST_PER_PROTOCOL'
  }

Summary by CodeRabbit

Release Notes

  • New Features
    • Added URL field to pool data for the Merkl adaptor, generated based on chain and pool address.
    • Refined pool symbol derivation to use the last token's symbol for improved clarity.
    • Updated pool metadata composition logic for better consistency.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

📝 Walkthrough

Walkthrough

The Merkl adaptor is modified to derive pool symbols from the last token instead of concatenating all tokens, compute pool metadata from action and vault name, and introduce a new URL field to the pool data object based on chain, pool type, and address.

Changes

Cohort / File(s) Summary
Merkl adaptor symbol and metadata refinement
src/adaptors/merkl/index.js
Changed symbol derivation to use the last token's symbol instead of joining all tokens; updated poolMeta computation to derive from action and vaultName with null fallback; added new url field to poolData object constructed from chain, pool type, and pool address.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A symbol refined, now last token takes the stage,
Metadata born anew from vault and action's page,
URLs spring forth to light the pathway true,
The Merkl adaptor dances, wearing threads brand new! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix merkl poolmeta and symbol' directly addresses the main changes: poolMeta computation is refined and symbol derivation is altered from concatenated tokens to the last token's symbol.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/adaptors/merkl/index.js (1)

68-79: Guard against empty trailing token symbols to avoid unnecessary fallback

With the “last token” heuristic, a missing trailing symbol (but valid earlier symbols) makes symbol empty and forces the ABI fallback. That can drop pools if the fallback target isn’t resolvable. Consider selecting the last non-empty symbol instead.

🛠️ Suggested fix
-        const tokenSymbols = pool.tokens.map((x) => x.symbol);
-        let symbol = tokenSymbols[tokenSymbols.length - 1] || '';
+        const tokenSymbols = pool.tokens.map((x) => x.symbol);
+        let symbol = '';
+        for (let i = tokenSymbols.length - 1; i >= 0 && !symbol; i--) {
+          symbol = tokenSymbols[i] || '';
+        }
🧹 Nitpick comments (1)
src/adaptors/merkl/index.js (1)

95-108: Optional: URL‑encode dynamic segments

If poolType or poolAddress ever includes non‑URL‑safe characters, the generated link can break. Encoding the segments makes it robust.

🔧 Suggested tweak
-        const poolUrl = `https://app.merkl.xyz/opportunities/${chain}/${poolType}/${poolAddress}`;
+        const poolUrl = `https://app.merkl.xyz/opportunities/${encodeURIComponent(chain)}/${encodeURIComponent(poolType)}/${encodeURIComponent(poolAddress)}`;

@0xkr3p 0xkr3p merged commit 30099eb into DefiLlama:master Jan 23, 2026
2 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Feb 2, 2026
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.

1 participant