Deposit ETH
This page shows how to deposit ETH into an existing cluster on SSV Network with the SSV SDK.
Depositing ETH increases the cluster balance used to cover ongoing validator operating costs.
Prerequisites
Before integrating this example, make sure you have:
- An existing cluster
- The cluster owner address
- The cluster operator IDs
- The amount of ETH to deposit
- The SDK initialized with a
walletClient
Deposit ETH
Use sdk.clusters.deposit to deposit ETH into a cluster identified by its cluster ID.
import { createClusterId } from '@ssv-labs/ssv-sdk/utils'import { parseEther } from 'viem'
try { const ownerAddress = "0xA4831B989972605A62141a667578d742927Cbef9" const operatorIds = [1, 2, 3, 4] const clusterId = createClusterId(ownerAddress, operatorIds)
const txnReceipt = await sdk.clusters.deposit({ args: { id: clusterId, amount: parseEther('0.1234'), }, }, ).then(tx => tx.wait());
console.log('Transaction receipt:', txnReceipt);} catch (error) { console.error('Failed to deposit ETH:', error);}