or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing
xxxxxxxxxx
Direct-like Deposits proposal for a 3rd-party Vault
Overview
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 thedeposit
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.
On-chain implemenatation's interface
External vault design assumptions
Description
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 theDSM 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
)Suggested interface for 3rd-party deposit method
The
stakingModuleId()
value must be passed to callDSM.depositBufferedEther(...)
Suggested flow and checks inside the method (to be executed in a single tx)
lido_buffered_eth >= lido_withdrawal_demand_eth
lido_buffered_eth + vault_avail_eth - lido_withdrawal_demand_eth
Deposit mechanism
Now let's describe the current logic of the depositor bot and the proposed changes.
Tl;dr
In brief, the following changes are made to the bot logic:
id
matches thestakingModuleId()
value from the 3rd-party contract (e.g., contract behind Distributed Validator Vault), then in addition to the Lido buffer, the bot will take thebalanceOf
ether of the external vault holding deposited etherCurrent Lido off-chain deposit algorithm:
Deposit off-chain algorithm using Distributed Validator Vault (DVV) contract:
Off-chain implementation
The 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.
Security considerations
The proposed approach has the following limitations and risks: