Skip to content

Add VIRTUS Protocol TVL adapter (Base)#18516

Closed
cto-virtus wants to merge 1 commit intoDefiLlama:mainfrom
cto-virtus:feat/virtus-protocol-tvl
Closed

Add VIRTUS Protocol TVL adapter (Base)#18516
cto-virtus wants to merge 1 commit intoDefiLlama:mainfrom
cto-virtus:feat/virtus-protocol-tvl

Conversation

@cto-virtus
Copy link

@cto-virtus cto-virtus commented Mar 24, 2026

Adds TVL adapter for VIRTUS Protocol (Aerodrome fork) on Base mainnet.

Uses uniswapV2 helper for basic AMM pools (PoolFactory: 0x7F03ae4452192b0E280fB0d4f9c225DDa88C7623) and uniswapV3 helper for concentrated liquidity pools (CLFactory: 0x0e5Ab24beBdA7e5Bb3961f7E9b3532a83aE86B48).

Website: https://virtus-protocol.com
Twitter: https://x.com/VirtusCEO

Summary by CodeRabbit

  • New Features
    • Added Virtus Protocol integration for TVL tracking across multiple liquidity sources and networks.
    • Aggregates TVL from distinct pool discovery methods to provide a single, combined TVL metric.
    • Improved handling of token representations to produce more accurate total value locked calculations.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a66cc67e-accd-4eb8-97c2-52b69a23f193

📥 Commits

Reviewing files that changed from the base of the PR and between 7fec068 and 533d087.

📒 Files selected for processing (1)
  • projects/virtus-protocol/index.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • projects/virtus-protocol/index.js

📝 Walkthrough

Walkthrough

Adds a new DeFiLlama adapter module that computes TVL by summing a Uniswap V3-derived TVL and a Uniswap V2-like getUniTVL output, and exports it with misrepresentedTokens: true.

Changes

Cohort / File(s) Summary
New Virtus Protocol Adapter
projects/virtus-protocol/index.js
Creates a DeFiLlama-compatible adapter exporting misrepresentedTokens: true and base.tvl computed via sdk.util.sumChainTvls of two sources: a uniV3Export-based V3 TVL (factory address, start block, pool-created event ABI, topic filter) and a getUniTVL call (factory address, useDefaultCoreAssets, hasStablePools, with allPoolsLength/allPools(uint256) ABIs).

Sequence Diagram

sequenceDiagram
    participant Adapter as Virtus Adapter
    participant UV3 as Uniswap V3 TVL Calculator
    participant UV2 as Uniswap V2-like TVL Calculator
    participant SDK as SDK Utilities

    Adapter->>UV3: request V3 TVL (factory, startBlock, event ABI, topic)
    UV3-->>Adapter: V3 TVL result
    Adapter->>UV2: request V2-like TVL (factory, pool ABIs, core assets, stable pools)
    UV2-->>Adapter: V2-like TVL result
    Adapter->>SDK: sdk.util.sumChainTvls([V3_TVL, V2_TVL])
    SDK-->>Adapter: aggregated TVL
    Adapter-->>Adapter: export { misrepresentedTokens: true, base.tvl }
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped to a file and stitched two streams,
V3 and V2 — combined like dreams.
A little adapter, tidy and spry,
Exports TVL beneath the sky.
Hop on, Virtus — liquidity flies! 🚀

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description provides protocol name, chain, factory addresses, and relevant links, but does not address the template's required fields for new listings (name, Twitter, audit links, website, logo, TVL, treasury, chain, Coingecko ID, description, token address, category, oracle provider, methodology, etc.). Complete the required listing information sections from the template including protocol name, audit links (if any), chain confirmation, category, oracle provider details, and methodology explanation for TVL calculation.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add VIRTUS Protocol TVL adapter (Base)' directly and clearly describes the main change: adding a TVL adapter for VIRTUS Protocol on the Base chain.
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 unit tests (beta)
  • Create PR with unit tests

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.

@llamabutler
Copy link

The adapter at projects/virtus-protocol exports TVL:

base                      20.07 k

total                    20.07 k 

Copy link
Contributor

@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.

🧹 Nitpick comments (1)
projects/virtus-protocol/index.js (1)

19-27: Consider adding a short methodology export.

A concise methodology string documenting “Base TVL = CL factory + V2-like factory pools” would improve maintainability and reviewer/operator context.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@projects/virtus-protocol/index.js` around lines 19 - 27, Add a brief
methodology export to module.exports describing how TVL is calculated: "Base TVL
= CL factory (clTvl.base.tvl) + V2-like factory pools (getUniTVL with factory
0x7F03ae4452192b0E280fB0d4f9c225DDa88C7623)". Update the exported object
(module.exports) to include a methodology string field next to
misrepresentedTokens and base so reviewers/operators understand that the base
TVL sums clTvl.base.tvl and the getUniTVL result using the v2Abis and
hasStablePools flag.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@projects/virtus-protocol/index.js`:
- Around line 19-27: Add a brief methodology export to module.exports describing
how TVL is calculated: "Base TVL = CL factory (clTvl.base.tvl) + V2-like factory
pools (getUniTVL with factory 0x7F03ae4452192b0E280fB0d4f9c225DDa88C7623)".
Update the exported object (module.exports) to include a methodology string
field next to misrepresentedTokens and base so reviewers/operators understand
that the base TVL sums clTvl.base.tvl and the getUniTVL result using the v2Abis
and hasStablePools flag.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 26902508-5551-489f-8489-7023a621ca6c

📥 Commits

Reviewing files that changed from the base of the PR and between 767dc61 and 7fec068.

📒 Files selected for processing (1)
  • projects/virtus-protocol/index.js

@cto-virtus cto-virtus force-pushed the feat/virtus-protocol-tvl branch from 7fec068 to 533d087 Compare March 24, 2026 14:03
@llamabutler
Copy link

The adapter at projects/virtus-protocol exports TVL:

base                      20.07 k

total                    20.07 k 

@bheluga
Copy link
Member

bheluga commented Mar 24, 2026

Added #18519

@bheluga bheluga closed this Mar 24, 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.

4 participants