# LEGO: Lido stETH Uniswap V3 Pool

**URL:** <https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509>\
**Category:** Proposals\
**Created:** [April 28, 2021, 3:52pm UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509 "2021-04-28T15:52:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![vsh](https://avatars.discourse-cdn.com/v4/letter/v/b19c9b/32.png) [@vsh](https://research.lido.fi/u/vsh)\
**Post date:** [April 28, 2021, 3:52pm UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509/1 "2021-04-28T15:52:42Z")

</div>

David Mihal (author of [GitHub - dmihal/uniswap-liquidity-dao](https://github.com/dmihal/uniswap-liquidity-dao)) is ready to start working on a incentivizable UNIv3 pool for wstETH/ETH pair.

Uniswap V3 presents significant improvements in capital efficiency, by allowing liquidity providers to specify a price range to add liquidity at. However, this increased complexity makes it more difficult for users to add liquidity to a pool, and adds additional challenges for liquidity mining/“yield farming” systems.

This proposal will create a simple pool wrapper token on top of the Uniswap V3 wstETH/WETH pool. The goal is to provide a user experience similar to Uniswap V2, while retaining the improved capital efficiency of V3.

## Specification

The pool will allow users to deposit wstETH and WETH in a balanced amount and receive LP tokens. The deposited wstETH & WETH will be added to the 0.05% fee pool on Uniswap v3. Liquidity will be distributed across two different ranges: 80% of liquidity will be allocated to the 0.95-1.01 range, while 20% will be allocated to the 0.9-1.03 range.

Users may withdraw their liquidity at any time, redeeming their LP tokens for the underlying liquidity in the pool.

### Fee compounding

The pool contract will contain a rebalance function. When called, this function will execute the following logic:

1. Claim all trading fees accrued by both positions
2. Out of claimed fees, attempt to deposit 20% to the wide range & 80% to the tight range
3. With any remaining balance, swap through Uniswap to balance the allocation
4. Deposit the remaining funds into the tight range

Since this function is public and contains a swap, it may be vulnerable to front-running. Therefore, the function will compare the current tick against the TWAP price and fail if the price has moved too quickly.

## Implementation

This pool will be based on the existing codebase from the [uniswap-liquidity-dao](https://github.com/dmihal/uniswap-liquidity-dao) repository.

However, there will be simplifications due to the removal of functionality for adjusting ticks & fee pools. The two liquidity ranges will be hard-coded at the construction of the pool and remain unchangeable.

Additional functionality will be required to allow the pool to handle multiple liquidity ranges. Furthermore, the rebalancing mechanism needs to be completed (the current implementation is very rudimentary) and the TWAP-powered frontrunning protection needs to be built.

The code will be thoroughly tested and documented (commit `81b681a726cae2facbb2a6fd68372c52f0e83ab8` has a good level of testing and documentation, as a benchmark).

A deployment script will be provided.

## Compensation

A grant of 7,000 LDO is being requested from the Lido Ecosystem Grant Organization for the development, testing and deployment of this contract. 2,400 will be provided up-front, with the remainder provided at completion.

## Future Work

The following items are outside the scope of this grant proposal.

### Zaps

Contract to allow the user to deposit/withdraw using stETH & ETH, instead of wstETH & WETH.

## LEGO Parameters

By grant size and importance it’s a boulder; so the LEGO council will have to vote on that. My personal opinion is that it’s a very good proposal with the amount of funding fully adequate for the combination of project scope, skill, and domain knowledge David has.

---

<div class="post-metadata">

**Author:** ![kadmil](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/kadmil/32/1958_2.png) [@kadmil](https://research.lido.fi/u/kadmil)\
**Post date:** [April 28, 2021, 3:59pm UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509/2 "2021-04-28T15:59:27Z")

</div>

I fully support the proposal. It brings significant value to Lido, and David Mihal is a great person for this given his experience and domain knowledge.

---

<div class="post-metadata">

**Author:** ![katernoir](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@katernoir](https://research.lido.fi/u/katernoir)\
**Post date:** [April 28, 2021, 4:33pm UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509/3 "2021-04-28T16:33:43Z")

</div>

Proposal is well aligned with the DAOs interest and grant size looks reasonable. I support to get this proposal started ASAP.

---

<div class="post-metadata">

**Author:** ![eth\_in\_NE](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/eth_in_ne/32/259_2.png) [@eth\_in\_NE](https://research.lido.fi/u/eth_in_NE)\
**Post date:** [April 28, 2021, 5:08pm UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509/4 "2021-04-28T17:08:40Z")

</div>

This seems to be perfectly aligned with where we should take stETH and what the LEGO was designed for. I say press!

---

<div class="post-metadata">

**Author:** ![skozin](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/skozin/32/44_2.png) [@skozin](https://research.lido.fi/u/skozin)\
**Post date:** [April 28, 2021, 8:03pm UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509/5 "2021-04-28T20:03:51Z")

</div>

Diversification of stETH/ETH liquidity is a very important goal, so this proposal makes a lot of sense and will bring a lot of value to the protocol.

---

<div class="post-metadata">

**Author:** ![simplelife](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/simplelife/32/261_2.png) [@simplelife](https://research.lido.fi/u/simplelife)\
**Post date:** [April 29, 2021, 10:35am UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509/6 "2021-04-29T10:35:08Z")

</div>

When will this go to Aragon voting?

When can we expect this to go live, eta of this feature?

---

<div class="post-metadata">

**Author:** ![vsh](https://avatars.discourse-cdn.com/v4/letter/v/b19c9b/32.png) [@vsh](https://research.lido.fi/u/vsh)\
**Post date:** [April 29, 2021, 11:21am UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509/7 "2021-04-29T11:21:49Z")

</div>

It doesn’t need Aragon voting. It’s been already passed through LEGO council and funded. ETA for the delivery is ~1m but it’s an estimation, not an obligation.

---

<div class="post-metadata">

**Author:** ![Drag0nflai](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/drag0nflai/32/639_2.png) [@Drag0nflai](https://research.lido.fi/u/Drag0nflai)\
**Post date:** [May 1, 2021, 9:21am UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509/8 "2021-05-01T09:21:16Z")

</div>

Am I right to assume the Lido contract isn’t integrated with Uni V3 to also provide staking rewards for the stETH in the pool and that users would forego staking rewards to earn LP rewards?

---

<div class="post-metadata">

**Author:** ![Dual-Blade](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/dual-blade/32/286_2.png) [@Dual-Blade](https://research.lido.fi/u/Dual-Blade)\
**Post date:** [May 5, 2021, 3:13am UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509/10 "2021-05-05T03:13:45Z")

</div>

Cool advise! I Agree it!

---

<div class="post-metadata">

**Author:** ![EthGao](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/ethgao/32/273_2.png) [@EthGao](https://research.lido.fi/u/EthGao)\
**Post date:** [May 6, 2021, 3:13pm UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509/11 "2021-05-06T15:13:47Z")

</div>

What will happen to stETH if the corresponding ETH is slashed on ETH2?

Say I swap for some stETH on Uni V3 and I am not a validator myself, doesn’t the value of my new stETH depending the ETH someone else has stakend?

---

<div class="post-metadata">

**Author:** ![vsh](https://avatars.discourse-cdn.com/v4/letter/v/b19c9b/32.png) [@vsh](https://research.lido.fi/u/vsh)\
**Post date:** [May 6, 2021, 3:18pm UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509/12 "2021-05-06T15:18:13Z")

</div>

It does! if Lido pool gets slashed your stETH balance will decrease.

---

<div class="post-metadata">

**Author:** ![frontalpha](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/frontalpha/32/465_2.png) [@frontalpha](https://research.lido.fi/u/frontalpha)\
**Post date:** [May 14, 2021, 10:17am UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509/13 "2021-05-14T10:17:13Z")

</div>

![image](https://europe1.discourse-cdn.com/flex013/uploads/lido/original/1X/ab4d7c4b49d38650185f4963f6ce6329c6cb018a.jpeg)

I was checking out this proposal to create a pool wrapper token on top of the Uniswap V3 wstETH/WETH pool but I am having trouble conceptualizing each step.

So is the order of operations:

1. Create wstETH/WETH pool \>receive LP NFT
2. Make wstETH/WETH LP NFT into pool wrapper token(s)?

Then what? Or am I already missing steps?

---

<div class="post-metadata">

**Author:** ![vsh](https://avatars.discourse-cdn.com/v4/letter/v/b19c9b/32.png) [@vsh](https://research.lido.fi/u/vsh)\
**Post date:** [May 17, 2021, 10:44am UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509/14 "2021-05-17T10:44:38Z")

</div>

A bit more involved than that - a user provides capital in form of eth or steth or both, and the smart contracts makes a predefined LP NFT and mints a wrapper ERC20 token.

---

<div class="post-metadata">

**Author:** ![mihal](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/mihal/32/318_2.png) [@mihal](https://research.lido.fi/u/mihal)\
**Post date:** [May 19, 2021, 11:15am UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509/15 "2021-05-19T11:15:18Z")

</div>

Just to clarify, the user provides both ETH & stETH to the pool, and receives an ERC20 token. The process will feel very similar to Uniswap V2.

Technically, there is no NFT involved, we’re bypassing all the NFT stuff to save gas.

---

<div class="post-metadata">

**Author:** ![frontalpha](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/frontalpha/32/465_2.png) [@frontalpha](https://research.lido.fi/u/frontalpha)\
**Post date:** [June 28, 2021, 11:21am UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509/16 "2021-06-28T11:21:31Z")

</div>

Hello @mihal,

How’s the stETH Uniswap v3 pool coming along?

---

<div class="post-metadata">

**Author:** ![vsh](https://avatars.discourse-cdn.com/v4/letter/v/b19c9b/32.png) [@vsh](https://research.lido.fi/u/vsh)\
**Post date:** [June 28, 2021, 11:44am UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509/17 "2021-06-28T11:44:34Z")

</div>

It’s under reaudit after fixes.

---

<div class="post-metadata">

**Author:** ![frontalpha](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/frontalpha/32/465_2.png) [@frontalpha](https://research.lido.fi/u/frontalpha)\
**Post date:** [June 28, 2021, 11:50am UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509/18 "2021-06-28T11:50:40Z")

</div>

Thanks for the response. Are there any other updates or relevant information that would be good to know?

---

<div class="post-metadata">

**Author:** ![vsh](https://avatars.discourse-cdn.com/v4/letter/v/b19c9b/32.png) [@vsh](https://research.lido.fi/u/vsh)\
**Post date:** [June 28, 2021, 12:06pm UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509/19 "2021-06-28T12:06:42Z")

</div>

It’s a work in progress, should be finished soonish. The work happens fully in the open:

> **[dmihal/lido-uni-v3-pool](https://github.com/dmihal/lido-uni-v3-pool)**
>
> Contribute to dmihal/lido-uni-v3-pool development by creating an account on GitHub.

When it’s done, there will be time for presentation/further decision what to do with it.

---

<div class="post-metadata">

**Author:** ![frontalpha](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/frontalpha/32/465_2.png) [@frontalpha](https://research.lido.fi/u/frontalpha)\
**Post date:** [July 12, 2021, 1:12pm UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509/20 "2021-07-12T13:12:38Z")

</div>

Some dude named David said this puppy is ready to go.  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/lido/original/1X/df1403991f2c69aa243b532c715797e5b1dc0b8f.png)

---

<div class="post-metadata">

**Author:** ![eth\_in\_NE](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/eth_in_ne/32/259_2.png) [@eth\_in\_NE](https://research.lido.fi/u/eth_in_NE)\
**Post date:** [August 2, 2021, 3:25am UTC](https://research.lido.fi/t/lego-lido-steth-uniswap-v3-pool/509/21 "2021-08-02T03:25:25Z")

</div>

Any update? I just check uni charts for stETH and nothing returned in the search.
