Skip to main content

Creating a Vault

This guide walks you through creating new Lido Staking Vaults using the CLI. Staking Vaults are isolated smart contracts that enable customized staking configurations with role-based access control.

Overview

Vault creation deploys two main contracts:

  • StakingVault: Core vault contract
  • Dashboard: Management interface providing metrics, minting/burning, administrative functions etc

Basic Vault Creation

Create Connected Vault

Creates a vault and automatically connects it to the VaultHub:

yarn start vo w create-vault create

Create Standalone Vault

Creates a vault without VaultHub connection:

yarn start vo w create-vault create-without-connecting

Command Reference

Arguments

ArgumentDescriptionDefault
[quantity]Number of vaults to create1

Required Options

OptionDescriptionExample
-da, --defaultAdmin <address>Default admin address0x123...
-no, --nodeOperator <address>Node operator address0x456...
-nom, --nodeOperatorManager <address>Node operator manager address0x789...

Configuration Options

OptionDescriptionRange/Format
-ce, --confirmExpiry <number>Confirmation expiry time in secondsMin-Max range enforced
-nof, --nodeOperatorFeeRate <number>Node operator fee rate100 = 1%

Advanced Options

OptionDescriptionFormat
-r, --roles <json>Additional role assignmentsJSON array

Role Assignment Format

When using the -r, --roles option, provide a JSON array of role assignments:

[
{
"account": "0x1234567890123456789012345678901234567890",
"role": "0x0000000000000000000000000000000000000000000000000000000000000000"
},
{
"account": "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd",
"role": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
}
]

Common Role Constants

RoleDescriptionHex Value
DEFAULT_ADMIN_ROLEAdministrative control0x00...00
FUND_ROLECan add ETH to vaultContract-specific
WITHDRAW_ROLECan withdraw ETHContract-specific
MINT_ROLECan mint stETH tokensContract-specific
BURN_ROLECan burn stETH tokensContract-specific

Step-by-Step Example

1. Prepare Addresses

Before creating a vault, ensure you have:

# Check your account
yarn start account r info

# Verify you have sufficient ETH for gas
# Typical gas cost: 0.01-0.05 ETH

2. Create Basic Vault

yarn start vo w create-vault create \
--defaultAdmin 0x1234567890123456789012345678901234567890 \
--nodeOperator 0xabcdefabcdefabcdefabcdefabcdefabcdefabcd \
--nodeOperatorManager 0x9876543210987654321098765432109876543210 \
--confirmExpiry 3600 \
--nodeOperatorFeeRate 100

or interactive way

yarn start vo w create-vault create

3. Create Multiple Vaults

yarn start vo w create-vault create 3 \
--defaultAdmin 0x1234567890123456789012345678901234567890 \
--nodeOperator 0xabcdefabcdefabcdefabcdefabcdefabcdefabcd \
--nodeOperatorManager 0x9876543210987654321098765432109876543210 \
--confirmExpiry 3600 \
--nodeOperatorFeeRate 500

4. Create Vault with Custom Roles

yarn start vo w create-vault create \
--defaultAdmin 0x1234567890123456789012345678901234567890 \
--nodeOperator 0xabcdefabcdefabcdefabcdefabcdefabcdefabcd \
--nodeOperatorManager 0x9876543210987654321098765432109876543210 \
--confirmExpiry 3600 \
--nodeOperatorFeeRate 500 \
--roles '[{
"account": "0xfeedbeeffeedbeeffeedbeeffeedbeeffeedbeef",
"role": "0x0000000000000000000000000000000000000000000000000000000000000000"
}]'

Return Values

After successful creation, the CLI returns:

Vault Address: 0x1234567890123456789012345678901234567890
Dashboard Address: 0xabcdefabcdefabcdefabcdefabcdefabcdefabcd
Owner Address: 0x9876543210987654321098765432109876543210
Transaction Hash: 0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321
Block Number: 18500000

Configuration Parameters

Default Admin

  • Purpose: Ultimate administrative control over the vault
  • Responsibilities: Can grant/revoke roles, change critical parameters

Node Operator

  • Purpose: Manages validator operations and deposits
  • Responsibilities: Can perform predeposits, validator proving, deposits

Node Operator Manager

  • Purpose: Manages node operator permissions and settings
  • Responsibilities: Can update node operator configurations
  • Use Case: Often same as node operator or delegated manager

Confirm Expiry

  • Purpose: Time limit for confirming transactions
  • Range: Enforced minimum and maximum values
  • Security: Prevents indefinite pending operations

Node Operator Fee Rate

  • Purpose: Percentage of rewards allocated to node operator
  • Format: Basis points (100 = 1%)
  • Range: Typically 0-1000 (0-10%)

Security Considerations

Address Verification

  • Double-check all addresses before deployment
  • Verify control of provided addresses

Role Assignment

  • Principle of least privilege: Only assign necessary roles

Troubleshooting

Common Issues

Insufficient Gas

# Check account balance
yarn start account r info

# Ensure sufficient ETH for deployment

Invalid Address Format

# Verify address format (0x + 40 hex characters)
# Use address validation tools

Role Assignment Errors

# Validate JSON format
# Check role constant values
# Verify account addresses in role assignments

Network Connectivity

# Test RPC endpoint
# Verify CHAIN_ID configuration
# Check for rate limiting

Failed Deployment Recovery

If deployment fails:

  1. Check transaction status using the provided hash
  2. Verify gas limit wasn't exceeded
  3. Review error messages for specific issues
  4. Retry with adjusted parameters if needed

Post-Creation Verification

After creation, verify the vault:

# Check vault info
yarn start vo r info

# Verify roles
yarn start vo r roles

# Test basic operations
yarn start vo r health