Skip to content

Add ZenSats TVL adapter#18604

Open
NateBrune wants to merge 2 commits intoDefiLlama:mainfrom
NateBrune:main
Open

Add ZenSats TVL adapter#18604
NateBrune wants to merge 2 commits intoDefiLlama:mainfrom
NateBrune:main

Conversation

@NateBrune
Copy link
Copy Markdown

@NateBrune NateBrune commented Apr 1, 2026

Three ERC4626 vaults on Ethereum mainnet:

  • ZenSats (WBTC) — 0x617A6877f0a55D1eF2B64b5861A2bB5Fe6FEB739
  • ZenETH (wstETH) — 0xbaEc8343B610A5ee7Ca2c5b93507AC7def98E2B1
  • ZenGold (XAUT) — 0x7d5281D590Fb0647aDc7d8494a2c8Fb8C2B23cBD

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

  • New Features
    • ZenSats ERC4626 vaults on Ethereum are now supported with automated TVL tracking. The integration reports TVL as the net value of collateral held across ZenSats vaults, enabling users to monitor vault balances and performance on the Ethereum blockchain.

Three ERC4626 vaults on Ethereum mainnet:
- ZenSats (WBTC) — 0x617A6877f0a55D1eF2B64b5861A2bB5Fe6FEB739
- ZenETH (wstETH) — 0xbaEc8343B610A5ee7Ca2c5b93507AC7def98E2B1
- ZenGold (XAUT)  — 0x7d5281D590Fb0647aDc7d8494a2c8Fb8C2B23cBD

TVL = total collateral value in each ERC4626 vault.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 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: 258d31b7-e520-4150-ab2d-822d3367fe59

📥 Commits

Reviewing files that changed from the base of the PR and between 38c53db and 6ea9e0e.

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

📝 Walkthrough

Walkthrough

Added a new DefiLlama TVL adapter for ZenSats that configures Ethereum ERC‑4626 vault addresses, exposes a methodology string, and provides an ethereum.tvl(api) function that returns api.erc4626Sum2 over the configured vault list.

Changes

Cohort / File(s) Summary
ZenSats TVL Adapter
projects/zensats/index.js
New adapter file adding methodology and an ethereum.tvl(api) async function that calls api.erc4626Sum2({ calls: [<vault_addresses>] }) to compute TVL.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped to count the sats today,
Vaults and ledgers on my way,
ERC‑4626 sums so neat,
ZenSats balances, soft and sweet,
A tiny hop, TVL complete! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and concisely summarizes the primary change: adding a TVL adapter for the ZenSats protocol.
Description check ✅ Passed The PR description is comprehensive and well-structured, filling in most required template fields with specific details about the ZenSats protocol, vault addresses, methodology, and metadata.
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
Copy Markdown

The adapter at projects/zensats exports TVL:

ethereum                  11.87 k

total                    11.87 k 

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.

🧹 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 a borrowed export 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 the borrowed export for transparency and to provide users with a complete picture of protocol leverage.

If the vaults have significant borrowed positions, consider adding a borrowed export 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

📥 Commits

Reviewing files that changed from the base of the PR and between 4b09a5d and 38c53db.

⛔ Files ignored due to path filters (1)
  • projects/zensats/logo.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • projects/zensats/index.js

@llamabutler
Copy link
Copy Markdown

The adapter at projects/zensats exports TVL:

ethereum                  11.91 k

total                    11.91 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.

2 participants