Three Minutes to Understand DeFi Pooling: Providing Scalability for Existing L1 Projects
This article was published on Ethereum Enthusiasts, written by: Louis Guthmann, translated by: A Jian.
Abstract
The primary value of DeFi is financial inclusion and open access. However, with the rising Gas Price, DeFi is increasingly becoming a game for whales.
Layer-1 liquidity pools (such as the vault in YFI) can efficiently promote DeFi inclusion because they are cheaper and simpler.
However, joining, leaving, and rebalancing a liquidity pool on Layer-1 is still expensive.
StarkEx solves this problem. Our proposed solution is called DeFi Pooling, which places the billing on Layer-1 while completing the position rebalancing on Layer-2.
StarkEx 3.0 (coming in May 2021) will support the front-end component of DeFi Pooling: L1 Limit Order.
Background
The goal of DeFi is to leverage its composability and permissionless nature to democratize financial services. However, when gas prices are too high, only the wealthy can participate.
If we want DeFi to remain inclusive and attract the next 10 million users, we need to address scalability issues and reduce transaction costs.
We have already seen a step towards scalability with Yield Optimizers. Projects like YFI and Harvest allow retail investors to participate in more advanced and expensive trading strategies. Take the YFI USDt Curve strategy as an example.
For an average trader, maximizing deposit yields in the Curve project is very complex. They need to first deposit money into a liquidity pool, then deposit the pool's deposit receipt into the Curve gauge, determine the lock-up period to increase CRV rewards, and also vote on-chain to decide the reward distribution for their pool.
With YFI, this entire process can be abstracted away. Users only need to deposit money into the YFI USDt yVault contract, and the protocol will automatically handle the rest. The trade-off is that the protocol charges a 20% management fee on profits.
For most traders, a 20% fee is cheaper than dealing with all those hassles and the transaction fees incurred while doing those complicated tasks.
Moreover, because the voting power of YFI users is aggregated, YFI effectively becomes an investment fund that can influence Curve, benefiting all YFI stakeholders: both traders and token holders.
However, YFI is not the most efficient in terms of gas usage, as depositing into and withdrawing from the pool, including rebalancing the entire fund, are still operations on Layer-1. Therefore, these operations are often prohibitively expensive.
DeFi Pooling is here to solve this problem: it can move deposits, withdrawals, rebalancing, and more to a scalable and low-cost Layer-2!
What is DeFi Pooling?
DeFi Pooling is a new mechanism that allows users to trade with their Layer-2 accounts without incurring transaction fees: they can deposit money on Aave and Compound, invest on YFI or Harvest, or become liquidity providers on Uniswap, Balancer, and Curve.
Process
Let's take a simple DeFi operation as an example: investing in USDt yVault.
Participants are:
Traders / Users / End Users
Alice, Bob, and Carol are traders with funds on Layer-2.
Off-chain part
An operator and the StarkEx system supporting the operator's services.
On-chain part
DeFi target contract (in this case, the yUSDt Vault)
StarkEx smart contract
Broker Pool: a new on-chain smart contract that coordinates demand from StarkEx contracts, manages the ownership of the pool, and interacts with the DeFi target contract.
In our example, Alice and Bob want to deposit money into YFI, while Carol wants to withdraw from YFI. Therefore, the demands of Alice and Bob perfectly match with Carol's, and only the difference needs to be transferred on-chain.
From the perspective of Alice and Bob, the operation of DeFi Pooling consists of two steps:
Convert USDt into shares minted by the StarkEx operator from the Broker Pool (e.g., syUSDt).
Exchange syUSDt for yUSDt.
Step 1: Aggregate Demand
The broker contract mints shares from the Broker Pool (e.g., syUSDt).
The broker contract sells the shares to the traders through a limit order on the main chain (L1 Limit Order, see below).
StarkEx settles this transaction on-chain.
Step 2: Activate the Pool
The broker contract withdraws the funds belonging to the liquidity pool from the StarkEx smart contract.
The broker contract deposits these funds into the DeFi Vault (e.g., yVault).
The broker contract receives deposit receipts (LP tokens, e.g., yUSDt).
The broker contract creates a limit order on-chain, providing the price of the deposit receipts against the pool shares (e.g., syUSDt).
Step 3: Traders Receive Deposit Receipts
Traders on Layer-2 use shares (e.g., syUSDt) to buy back deposit receipts (e.g., yUSDt).
The broker contract destroys the shares.
Step 4: Rebalancing ------ Adding the Finishing Touch
One might notice that now, a strategy can be represented as an off-chain token. Therefore, rebalancing operations like exchanging yUSDt for yETH can be simplified to finding another trader to swap tokens, allowing it to occur entirely in a gas-free environment.
One more thing to clarify: On-chain Limit Orders
Another thing we haven't explained clearly above is the on-chain limit orders. There are three basic operations on StarkEx: transfers, conditional transfers, and Layer-2 limit trading. In the next version (StarkEx V3), we will also support Layer-1 limit orders, enabling Layer-1 smart contracts to send transactions on Layer-2. This is the missing piece of the puzzle.
Conclusion
To reclaim the original intention of financial inclusion in DeFi, we need to provide larger transaction throughput and lower transaction costs. DeFi Pooling is such a solution. It is akin to replacing private jets with commercial airlines. If DeFi wants to cover the next 10 million traders, this is the right path.