Yearn Ecosystem Layer 2 Migration

I saw a post on the Sushi forum talking about moving to an L2 , which got me thinking, that as an ecosystem, it’s going to be advantageous to all be on the same L2, and ideally the same one as some of the larger defi projects (aave would be my first choice)

I did a search in the forum and couldn’t find any discussion about any developments on that front so I just wanted to pose the question here to see if there was some synchronization or at least plans to coordinate on the L2 front.

16 Likes

There is no reason to move to L2 right now. Solutions for scaling L1+1 are almost coming out soon as well.

L2 Migration is a one way affair: better hope the liquidity follows you.

5 Likes

Here’s my pitch, though it’s not aimed at supporting the entire yearn ecosystem, more untested products and features

5 Likes

I think there are a number of reasons to move to an L2 soon

  • Soaring gas fees for 1
    This is costing Yearn money every day, and prohibiting smaller users from depositing more
  • If all of the Yearn Ecosystem was on the same L2 that would increase user stickiness
    If there’s a delay on the deposits/withdrawls from an L2, but a user knows they can keep their funds within Yearn and not have to wait, plus get to take advantage of low fees, and high speed I think we would see a lot of people stay within the Ecosystem rather than leave to a competitor providing a similar service.

To the point about it being a one way road, that’s why I’m proposing we take the entire ecosystem to the same L2. That would guarantee a great deal of liquidity as early as possible.

Further Uniswap said their V3 will be available on an L2 and an L1, so if we implemented something similar we wouldn’t be betting the farm on the L2 working out.

5 Likes

Note that if the whole ecosystem moves to the same L2, then you’ve just recreated the problem on L2 :slight_smile:

6 Likes

What if we just have a L2<->L1 bridge that sends funds from L2->L1 in bulk. This way, users can access yearn vaults on L1 from L2.

Or even multiple bridges for the different L2s.

Edited to elaborate:

Since most of what yearn does needs to be on L1 (current strategies all use L1 protocols). We can have something on L2 and aggregates user deposits and send to L1 vaults in bulk.

9 Likes

This is an interesting idea, and would essentially require users be okay with waiting for deposits/withdrawals, perhaps we could do them once per week. Users deposit to smart contract on L2, or request a withdrawal from smart contract on L2, and once per week L2 smart contract exchanges funds between L2 and L1.

This also ties back into the idea we discussed a while back on the forums about having a bulk-deposit contract; this one would just be on L2. So in that same vein, if there are enough funds sitting in the L2 deposit contract, then a withdrawing user could just receive those funds, instead of a transaction needing to be sent to the L1 contract.

This begs the question, though: for small users, would a bulk-deposit/withdrawal contract on L1 be a better solution? Because, my understanding currently is that to get on L2, a user would need to make the contract interaction on L1 to move to L2 anyway. So maybe a bulk-deposit contract on L1 is still the better solution.

6 Likes

PieDAO has an implementation of bulk deposits on L1 called Ovens. It’s a pretty interesting implementation, but they save gas because you need to do multiple swaps to mint Pie indices whereas yearn is just a simple deposit, so the gas savings might not be as big.

I was thinking a L2 solution is cheaper in the long run since small funds will probably move to L2 and stay there (not back to L1). This will quickly become mainstream now that L1 gas is growing and more projects are available on L2.

Edit to clarify:
I’m bringing this up as a solution to funds that’s already on L2, or for people thinking of migrating most of their funds to L2.

9 Likes

We only recreate the problem to a small extent, we wouldn’t have most of the major gas hogs (Tether, Uniswap, USDC, Coinbase, Etc) unless all of those contracts also moved to the same contract.

EDIT: That’s assuming we have runaway success on the L2 we choose

8 Likes

Here is one example: the second most gas guzzling contract is WETH. That doesn’t change on L2.

L2 doesn’t address design flaws of L1, ergo the benefit is only temporary

Sure we’ll have some of the same gas guzzling on our L2, but not all of it.

Ideally before it became an issue ETH 2 would be up and running.

3 Likes

ETH 2.0 may not be here for 3 years at least.

Again, what is going to bring liquidity with us?

3 Likes

Agreed. ETH 2 is a long ways off still, all the more reason for Yearn to move to an L2 in the mean time.

I think this is the Liquidity we could potentially bring over some of the TVL of just the protocols in the Yearn Ecosystem (Values pulled from Defilama.com)

  • Sushi - 3.5B
  • Badger - 2.2B (Working with Starkware)
  • AlphaFinance - 794M
  • Yearn - 591 M
  • Keeper - 327M
  • Cream - 216M
  • Pickle - 38M
    Total - 7.666B
    If we got 75% of the Yearn Ecosystem leaving 25% on an L1 to handle onboarding and transfers between L1 and L2 etc that’d be 5.7B (just ahead of AAVE at 5.6B) 10% of total locked in Defi as of 2021-02-16

That would be a substantial pool of liquidity.

I realize this would be a massive undertaking, but I think there would be value in coordinating our efforts among the ecosystem.

15 Likes

Circling back to this, I don’t know how much the users would care provided they were still getting the advantage of greatly reduced gas fees, and potentially faster transactions. I don’t know how large of a buffer we’d have to keep in place to accommodate L1/L2 Bulk deposits though.

8 Likes

I think once enough funds move to a specific L2, it would be worth thinking about a bulk-deposit contract for users there.

For now, I’m also very interested in a bulk-deposit/withdraw contract that does this action once per week. Yearn can (hopefully?) eat the gas cost of the 1x/weekly withdrawal/deposit. Again, optimizing for smaller users is something that really could bring us closer toward “DeFi made simple.”

20 Likes

Me too.
Automated batch on low gas usage period is common practice.
A bit like driving on autobahn during the night during the low season.

4 Likes

L2 is not bound by the same constraints as L1.
L2 does not need to be decentralized at all, since it uses L1 for security. You can have a high performance cluster with 7 gazillion tps. You are only bound by the amount of fraud proofs (in case of optimistic) you can publish on L1.

8 Likes

dYdX has launched an alpha version of their L2 using StarkWare’s ZK rollup. It allows for instant deposit/withdrawal. Yearn should launch an exploratory committee on L2 scaling. See how difficult and costly it will be and what the benefits would yield.

14 Likes

@ejbaraza , that is good news, thanks L2 zk teams

29 Likes

Coming back to this post.

Have there been discussions on the core team around the scaling direction?
Are we going to try and go ZK, Optimism, or maybe the sidechain/other chain route?

I know Andre’s been posting a lot about the multichain stuff he’s been working on. :eyes: But I wasn’t sure if that was the scaling plan of just another tentacle for Yearn to branch cross chain (I suppose it could be a little of both)

12 Likes