S

StakeSwap

Stakeswap is an an AMM-based DEX, based on Uniswap V2. It guarantee double revenue sources to LPs, by automatically swapping ETH to LSDs or directly staking into the liquidity pool.

The problem StakeSwap solves

1. Product Brief

Stakeswap is an an AMM-based DEX, based on Uniswap V2. We guarantee double revenue sources to LPs. Once liquidity providers deposit their tokens to StakeSwap, they could earn both staking rewards and swap fees at once. When deposit happens, the LSDAggregator automatically swaps ETH to LSDs or directly stake ETH to staking pools, depending on the current estimated APR. In case of withdrawal, vice-versa applies. Attracting more liquidity providers to the pool, StakeSwap will help generating new active contributers to this ecosystem.

2. Detail: Allowing LPs to get revenue from both staking rewards and swap fees

Existing Automated Market Makers (AMMs) only offer transaction fees for swapping tokens, while Liquid Staking Protocols only provide rewards for staking. This leaves Liquidity Providers (LPs) with no alternative but to choose between them.

StakeSwap addresses this issue by allowing LPs to receive both swap fees and staking rewards. This is achieved by converting the ETH in the liquidity pool into a liquid staking form using protocols like Lido and Frax.

This solution effectively resolves the predicament faced by many LPs, who previously had to decide between providing liquidity to an AMM or staking their ETH on the Ethereum network for additional profits.

The reason this approach was not feasible in the past was because staked ETH on the Ethereum network couldn't be withdrawn. However, Ethereum 2.0 Shanghai upgrade in last March, enabled the withdrawal of staked ETH. This development makes our protocol viable and functional, followed by increased deposit of LSDs in total.

3. Technical overview: AMM based DEX, based on Uniswap V2

Forked from Uniswap v2, the deposit and withdrawal works as follows.

  • Deposit
  • Withdrawal

Challenges we ran into

Frontend: staking reward calculation ~ ERC20-permit

In order to calculate the exact staking reward, LPs should approve shares, which does not make sense to send transaction just to calculate rewards. To get rid of this issue, we fixed the router contract to support ERC20-permit to remove liquidity and to calculate rewards. We also fixed the web client to request a signature to get the token approval and to use the signature to calculate the staking rewards. Although this approach might slightly deteriorate the user experience of ours, this was the most sound and shortcut approach to achieve the goal.

Discussion