Skip to main content

Quick Guide to Fund node operators from Giant pool

This is a tutorial which shows how anyone can fund ETH to a BLS public key from the Giant Pools. The tutorial uses LSD Wizard SDK to fund the BLS public key registered by a node operator.

Pre-installations

The LSD Wizard SDK is written in typescript and needs following installation for compiling.

yarn add typescript typechain @typechain/ethers-v5 @types/lodash

Installing the SDK

yarn add @blockswaplab/lsd-wizard [email protected]

ethers is used throughout LSD Wizard SDK, hence this tutorial uses ethers too.

Importing the SDK

const { Wizard } = require("@blockswaplab/lsd-wizard");

or

import { Wizard } from "@blockswaplab/lsd-wizard";

Now using ether's signer instance initialise the SDK.

Initialising the SDK:

const wizard = new Wizard({
signerOrProvider: "<ETHER_SIGNER_INSTANCE>", // signer or provider
liquidStakingManagerAddress: "<LIQUID_STAKING_MANAGER_ADDRESS>",
savETHPoolAddress: "<PROTECTED_STAKING_POOL_ADDRESS>",
feesAndMevPoolAddress: "<MEV_STAKING_POOL_ADDRESS>"
});

Using the SDK

If ETH has been already deposited into the Giant pool (either via dapp or SDK), then skip to Step 3.

Step 1: Deposit ETH into the Giant MEV Staking pool

const tx1 = await wizard.giantFeesAndMevPool.depositETH(amount, ethValue);

amount: number of ETH to be deposited. (preferred format, string)
ethValue: ETH to be attached with the transaction. Same as amount (preferred format, Big Numbers)

Step 2: Deposit ETH into Giant Protected Staking pool

const tx2 = await wizard.giantSavETHPool.depositETH(amount, ethValue);

amount: number of ETH to be deposited. (preferred format, string). ethValue: ETH to be attached with the transaction. Same as amount (preferred format, Big Numbers)

Assuming the node operator has already been registered, follow the next steps to fund the BLS public key.

Step 3: Send ETH from Giant MEV Staking pool to the LSD

const tx3 = await wizard.giantFeesAndMevPool.batchDepositETHForStaking(feesAndMevPoolAddresses, amounts, blsPublicKeys, stakeAmounts);

feesAndMevPoolAddresses: Array of addresses of the MEV Staking Pool which have registered the BLS public keys.
amounts: Array of string of amount of ETH (in wei) that needs to be sent to each of the feesAndMevPoolAddresses.
blsPublicKeys: 2 dimensional array of BLS public keys that belong to their respective LSDs, which need to be funded from the Giant Protected Staking Pool.
stakeAmounts: 2 dimensional array of string of amount of ETH (in wei) to be transferred to each BLS public key.

Step 4: Send ETH from Giant Protected Staking pool to the LSD

const tx4 = await wizard.giantSavETHPool.batchDepositETHForStaking(savETHVaultAddresses, amounts, blsPublicKeys, stakeAmounts);

savETHVaultAddresses: Array of addresses of the Protected Staking Pool which have registered the BLS public keys.
amounts: Array of string of amount of ETH (in wei) that needs to be sent to each of the savETHVaultAddresses.
blsPublicKeys: 2 dimensional array of BLS public keys that belong to their respective LSDs, which need to be funded from the Giant MEV Staking Pool.
stakeAmounts: 2 dimensional array of string of amount of ETH (in wei) to be transferred to each BLS public key.