SIP-31: sETH LP rewards contract
Author | |
---|---|
Discussions-To | https://discord.gg/3uJ5rAy |
Status | Implemented |
Created | 2019-11-04 |
Simple Summary
Replace the current uniswap sETH Liquidity Provider mechanism with an onchain LP rewards staking contract.
Abstract
Note: LP = Liquidity Provider
The current deployed solution is inefficient and buggy. There are weekly issues with valid LP's not getting rewards and cheaters getting rewards that should be disqualified. This onchain solution fixes all the issues and can be automated and self serve requiring much less steps than the current solution.
Motivation
- Current solution uses an off-chain python script to determine sETH Liquidity providers between two blocks which are manually entered.
- We must download a CSV and manually verify the addresses and their LP amounts.
- There are so many LPs now that it takes 4 multi-sig multi-send transactions to send out the LP SNX rewards.
- The co-ordination amongst the 5 multi-sigs signers and overhead each manually verifying is inefficient given this could all be offloaded to a trusted smart contract to calculate on-chain in a trust-less manner.
- The gnosis multi-sig freezes and is very slow to react since the payloads of the transactions are so big.
- LP providers have noted is that if they withdraw / rebalance any amount of their liquidity from the pool during the week then all their rewards will be forfeited. The python script checks that no withdrawals / transfer of LP tokens have been made from the pool to prevent people from gaming the rewards.
Specification
Workflow
- User adds liquidity to sETH uniswap exchange and receives uniswap uni tokens
- User then stakes the uni tokens at unipool time staking contract
- Anyone can call Synthetix.mint() to mint the inflationary supply. This will then be sent to the RewardsDistribution contract where it will send an amount of tokens to the unipool contract. example transaction
- LP stakers will be assigned their % amount of SNX rewards based on their % of staked uni tokens against the pool of LP providers.
- LP stakers will need to come to the uni pool contract to claim their SNX rewards weekly.
Rationale
This onchain self service model is precicely the use case for smart contracts and should replace the offchain rewards process eradicating the need for the;
- python script
- gnosis multi-sig & the 5 signers signing.
- Synthetix AirDropper contract.
- Mintrs Multi-sig page https://mintr.synthetix.io/multisig
The greatest disadvantage to LP's is that they are current automatically sent their SNX. This model will require each LP to withdraw their SNX.
Test Cases
https://github.com/k06a/Unipool/blob/master/test/Unipool.js
Implementation
The proposed implementation https://github.com/k06a/Unipool
Copyright
Copyright and related rights waived via CC0.