Open fmcruz opened 3 years ago
Thanks @fmcruz, can you please also attach and integrate the information about the algo being used to determine the penalty when exiting?
Hi @Ruiub3i, I've just updated the description and included the info about the algo for exiting, entering and currentStake etc.
How to integrate uniswap v3 swaps in the SC :
Tests necessary :
I am interested, working on this one.
done, awaiting acceptance and pull request merge.
@sgoia is working on this.
@fmcruz, @sgoia has a solution - check your issue
@Ruiub3i is working on this.
@Zyx51940930 is working on this.
Description LOOPhole's main goal is to drive investors to hodl their assets. Loophole offers segregated liquidity pools, at the beginning just for WBTC and ETH (Main Pools), investors stake their assets in these pools. While an investor keeps the stake in the pool, the system yields back LOOPhole tokens through liquidity mining. In order to promote the hodling strategy, whenever an investor wants to exit some pool he incurs in a fixed penalty over their current stake. Part of such penalty (i.e. 50%) is distributed among the remaining participants of the pool, while the remaining 50% is added to another pool: the LOOP pool. The LOOP pool offers another strategy of staking but in addition it is also a way of effectively decreasing the exit's penalty: if an investor stakes the LOOPhole tokens earned from farming, or buys directly LOOPhole tokens in the open market, he will benefit directly from his own exit as well as from the exits of other investors.
Variables
Main Pools and Loop Pool
uint256
uint256
map
map
uint256
uint256
uint256
Features
Main Pools and Loop Pool
stake(user, amount)
exit(user, amount)
currentStake(user)
earnings(user)
Main Pools
swapCollectedPenalty(amount)
/ swap collected penalty from main pools exits for LOOPhole tokens in the open market/liquidityMining(amount)
Loop Pool
addReward(amount)
/ adds to the LOOP pool the amount in LOOPhole tokens corresponding to half the penalty for leaving the main pools. /burn(amount)
Algos
Both staking and exiting a pool require a set of steps and modification of the Variables
Main Pools
stake(user, amount):
totalPool = totalPool + amount
exit(user, amount):
swapCollectedPenalty( amount * exitPenalty / 2)
return amount * (1 - exitPenalty)
currentStake(user):
Loop Pool
stake(user, amount):
-> the exact same as the Main Poolsexit(user, amount):
liquidityMining(amount * exitPenaltyLP / 2 )
burn( amount * exitPenaltyLP / 2 )
return amount * (1 - exitPenaltyLP)
currentStake(user):
-> the exact same as the Main PoolsaddReward(amount):