Skip to content

🎁 [Feature Request]: FungibleVault: support for overridable total_assets in conversion functions #674

@Robeartt

Description

@Robeartt

What is the feature you would like to see?

The FungibleVault trait exposes total_assets as overridable, but the internal conversion functions (convert_to_shares_with_rounding, convert_to_assets_with_rounding) call Self::total_assets(e) directly on the Vault struct. Any custom total_assets on the trait is ignored by the conversion math that deposit, mint, withdraw, and redeem all depend on.

Since Vault::total_assets is hardcoded to the contract's on-chain token balance, it's impossible to build yield-bearing vaults that deploy assets into external protocols (e.g. Blend). Share pricing will only reflect assets sitting idle in the contract, not the total managed position.

On Ethereum's ERC-4626, overriding totalAssets() flows through to all conversion logic, enabling strategy/debt-accounting patterns (e.g. Yearn). The Stellar vault currently lacks this capability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions