Skip to content

Add Theoriq V2 tokenized vault adapter#18509

Merged
0xpeluche merged 5 commits intoDefiLlama:mainfrom
iFirebrand:add-theoriq-v2-adapter
Mar 26, 2026
Merged

Add Theoriq V2 tokenized vault adapter#18509
0xpeluche merged 5 commits intoDefiLlama:mainfrom
iFirebrand:add-theoriq-v2-adapter

Conversation

@iFirebrand
Copy link
Contributor

@iFirebrand iFirebrand commented Mar 23, 2026

Summary

  • Adds TVL adapter for the Theoriq V2 tokenized vault on Ethereum (0x0F54097295E97cE61736bb9a0a1066cDf3e31C8F)
  • Tracks asset balances across the vault and 4 sub-accounts
  • Dynamically reads the vault's primary asset via asset() and includes common tokens (ETH, USDC, USDT, WETH)

Test plan

  • node test.js projects/theoriq-v2/index.js passes locally with ~$47 TVL detected (XAUt, ETH, USDC)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added TVL tracking for a new Ethereum vault, summing the vault’s underlying asset balances.
  • Documentation

    • Added methodology describing how vault-held asset balances are summed and presented.
  • Chores

    • Marked the vault’s TVL as double-counted in aggregated reports.

Tracks TVL for the Theoriq V2 vault on Ethereum by summing asset
balances across the vault and its four sub-accounts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 23, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 90074755-6042-4b5a-a81f-9a176012b058

📥 Commits

Reviewing files that changed from the base of the PR and between ed9eaf8 and b919579.

📒 Files selected for processing (1)
  • projects/theoriq-gold-vault/index.js

📝 Walkthrough

Walkthrough

Adds projects/theoriq-gold-vault/index.js, exporting an Ethereum TVL adapter that lists vault addresses and implements tvl(api) which delegates balance aggregation to api.erc4626Sum (querying tokenAbi: 'address:asset' and balanceAbi: 'uint256:getTotalAssets'). Exports doublecounted: true, methodology, and ethereum.tvl.

Changes

Cohort / File(s) Summary
New TVL adapter
projects/theoriq-gold-vault/index.js
Adds an Ethereum TVL adapter file that defines a VAULTS list and an async tvl(api) which calls api.erc4626Sum using tokenAbi: 'address:asset' and balanceAbi: 'uint256:getTotalAssets'. Exports doublecounted: true, methodology, and ethereum: { tvl }.

Sequence Diagram(s)

sequenceDiagram
    participant Adapter as Adapter (theoriq-gold-vault)
    participant API as DefiLlama API
    participant Chain as Ethereum (Vault contracts)

    Adapter->>API: tvl(api) -> api.erc4626Sum(calls: VAULTS, tokenAbi:'address:asset', balanceAbi:'uint256:getTotalAssets')
    API->>Chain: call vault.asset() for each VAULT (via tokenAbi)
    Chain-->>API: returns underlying asset addresses
    API->>Chain: call getTotalAssets() for each VAULT (via balanceAbi)
    Chain-->>API: returns asset balances per vault
    API-->>Adapter: aggregated balances (sum per token)
    Adapter-->>Adapter: export { ethereum: { tvl } , doublecounted, methodology }
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hopped to a vault with glinting code,

I asked for its asset on the blockchain road,
I counted its gold with a careful sum,
Double-count flagged — still the totals drum,
A rabbit's cheer for the TVL ode.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The PR description provides a clear summary of the changes and includes a test plan showing local verification, but does not follow the repository's template for new listings. Consider whether this is a new listing requiring template sections (Name, Chain, Website, etc.) or an adapter-only update. If new listing info is needed, provide missing template sections.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a TVL adapter for Theoriq V2 tokenized vault, which is the primary purpose of this pull request.

✏️ 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/theoriq-v2 exports TVL:

ethereum                  47.00

total                    46.99 

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@llamabutler
Copy link

The adapter at projects/theoriq-gold-vault exports TVL:

ethereum                  47.00

total                    47.43 

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@projects/theoriq-gold-vault/index.js`:
- Around line 21-23: The exported project metadata sets doublecounted: true
without documented cross-protocol overlap; remove the doublecounted property (or
set it to false) in the exported object and update the methodology string if
needed, or if you must keep true, add explicit evidence/comments describing
which other protocol adapters count the same balances and how overlap is
measured; specifically edit the doublecounted key and the methodology text in
the same exported object to either remove the flag or justify it with concrete
overlap details.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a0bffbe0-0a8e-4ed1-9e34-96f4e68ca7d7

📥 Commits

Reviewing files that changed from the base of the PR and between 884a607 and 206a050.

📒 Files selected for processing (1)
  • projects/theoriq-gold-vault/index.js

Vault holds tokens directly without depositing into other protocols,
so there is no cross-protocol TVL overlap.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@llamabutler
Copy link

The adapter at projects/theoriq-gold-vault exports TVL:

ethereum                  46.00

total                    46.24 

@0xpeluche 0xpeluche self-assigned this Mar 25, 2026
@llamabutler
Copy link

The adapter at projects/theoriq-gold-vault exports TVL:

ethereum                  4.81 k

total                    4.81 k 

@0xpeluche 0xpeluche merged commit 7a4d305 into DefiLlama:main Mar 26, 2026
1 check passed
@llamabutler
Copy link

The adapter at projects/theoriq-gold-vault exports TVL:

ethereum                  4.81 k

total                    4.81 k 

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