Creating a DeFindex Vault
Last updated
Last updated
Webapp:
Before creating a vault, you'll need to establish the following key roles with their respective addresses:
Vault Manager
Primary owner of the vault
Controls vault settings and role assignments
Manages contract upgrades (if enabled)
Recommended: Use a multisig wallet for enhanced security
Rebalance Manager
Responsible for fund allocation between strategies
Optimizes strategy distribution
Recommended: Implement as an automated bot
Fee Receiver
Designated address for collecting strategy performance fees
Should be a secure, dedicated wallet
Emergency Manager
Handles emergency fund recovery from strategies
Critical for risk management
Recommended: Implement as an automated bot
Any address with XLM can deploy the vault
No multisig required for deployment
Recommended: Use a fresh address for deployment
Choose from our curated and audited strategies:
Blend Fixed Pool Strategies (with Autocompound)
USDC
EURC
XLM
Blend Yieldblox Pool Strategies (with Autocompound)
USDC
EURC
XLM
Recommended configuration: One asset with two strategies
This provides optimal balance between yield and risk management
Required: Initial deposit of 1001 stroops of the chosen underlying asset
Purpose: Security verification
Timing: Complete before user implementation
This ensures the vault is properly initialized and secure
Set up all role addresses
Deploy vault
Select strategies
Make initial security deposit
Begin user implementation
This structured approach ensures a secure and efficient vault creation process while maintaining best practices for DeFi operations.
vault_usage_example.ts
)You can interact with your DeFindex Vault directly from the command line using the provided example script: Contracts/src/vault_usage_example.ts
. This script demonstrates how to perform key vault operations such as deposit, withdraw, invest, unwind, and harvest.
Node.js and yarn installed
All dependencies installed (yarn install
in the project root)
Properly configured environment (setup a .env
file, see Contracts/src/utils/env_config.js
for user/secret setup)
The vault and strategy contracts deployed and addresses set in your address book
Navigate to the Contracts directory:
Edit the script if needed:
Uncomment the function call(s) you want to run at the bottom of src/vault_usage_example.ts
(e.g., await deposit();
).
Run the script:
Replace <network>
with your target network (e.g., testnet
, mainnet
, or your custom config).
Deposit: Deposits assets into the vault for the configured user.
Withdraw: Withdraws assets from the vault for the configured user.
Invest: Allocates vault funds into a strategy (admin only).
Unwind: Withdraws funds from a strategy back to the vault (admin only).
Harvest: Triggers a strategy harvest (keeper only).
Note: Only uncomment and run one operation at a time to avoid transaction conflicts. Make sure your environment variables and address book are set up for the network you are targeting.
For more details, review the comments and code in vault_usage_example.ts
.