How to update the LSD commission?
LSD commissions can be set anytime during and after the deployment of LSDs by the DAO address of the LSD. The commissions allow the specified DAO address to collect a part of Fees and MEV revenue.
To update the LSD commission, one would need the help of LSD Wizard SDK.
Pre-installation
yarn add typescript typechain @typechain/ethers-v5 @types/lodash @types/node
Installing the LSD Wizard SDK and ethersjs module
yarn add @blockswaplab/lsd-wizard ethers@5.7.2
Importing the SDK in NodeJS
const { Wizard } = require('@blockswaplab/lsd-wizard');
or
import { Wizard } from '@blockswaplab/lsd-wizard';
Initializing the SDK
One can use any Provider API they like and create a signer
instance. This signer
instance will be used to initialize the SDK. The PRIV_KEY should belong to the ethereum address that was appointed as the DAO when deploying the LSD instance. For updating the commission, we only need the Liquid Staking Manager address of the LSD.
// set the network to goerli or mainnet as needed.
const provider = new ethers.providers.AlchemyProvider('goerli', ALCHEMY_API_KEY);
// replace PRIV_KEY with your private key
const ethSigner = new ethers.Wallet(PRIV_KEY, provider);
const wizard = new Wizard({
signerOrProvider: ethSigner,
liquidStakingManagerAddress: '<LIQUID_STAKING_MANAGER_ADDRESS>',
});
If you don't have the Liquid Staking Manager address for your LSD instance, visit the Goerli LSD Subgraph or Mainnet LSD Subgraoh playground and run a subgraph query as mentioned here.
Updating the LSD commission
The smart contracts define commission up to 5 decimal places. So, 100% will be represented as 10000000
(i.e. 100, followed by 5 zeros). Similarly, other such examples are:
- 10.5% =>
1050000
- 50.00005 =>
5000005
- 23.009 =>
2300900
To update the commission, call the updateDaoRevenueCommission
function in the utils
sub-class as shown below:
// new commission set to 50.00001%
const newCommission = '5000001';
const tx = await wizard.utils.updateDaoRevenueCommission(newCommission);
Once the transaction is successful, the LSD commission will be updated.