What is the EVC?
The Ethereum Vault Connector (EVC) is Mewler’s system for enabling advanced transaction patterns. It allows you to:- Execute multiple operations atomically
- Use sub-accounts for position isolation
- Delegate permissions to operators
- Temporarily violate limits (with deferred checks)
Batching Operations
The EVC allows you to combine multiple operations into a single atomic transaction. This is useful for:- Opening leveraged positions
- Repaying debt and withdrawing collateral in one step
- Complex DeFi strategies requiring multiple steps
Example: Opening a Leveraged Position
Without EVC, you’d need multiple transactions:- Deposit collateral
- Borrow asset
- Swap borrowed asset for more collateral
- Deposit new collateral
Sub-Accounts
Each wallet address can have up to 256 sub-accounts. Sub-accounts are virtual accounts identified by a sub-account ID (0-255).Use Cases
Position Isolation: Separate trading strategies or risk profiles:Sub-Account Addressing
Sub-accounts are addressed using the format:0x123...abc:0- Main account0x123...abc:1- Sub-account 10x123...abc:42- Sub-account 42
Operators
Operators are addresses you trust to execute transactions on your behalf. This enables:- Automated strategies
- Bot trading
- DeFi protocol integrations
- Smart contract automation
Setting an Operator
You can grant operator permissions to:- Specific addresses
- Smart contracts
- Your own contracts for automation
Deferred Checks
The EVC implements deferred checks, which allow operations to temporarily violate limits as long as the final state is valid.How It Works
- Start Transaction: Begin a batch of operations
- Intermediate States: Some operations might temporarily violate limits (e.g., health score drops below 1.0)
- Final State: All limits must be satisfied at the end
- Atomic Execution: Either all operations succeed or all fail
Example
You want to:- Withdraw collateral (would make health score < 1.0)
- Repay debt (brings health score back > 1.0)
EVC Functions
Batch Operations
Sub-Account Operations
Operations can specify a sub-account ID to target a specific sub-account.Operator Delegation
Best Practices
Batching
- Group related operations together
- Consider gas costs (batching can save gas)
- Ensure final state is always valid
Sub-Accounts
- Use sub-accounts to isolate different strategies
- Don’t create more sub-accounts than necessary
- Document which sub-account is for what purpose
Operators
- Only grant permissions to trusted addresses
- Regularly review and revoke unused operators
- Use time-limited permissions when possible