feat: add Dowsure vault TVL support to lista-rwa adapter#18672
feat: add Dowsure vault TVL support to lista-rwa adapter#18672tyler-tsai wants to merge 1 commit intoDefiLlama:mainfrom
Conversation
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
📝 WalkthroughWalkthroughThe RWA TVL computation in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
The adapter at projects/lista-rwa exports TVL: |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
projects/lista-rwa/index.js
| // 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) | ||
| } |
There was a problem hiding this comment.
Multi-asset handling is currently incomplete and can silently undercount.
Two issues here:
- Line 42 maps all TVL to
product.assets[0], so multi-asset vault composition is not actually represented. - If
product.assetsis 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", |
There was a problem hiding this comment.
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.
Added support for Dowsure vault products alongside existing Centrifuge products in the lista-rwa adapter.
Changes:
Dowsure Vault Contract: 0x3a81b9d9ddcc80ef0ebeb462ddf40c73d48e0619
Current TVL: ~$320k in USDT/USDC
NOTE
Please enable "Allow edits by maintainers" while putting up the PR.
If you would like to add a
volume/fees/revenueadapter please submit the PR here.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.
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.
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
Please do not add new npm dependencies, do not edit/push
pnpm-lock.yamlfile 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
Documentation