With the increase in the share of the SimpleDVT module and the demand for more targeted allocation of stake into the module, the question arises about the existence of a mechanism ensuring the deposit of user ETH into a specific staking module of the protocol.
However, the current protocol lacks a mechanism to facilitate this because all incoming stake is automatically allocated across modules according to the MinFirstAllocationStrategy. This means that new stake will be directed to the module with the smallest share of allocated stake until a certain module has the smallest share. Additionally, it's important to note that ETH from the buffer can be used to fulfill withdrawal requests (also check the code of Lido.getDepositableEther()
)
One possible solution to the problem at hand, without making changes to the Lido core protocol smart contracts, is simply to wait for an opportune moment when there are no outstanding withdrawals in the protocol. Subsequently, one can sequentially call the submit
method (to place ETH in the buffer) and the deposit
method (to allocate stake to the module). Thus, as long as the module's share of allocated stake remains minimal, it can be asserted that newly staked Ether will be allocated to this module.
The technical implementation of this approach involves using an external smart contract, capable of submitting Ether and simultaneously depositing it within a single transaction. However, this approach will also require adjustments to off-chain tooling, particularly minor changes to the logic of the depositor bot to ensure conditions for optimal timing and the invocation of methods on the external contract.
As stated in the deposit process flow, the depositor bot must gather guardian messages and other parameters to pass them to the invoked depositBufferedEther
method in the DSM contract
. Because the method in the DSM contract is permissionless, any caller with a full set of parameters can invoke it.
Therefore, when implementing the combined method in the third patry contract, it must also accept these parameters for subsequent passing to the DSM contract. Additionally, it can be assumed that the external contract will target only a specific staking module. Therefore, it can define the module ID it is intended for, excluding the need to transmit this parameter as redundant. (In case of SimpleDVT module this id would be SIMPLE_DVT_MODULE_ID=2
)
The stakingModuleId()
value must be passed to call DSM.depositBufferedEther(...)
lido_buffered_eth >= lido_withdrawal_demand_eth
lido_buffered_eth + vault_avail_eth - lido_withdrawal_demand_eth
Now let's describe the current logic of the depositor bot and the proposed changes.
In brief, the following changes are made to the bot logic:
id
matches the stakingModuleId()
value from the 3rd-party contract (e.g., contract behind Distributed Validator Vault), then in addition to the Lido buffer, the bot will take the balanceOf
ether of the external vault holding deposited etherThe above-described approach to modifying the depositor bot can be implemented by any third party. However, to minimize resources and time spent, it would be logical for the modification and maintenance of the offchain bot to be carried out by Lido contributors.
The proposed approach has the following limitations and risks: