Skip to content

feat(metrom-adapter): integrate hold fungible asset campaign types#2813

Open
luzzif wants to merge 1 commit into
DefiLlama:masterfrom
metrom-xyz:master
Open

feat(metrom-adapter): integrate hold fungible asset campaign types#2813
luzzif wants to merge 1 commit into
DefiLlama:masterfrom
metrom-xyz:master

Conversation

@luzzif

@luzzif luzzif commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added support for campaigns targeting held fungible assets.
    • LP assets now display underlying token symbols and addresses, along with exchange information.
    • Protocol-based assets now show their token details and associated protocol.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Metrom adaptor typing and campaign processing now support the hold-fungible-asset target, including LP-specific token details and protocol-specific metadata.

Changes

Metrom fungible asset targets

Layer / File(s) Summary
Fungible asset target contracts
src/adaptors/metrom/index.ts
Adds token detail types for LP and protocol metadata and includes HoldFungibleAssetTarget in the campaign target union.
Fungible asset target processing
src/adaptors/metrom/index.ts
Processes LP targets using base and quote token data with DEX metadata, and protocol targets using token data with optional slug metadata.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: slasher125

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding hold fungible asset campaign type support in the Metrom adapter.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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.

@github-actions

Copy link
Copy Markdown

The metrom adapter exports pools:

Test Suites: 1 passed, 1 total
Tests: 45 passed, 45 total
Snapshots: 0 total
Time: 0.25 s
Ran all test suites.

Nb of pools: 6
 

Sample pools:
┌─────────┬─────────┬──────────────────────────────────────────────────┬──────────────────────────────────────────┬─────────┬───────────┬───────────────────────────────┬───────────────────────────┬───────────────────────────────────────────────────────────────┬────────────┬──────────┬──────────────────┐
│ (index) │ symbol  │ underlyingTokens                                 │ url                                      │ apyBase │ apyReward │ rewardTokens                  │ poolMeta                  │ pool                                                          │ chain      │ project  │ tvlUsd           │
├─────────┼─────────┼──────────────────────────────────────────────────┼──────────────────────────────────────────┼─────────┼───────────┼───────────────────────────────┼───────────────────────────┼───────────────────────────────────────────────────────────────┼────────────┼──────────┼──────────────────┤
│ 0       │ 'USDC'  │ [ '0x203a662b0bd271a6ed5a60edfbd04bfce608fd36' ] │ 'https://app.metrom.xyz/en?type=rewards' │ 3.0132  │ 2.1496    │ [ 'KAT' ]                     │ 'Deposit to Katana USDC'  │ 'turtle-katana campaign-1da6331a-0315-42b3-9cde-99ec55884d30' │ 'Katana'   │ 'metrom' │ 9659162.231043   │
│ 1       │ 'WETH'  │ [ '0xee7d8bcfb72bc1880d0cf19822eb0a2e6577ab62' ] │ 'https://app.metrom.xyz/en?type=rewards' │ 0.7983  │ 0.3951    │ [ 'KAT' ]                     │ 'Deposit to Katana WETH'  │ 'turtle-katana campaign-14da66c3-4f06-4b9c-a6a3-b63a07d6e706' │ 'Katana'   │ 'metrom' │ 8239426.12901788 │
│ 2       │ 'USDT'  │ [ '0x2dca96907fde857dd3d816880a0df407eeb2d2f2' ] │ 'https://app.metrom.xyz/en?type=rewards' │ 1.0908  │ 0.7107    │ [ 'KAT' ]                     │ 'Deposit to Katana USDT'  │ 'turtle-katana campaign-828ee8d9-65c0-47ea-a2c3-a7f8c68fe671' │ 'Katana'   │ 'metrom' │ 4173903.29728457 │
│ 3       │ 'WBTC'  │ [ '0x0913da6da4b42f538b445599b46bb4622342cf52' ] │ 'https://app.metrom.xyz/en?type=rewards' │ 0.004   │           │                               │ 'Deposit to Katana WBTC'  │ 'turtle-katana campaign-817a72e5-72f5-4447-ae32-ae0e3261ac86' │ 'Katana'   │ 'metrom' │ 1432644.85828017 │
│ 4       │ 'weETH' │ [ '0xcd5fe23c85820f7b72d0926fc9b05b43e359b7ee' ] │ 'https://app.metrom.xyz/en?type=rewards' │         │ 3.99      │ [ 'V', 'weETH Native Yield' ] │ 'Deposit to Katana weETH' │ 'turtle-katana campaign-0f4b3c26-0b58-4250-bded-6a34794344e4' │ 'Ethereum' │ 'metrom' │ 879141.48282909  │
│ 5       │ 'AUSD'  │ [ '0x00000000efe302beaa2b3e6e1b18d08d69a9012a' ] │ 'https://app.metrom.xyz/en?type=rewards' │ 26.5728 │           │                               │ 'Deposit to Katana AUSD'  │ 'turtle-katana campaign-b91fab34-3998-468b-adcf-645d9b68bc9c' │ 'Katana'   │ 'metrom' │ 120109.55674982  │
└─────────┴─────────┴──────────────────────────────────────────────────┴──────────────────────────────────────────┴─────────┴───────────┴───────────────────────────────┴───────────────────────────┴───────────────────────────────────────────────────────────────┴────────────┴──────────┴──────────────────┘

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/adaptors/metrom/index.ts (1)

341-362: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

LGTM on the processing logic.

The LP vs protocol/undefined branching is correct: TypeScript narrowing after the early return ensures the fallback safely handles both ProtocolTokenDetails and undefined details. The humanizeTargetProtocol('Hold', ...) call gracefully degrades to just 'Hold' when no slug is available.

One minor style note: the if at line 344 omits braces, while every other case block and conditional in this file uses curly braces. Consider adding them for consistency.

🎨 Optional style alignment
-      if (asset.details?.type === 'lp')
+      if (asset.details?.type === 'lp') {
         return {
           symbol: `${asset.details.baseTokenSymbol} - ${asset.details.quoteTokenSymbol}`,
           underlyingTokens: [
             asset.details.baseTokenAddress,
             asset.details.quoteTokenAddress,
           ],
           poolMeta: humanizeTargetProtocol('Pool on', asset.details.dex),
         };
+      }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/adaptors/metrom/index.ts` around lines 341 - 362, Add braces around the
LP-details conditional in the hold-fungible-asset case, keeping its existing
early-return behavior unchanged and matching the surrounding style.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/adaptors/metrom/index.ts`:
- Around line 341-362: Add braces around the LP-details conditional in the
hold-fungible-asset case, keeping its existing early-return behavior unchanged
and matching the surrounding style.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d6386376-a8a4-478b-b01f-ba1f8c66d4bc

📥 Commits

Reviewing files that changed from the base of the PR and between e7ce463 and 05b3cd0.

📒 Files selected for processing (1)
  • src/adaptors/metrom/index.ts

@0xkr3p

0xkr3p commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

hi @luzzif, thanks for the PR - moving forwards we are not supporting hold campaigns, feel free to remove the hold campaign changes and keep the LP changes

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.

2 participants