Repository navigation
ARC-4626: Tokenized Vault Standard #119
hwdeboer1977
started this conversation in
ARCs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
arc: 4626
title: Tokenized Vault Standard
authors: @hwdeboer1977
discussion: https://github.com/ProvableHQ/ARCs/discussions/XXX
topic: Application
status: Draft
created: 2025-18-05
Abstract
This ARC proposes a standard for tokenized yield-bearing vaults on Aleo, adapted from Ethereum's ERC-4626. It defines a minimal interface for depositing assets, minting shares, and redeeming shares for underlying assets. The implementation uses OpenZeppelin's virtual shares mechanism to prevent inflation attacks.
Motivation
Yield-bearing vaults are fundamental DeFi primitives that enable:
The Ethereum ecosystem demonstrated the value of ERC-4626 standardization - before it, every vault (Yearn, Compound, Aave) had different interfaces, creating integration friction. A standard vault interface for Aleo will accelerate DeFi development.
Why Aleo?
Aleo's programmable privacy enables vaults with:
Specification
Terminology
totalAssets / totalShares- increases as yield accruesVirtual Shares Mechanism
To prevent inflation attacks (where the first depositor manipulates share price), the vault uses OpenZeppelin's virtual shares formula:
Mappings
total_assetsu8(0u8)u128total_sharesu8(0u8)u128share_balancesaddressu128Transitions
Core Functions
depositamount: u128redeemshares: u128, assets: u128Admin Functions
add_yieldamount: u128Interface
View Functions (Off-chain)
Query vault state via RPC:
Share Price Calculation
Initial price is ~1.0. Price increases as yield is added.
Example Flow
Rationale
Why Virtual Shares?
Without virtual shares, the first depositor could:
Virtual shares add "phantom liquidity" that prevents this attack.
Why u128?
Aleo's u128 provides 38 decimal digits of precision, sufficient for:
Why Public Mappings?
Share balances could be private records, but public mappings:
Future versions may add private share records for privacy-preserving deposits.
Backwards Compatibility
This is a new standard with no backwards compatibility concerns.
Test Cases
Deployment Script
Reference Implementation
Security Considerations
redeemrequires expected assets parameter as slippage protectionadd_yieldcurrently has no access control - production implementations should add admin verificationDependencies
transfer_from(ERC-20 style)References
Copyright
This ARC is licensed under MIT.
All reactions