Skip to content

feat: add Dowsure vault TVL support to lista-rwa adapter#18672

Open
tyler-tsai wants to merge 1 commit intoDefiLlama:mainfrom
tyler-tsai:feat/add-dowsure-tvl
Open

feat: add Dowsure vault TVL support to lista-rwa adapter#18672
tyler-tsai wants to merge 1 commit intoDefiLlama:mainfrom
tyler-tsai:feat/add-dowsure-tvl

Conversation

@tyler-tsai
Copy link
Copy Markdown
Contributor

@tyler-tsai tyler-tsai commented Apr 7, 2026

Added support for Dowsure vault products alongside existing Centrifuge products in the lista-rwa adapter.

Changes:

  • Added getVaultInfo ABI for Dowsure vault contract calls
  • Separate handling for Centrifuge vs Dowsure products based on group field
  • Dowsure vaults use getVaultInfo() which returns [maxCapacity, totalDeposited, stakingDays]
  • totalDeposited is used as the TVL for Dowsure products
  • Support for multi-asset Dowsure vaults (USDT/USDC)

Dowsure Vault Contract: 0x3a81b9d9ddcc80ef0ebeb462ddf40c73d48e0619
Current TVL: ~$320k in USDT/USDC

NOTE

Please enable "Allow edits by maintainers" while putting up the PR.


  1. If you would like to add a volume/fees/revenue adapter please submit the PR here.

  2. Once your adapter has been merged, it takes time to show on the UI. If more than 24 hours have passed, please let us know in Discord.

  3. Sorry, We no longer accept fetch adapter for new projects, we prefer the tvl to computed from blockchain data, if you have trouble with creating a the adapter, please hop onto our discord, we are happy to assist you.

  4. For updating listing info It is a different repo, you can find your listing in this file, you can edit it there and put up a PR

  5. Please do not add new npm dependencies, do not edit/push pnpm-lock.yaml file as part of your changes


(Needs to be filled only for new listings)

