Problem
External protocols and the frontend analytics module have no direct, on-chain way to query the Total Value Locked (TVL) without manually checking the underlying token balance of the contract address.
Expected behavior
A get_tvl read-only function is implemented that queries the underlying token client and returns the exact base asset balance held by the Vault.
Files to update
Project relevance
This establishes a standard API for composability, allowing other DeFi primitives and the SDK's AnalyticsModule to securely fetch the Vault's liquidity depth.
Acceptance criteria
Problem
External protocols and the frontend analytics module have no direct, on-chain way to query the Total Value Locked (TVL) without manually checking the underlying token balance of the contract address.
Expected behavior
A
get_tvlread-only function is implemented that queries the underlying token client and returns the exact base asset balance held by the Vault.Files to update
src/vault.rssrc/lib.rsProject relevance
This establishes a standard API for composability, allowing other DeFi primitives and the SDK's
AnalyticsModuleto securely fetch the Vault's liquidity depth.Acceptance criteria
token::Clientand returns the contract's balance