Sub-accounts
Introduction
Sub-accounts are a powerful feature in Euler that allows users to create multiple isolated positions within a single wallet address. This innovative approach to account management provides users with the flexibility to manage different strategies and risk profiles while maintaining the convenience of using a single wallet.
Understanding Sub-accounts
While each wallet address on Euler is limited to one outstanding liability at any given time, the Ethereum Vault Connector (EVC) provides each wallet with 256 virtual account addresses known as sub-accounts. These virtual addresses enable users to establish multiple risk-isolated positions in a gas-efficient manner across segregated accounts.
The sub-account system solves a significant usability challenge in DeFi. Without sub-accounts, users would need to create and manage multiple wallet addresses to achieve the same level of position isolation. This would require:
- Maintaining ETH balances in each address for gas fees
- Setting up token approvals for each address
- Managing multiple wallet connections in the user interface
- Handling the operational complexity of switching between addresses
Benefits of Sub-accounts
Risk Management: Sub-accounts allow users to isolate different trading strategies or positions, preventing one position's risk from affecting others.
Gas Efficiency: By using sub-accounts instead of multiple wallet addresses, users can save significant gas costs. There's no need to transfer ETH between addresses or set up multiple approvals.
Operational Simplicity: Users can manage all their positions through a single wallet interface, making it easier to track and manage their overall portfolio.
Flexible Position Management: Sub-accounts enable users to easily rebalance collateral and liabilities between positions without requiring additional approvals or complex transactions.
Important Considerations
Internal Addresses: It's crucial to understand that sub-account addresses are internal to the EVC and compatible vaults. These addresses should never be used for regular ERC20 token transfers or other external contract interactions.
Position Isolation: While sub-accounts provide position isolation, users should still be mindful of their overall risk exposure across all sub-accounts, as they are all ultimately controlled by the same wallet.
Gas Optimization: When using multiple sub-accounts, consider the gas implications of operations that affect multiple positions. The EVC's batching functionality can help optimize gas costs for such operations.