Name (to be shown on DefiLlama):
Twitter Link:
List of audit links if any:
Website Link:
Logo (High resolution, will be shown with rounded borders):
Current TVL:
Treasury Addresses (if the protocol has treasury)
Chain:
Coingecko ID (so your TVL can appear on Coingecko, leave empty if not listed): (https://api.coingecko.com/api/v3/coins/list)
Coinmarketcap ID (so your TVL can appear on Coinmarketcap, leave empty if not listed): (https://api.coinmarketcap.com/data-api/v3/map/all?listing_status=active,inactive,untracked&start=1&limit=10000)
Short Description (to be shown on DefiLlama):
Token address and ticker if any:
Category (full list at https://defillama.com/categories) *Please choose only one:
Oracle Provider(s): Specify the oracle(s) used (e.g., Chainlink, Band, API3, TWAP, etc.):
Implementation Details: Briefly describe how the oracle is integrated into your project:
Documentation/Proof: Provide links to documentation or any other resources that verify the oracle's usage:
forkedFrom (Does your project originate from another project):
methodology (what is being counted as tvl, how is tvl being calculated):
Github org/user (Optional, if your code is open source, we can track activity):
Does this project have a referral program?

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced RWA TVL calculation to use product-specific methodologies for improved accuracy and data reliability.
  • Documentation

    • Updated methodology documentation to clarify TVL calculation approaches for different RWA product categories.

Added support for Dowsure vault products alongside existing Centrifuge products in the lista-rwa adapter.

Changes:
- Added getVaultInfo ABI for Dowsure vault contract calls
- Separate handling for Centrifuge vs Dowsure products based on group field
- Dowsure vaults use getVaultInfo() which returns [maxCapacity, totalDeposited, stakingDays]
- totalDeposited is used as the TVL for Dowsure products
- Support for multi-asset Dowsure vaults (USDT/USDC)

Dowsure Vault Contract: 0x3a81b9d9ddcc80ef0ebeb462ddf40c73d48e0619
Current TVL: ~$320k in USDT/USDC
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

📝 Walkthrough

Walkthrough

The RWA TVL computation in lista-rwa/index.js has been refactored to handle products differently based on their group classification. Centrifuge products continue using the existing totalAssets multicall approach, while Dowsure products now use a new getVaultInfo contract call to retrieve totalDeposited. The exported methodology documentation has been updated to reflect this dual-path calculation.

Changes

Cohort / File(s) Summary
RWA TVL Computation
projects/lista-rwa/index.js
Added conditional product group handling: Centrifuge products use existing asset/totalAssets multicalls; Dowsure products now call getVaultInfo to read totalDeposited. New ABI entry added for getVaultInfo function. Updated methodology export to describe both calculation paths.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A hop, skip, and code review away,
Two paths for TVL to display—
Centrifuge hops left, Dowsure right,
getVaultInfo shines in the light!
Deposits tallied, assets aligned, 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

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.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding Dowsure vault TVL support to the lista-rwa adapter, which matches the core functionality addition in the PR.
Description check ✅ Passed The PR description provides a clear summary of changes with technical details about the Dowsure implementation, but does not fully complete the template's new listing section (not applicable here since this is an adapter update, not a new listing).

✏️ 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
Copy Markdown

The adapter at projects/lista-rwa exports TVL:

bsc                       1.33 M

total                    1.33 M 

Copy link
Copy Markdown
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: 2

🤖 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/lista-rwa/index.js`:
- Line 50: Update the methodology string to explicitly state the Dowsure
attribution assumption: note that while TVL sums Dowsure's totalDeposited, this
amount is attributed to a single asset selected from the product metadata (the
metadata field used to pick the asset should be named), so modify the
methodology property to mention Dowsure, totalDeposited, the single-asset
attribution, and the specific metadata field used to derive that asset so
readers understand the assumption.
- Around line 37-44: The current handling of product.assets silently undercounts
TVL by assigning the entire totalDeposited to product.assets[0] and dropping TVL
when product.assets is empty; update the logic in the block that uses
product.assets, primaryAsset, api.add, getAddress and totalDeposited to (1) if
product.assets exists and has length>0, distribute totalDeposited across all
assets (e.g., perAsset = totalDeposited / product.assets.length) and loop over
product.assets calling api.add(getAddress(asset.address), perAsset) for each
asset, and (2) if product.assets is missing or empty, fallback to a
deterministic asset (e.g., product.ticker or a configured default like USDT) and
call api.add(getAddress(fallbackAddress), totalDeposited) while emitting a
warning/log to surface the fallback so under-reporting is visible.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9fca7671-037d-40ae-8819-97e357cc3f6e

📥 Commits

Reviewing files that changed from the base of the PR and between 456fc8d and 5891157.

📒 Files selected for processing (1)
  • projects/lista-rwa/index.js

Comment on lines +37 to +44
// Dowsure vaults support multiple assets, use the assets from API response
if (product.assets && product.assets.length > 0) {
// For multi-asset vaults, distribute TVL across supported assets
// Using totalDeposited as the TVL (in USD terms from the vault)
// Default to USDT as the primary asset
const primaryAsset = product.assets[0].address
api.add(getAddress(primaryAsset), totalDeposited)
}
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.

⚠️ Potential issue | 🟠 Major

Multi-asset handling is currently incomplete and can silently undercount.

Two issues here:

  1. Line 42 maps all TVL to product.assets[0], so multi-asset vault composition is not actually represented.
  2. If product.assets is missing/empty, TVL is dropped silently (no fallback/error), causing hidden under-reporting.
💡 Proposed hardening diff
-      // Dowsure vaults support multiple assets, use the assets from API response
-      if (product.assets && product.assets.length > 0) {
-        // For multi-asset vaults, distribute TVL across supported assets
-        // Using totalDeposited as the TVL (in USD terms from the vault)
-        // Default to USDT as the primary asset
-        const primaryAsset = product.assets[0].address
-        api.add(getAddress(primaryAsset), totalDeposited)
-      }
+      if (!product.assets?.length) {
+        throw new Error(`Missing assets metadata for Dowsure product: ${product.contract}`)
+      }
+
+      // NOTE: current API only provides aggregate `totalDeposited`, not per-asset split.
+      // Until per-asset balances are available, attribute to a canonical asset deterministically.
+      const canonicalAsset = getAddress(product.assets[0].address)
+      api.add(canonicalAsset, totalDeposited)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@projects/lista-rwa/index.js` around lines 37 - 44, The current handling of
product.assets silently undercounts TVL by assigning the entire totalDeposited
to product.assets[0] and dropping TVL when product.assets is empty; update the
logic in the block that uses product.assets, primaryAsset, api.add, getAddress
and totalDeposited to (1) if product.assets exists and has length>0, distribute
totalDeposited across all assets (e.g., perAsset = totalDeposited /
product.assets.length) and loop over product.assets calling
api.add(getAddress(asset.address), perAsset) for each asset, and (2) if
product.assets is missing or empty, fallback to a deterministic asset (e.g.,
product.ticker or a configured default like USDT) and call
api.add(getAddress(fallbackAddress), totalDeposited) while emitting a
warning/log to surface the fallback so under-reporting is visible.


module.exports = {
methodology: "TVL is calculated by summing the totalAssets of all RWA products",
methodology: "TVL is calculated by summing the totalAssets of Centrifuge RWA products and totalDeposited from Dowsure vault products",
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.

⚠️ Potential issue | 🟡 Minor

Methodology should explicitly document the Dowsure asset attribution assumption.

Current text says Dowsure totalDeposited is summed, but implementation attributes it to a single asset from metadata (Line 42). Please reflect that assumption to avoid interpretability drift.

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

In `@projects/lista-rwa/index.js` at line 50, Update the methodology string to
explicitly state the Dowsure attribution assumption: note that while TVL sums
Dowsure's totalDeposited, this amount is attributed to a single asset selected
from the product metadata (the metadata field used to pick the asset should be
named), so modify the methodology property to mention Dowsure, totalDeposited,
the single-asset attribution, and the specific metadata field used to derive
that asset so readers understand the assumption.

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