- API Overview
- Smart Contract Interaction
- Integration Examples
- Webhook Setup
- Testing Checklist
- Deployment Guidance
- Support
All Aura Vault instances are deployed as Soroban smart contracts on the Stellar network:
- Testnet: Contract ID provided after deployment
- Mainnet: Contract ID provided after mainnet deployment
| Function | Parameters | Returns | Auth Required |
|---|---|---|---|
initialize |
admin: Address, underlying_token: Address |
Result<(), VaultError> |
Admin |
deposit |
caller: Address, amount: i128 |
Result<i128, VaultError> (shares minted) |
Yes |
withdraw |
caller: Address, shares: i128 |
Result<i128, VaultError> (tokens redeemed) |
Yes |
harvest |
caller: Address, yield_amount: i128 |
Result<(), VaultError> |
Yes |
total_assets |
- | i128 (total underlying tokens) |
No |
balance_of |
address: Address |
i128 (share balance) |
No |
upgrade |
new_wasm_hash: BytesN<32> |
Result<(), VaultError> |
Admin only |
version |
- | u32 |
No |
| Code | Variant | Meaning |
|---|---|---|
| 1 | NotInitialized |
Vault not yet initialized |
| 2 | AlreadyInitialized |
Initialize called more than once |
| 3 | InsufficientShares |
Withdrawal amount exceeds caller's share balance |
| 4 | InsufficientUnderlying |
Vault cannot cover redemption |
| 5 | ZeroAmount |
Zero or negative input |
| 6 | MathOverflow |
Arithmetic overflow in calculations |
| 7 | InvalidAddress |
Reserved for future address validation |
| 8 | ZeroShares |
Harvest called when total shares is zero |
| 9 | UpgradeUnauthorized |
Caller is not the admin |
| 10 | StorageLayoutMismatch |
On-chain layout version mismatch |
- Stellar account with test/main net funds
- Soroban CLI installed:
stellar contract - SEP-41 token contract address
- Aura Vault contract ID (after deployment)
Initialize the vault once with admin and underlying token:
stellar contract invoke \
--id <CONTRACT_ID> \
--source <ADMIN_KEYPAIR> \
--network testnet \
-- initialize \
--admin <ADMIN_ADDRESS> \
--underlying_token <TOKEN_CONTRACT_ID>Deposit underlying tokens and receive shares:
stellar contract invoke \
--id <CONTRACT_ID> \
--source <USER_KEYPAIR> \
--network testnet \
-- deposit \
--caller <USER_ADDRESS> \
--amount 1000000Response: Returns number of shares minted (i128)
Burn shares to redeem underlying tokens:
stellar contract invoke \
--id <CONTRACT_ID> \
--source <USER_KEYPAIR> \
--network testnet \
-- withdraw \
--caller <USER_ADDRESS> \
--shares 500000Response: Returns underlying tokens redeemed (i128)
Inject yield tokens (increases exchange rate for all shareholders):
stellar contract invoke \
--id <CONTRACT_ID> \
--source <KEEPER_KEYPAIR> \
--network testnet \
-- harvest \
--caller <KEEPER_ADDRESS> \
--yield_amount 100000Query total underlying tokens in vault (gas-free):
stellar contract invoke \
--id <CONTRACT_ID> \
--network testnet \
-- total_assetsResponse: i128 total underlying tokens
Query vault shares for any address (gas-free):
stellar contract invoke \
--id <CONTRACT_ID> \
--network testnet \
-- balance_of \
--address <USER_ADDRESS>Response: i128 share balance
See separate files:
See Deployment Steps
Documentation: https://github.com/aura-vault/aura-vault-protocol Issues: Report bugs at https://github.com/aura-vault/aura-vault-protocol/issues Discord: (to be added) Email: support@aura-vault.dev
Solution: Call initialize with admin and token address before any operations
Solution: Ensure user has deposited tokens first; check balance_of before withdrawing
Solution: Amounts too large; use smaller increments or check vault capacity
Solution: Cannot harvest when total shares = 0; ensure at least one deposit exists
- Authentication: All mutating functions require
require_auth()from caller - Token Transfers: Vault uses SEP-41 token contract for deposits/withdrawals
- Share Exchange Rate: Calculated as
shares × total_assets ÷ total_shares - TTL Management: All mutating calls auto-extend archival TTL (30-day lifetime)
- Atomic Operations: Checks-Effects-Interactions ordering prevents reentrancy