Skip to content

[Feature] TVL/APY displays can go stale indefinitely with no accrual keeper #466

Description

@collinsezedike

Summary

accrue() on blend-adapter is permissionless and documented as needing to be called "by the vault or a keeper" before any pricing-relevant read, but nothing in the repo ever calls it outside contract/test/docs code — no scheduled job, cron, or backend service. fetchTestnetVaults() (used for the dashboard's TVL and for recommendedVaultId) reads get_total_assets via a read-only RPC simulation, which never submits a transaction, so it can never itself trigger a persisted accrual. Only a real submitted transaction can update the cached total on-chain.

Motivation

This is distinct from #418 (which fixes deposit/withdraw-time pricing by refreshing inside a real submitted transaction): TVL and APY shown on the dashboard for a quiet Blend-backed vault can go stale indefinitely even after #418 lands, because the dashboard's read path is a simulation, not a submitted transaction. DeFindex-backed vaults aren't affected since total_assets() is computed live there, but any Blend-backed vault with no recent deposit/withdraw activity will show an increasingly wrong TVL/APY to users just browsing the dashboard.

Proposed Solution

Stand up a scheduled keeper that periodically submits a real accrue() transaction for each live Blend-backed adapter. This needs: a funded Stellar signing key with nonce/sequence-number management (submitting accrue() costs fees even though the call itself needs no auth), a way to discover which live adapters are Blend-backed vs DeFindex-backed (only Blend needs accrual), a sensible accrual interval, and monitoring/alerting if an accrual transaction fails so stale pricing doesn't go unnoticed.

Scope

Field Value
Area API / Contracts / CI
Protocol affected Blend
Network testnet
Breaking change? No (new operational service, no ABI change)

Alternatives Considered

Relying on deposit/withdraw activity to keep accrue() fresh incidentally: this is the current de facto behavior, but it means TVL/APY accuracy for quiet vaults depends entirely on other users' unrelated activity, which isn't a real guarantee.

Acceptance Criteria

  • A scheduled process periodically submits accrue() for each live Blend-backed adapter
  • Adapter discovery correctly distinguishes Blend-backed (needs accrual) from DeFindex-backed (doesn't) vaults
  • Signing key and sequence-number handling documented, with the key scoped to only what accrue() submission needs
  • Failure to submit an accrual transaction is observable (logged/alerted), not silent
  • Documented expected max staleness window for TVL/APY under normal operation

Metadata

Metadata

Assignees

Labels

contractsInvolves writing or testing Rust/Soroban contracts in packages/contractsenhancementNew feature or requesthardComplex implementation spanning multiple packages or involving Soroban contractssorobanInvolves Soroban smart contract invocations or Soroban RPC calls

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions