Conversation
Three ERC4626 vaults on Ethereum mainnet: - ZenSats (WBTC) — 0x617A6877f0a55D1eF2B64b5861A2bB5Fe6FEB739 - ZenETH (wstETH) — 0xbaEc8343B610A5ee7Ca2c5b93507AC7def98E2B1 - ZenGold (XAUT) — 0x7d5281D590Fb0647aDc7d8494a2c8Fb8C2B23cBD TVL = total collateral value in each ERC4626 vault.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdded a new DefiLlama TVL adapter for ZenSats that configures Ethereum ERC‑4626 vault addresses, exposes a Changes
Sequence DiagramsequenceDiagram
participant Client as External Caller
participant Adapter as ZenSats Adapter
participant API as DefiLlama API
participant Blockchain as ERC4626 Vaults
Client->>Adapter: call ethereum.tvl(api)
Adapter->>API: erc4626Sum2({ calls: vault_addresses })
API->>Blockchain: query ERC4626 vault states/balances
Blockchain-->>API: return vault balances
API-->>Adapter: return aggregated TVL
Adapter-->>Client: return TVL result
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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/zensats exports TVL: |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
projects/zensats/index.js (2)
14-15: Clarify methodology to reflect net asset calculation.The methodology states "total value of collateral assets deposited" but according to the PR description, TVL includes "collateral held in Aave net of outstanding debt." The current wording might mislead users into thinking this is gross collateral rather than net of borrowed USDT.
Consider revising to be more precise:
📝 Suggested improvement for clarity
-module.exports.methodology = - "TVL is the total value of collateral assets deposited in ZenSats ERC4626 vaults."; +module.exports.methodology = + "TVL represents the net asset value of ZenSats ERC4626 vaults (WBTC, wstETH, XAUT), calculated as total collateral (including assets deployed to Aave and Curve strategies) minus outstanding debt.";🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@projects/zensats/index.js` around lines 14 - 15, Update the module.exports.methodology string to explicitly state that TVL is the net value of assets (collateral held in Aave via ZenSats ERC4626 vaults minus outstanding debt such as borrowed USDT) rather than the gross collateral; change the text in module.exports.methodology to mention "net of outstanding debt" and give a concise example (e.g., collateral in Aave net of borrowed USDT) so readers understand the subtraction applied to compute TVL.
17-23: Consider whether aborrowedexport should be added for transparency.According to the PR description, these vaults borrow USDT on Aave as part of their carry trade strategy. While ERC4626's
totalAssets()should already return the net asset value (collateral minus debt), DefiLlama typically tracks borrowed amounts separately using theborrowedexport for transparency and to provide users with a complete picture of protocol leverage.If the vaults have significant borrowed positions, consider adding a
borrowedexport to track outstanding USDT debt separately.💡 Example of adding borrowed export
// If USDT debt is significant and should be tracked separately: Object.keys(config).forEach((chain) => { module.exports[chain] = { tvl: async (api) => { return api.erc4626Sum2({ calls: config[chain].vaults }); }, borrowed: async (api) => { // Track USDT borrowed from Aave by the vaults // This would require querying Aave for each vault's debt position }, }; });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@projects/zensats/index.js` around lines 17 - 23, Add a borrowed export alongside the existing tvl to report outstanding USDT debt for transparency: update the module.exports[chain] object (where tvl uses api.erc4626Sum2 and reads config[chain].vaults) to include a borrowed: async (api) => { … } function that, for each vault in config[chain].vaults, queries Aave for the vault's debt position (e.g., by calling Aave's lending pool / debtToken or using api.call to read the vault's borrowed balance of the USDT token) sums those USDT borrow amounts across all vaults and returns the aggregated amount keyed by the USDT token address for that chain; ensure you reference config[chain].vaults, the USDT token address for the chain, and use the same api instance passed into tvl to perform the on-chain reads.
🤖 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/zensats/index.js`:
- Around line 14-15: Update the module.exports.methodology string to explicitly
state that TVL is the net value of assets (collateral held in Aave via ZenSats
ERC4626 vaults minus outstanding debt such as borrowed USDT) rather than the
gross collateral; change the text in module.exports.methodology to mention "net
of outstanding debt" and give a concise example (e.g., collateral in Aave net of
borrowed USDT) so readers understand the subtraction applied to compute TVL.
- Around line 17-23: Add a borrowed export alongside the existing tvl to report
outstanding USDT debt for transparency: update the module.exports[chain] object
(where tvl uses api.erc4626Sum2 and reads config[chain].vaults) to include a
borrowed: async (api) => { … } function that, for each vault in
config[chain].vaults, queries Aave for the vault's debt position (e.g., by
calling Aave's lending pool / debtToken or using api.call to read the vault's
borrowed balance of the USDT token) sums those USDT borrow amounts across all
vaults and returns the aggregated amount keyed by the USDT token address for
that chain; ensure you reference config[chain].vaults, the USDT token address
for the chain, and use the same api instance passed into tvl to perform the
on-chain reads.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2e5bfd98-490c-4554-ab9a-79304e5a41d8
⛔ Files ignored due to path filters (1)
projects/zensats/logo.pngis excluded by!**/*.png
📒 Files selected for processing (1)
projects/zensats/index.js
|
The adapter at projects/zensats exports TVL: |
Three ERC4626 vaults on Ethereum mainnet:
TVL = total collateral value in each ERC4626 vault.
Name (to be shown on DefiLlama): ZenSats
Twitter Link: @capitalisnn
List of audit links if any:
Website Link: https://zensats.app
Logo (High resolution, will be shown with rounded borders): Included in PR at projects/zensats/logo.png
Current TVL: $10,689.78 in WBTC, $1,145.56 in wstETH, and $49.85 in XAUT
Treasury Addresses (if the protocol has treasury): N/A
Chain: Ethereum
Coingecko ID:
Coinmarketcap ID:
Short Description (to be shown on DefiLlama): Collateral yield vaults — deposit WBTC, wstETH, or XAUT and earn yield from a USDT borrow-and-deploy carry trade via Aave and Curve/Stake DAO.
Token address and ticker if any: N/A
Category: Yield
Oracle Provider(s): Chainlink
Implementation Details: Chainlink price feeds (BTC/USD, ETH/USD, USDT/USD, crvUSD/USD, stETH/ETH) are used in the Aave loan manager for collateral and debt valuation, health factor checks, and swap slippage validation.
Documentation/Proof: https://zensats.app/docs
forkedFrom: N/A
methodology: TVL is the total collateral value locked across ZenSats' ERC4626 vaults (WBTC, wstETH, XAUT), including collateral held in Aave net of outstanding debt, valued in USD via Chainlink.
Github org/user: NateBrune
Does this project have a referral program? No
Summary by CodeRabbit