bepronetwork / bepro-js

The repository contains a comprehensive documentation of the bepro.network ecosystem as a javascript framework. If you are new to BEPRO, you might want to check out the Website Overview or our public "Start Building" Page.
163 stars 94 forks source link

Smart Contract - [@LOOPhole.finance] #22

Open fmcruz opened 3 years ago

fmcruz commented 3 years ago

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

  1. totalPool uint256
  2. entryStakeTotal uint256
  3. entryStakeUser map
  4. entryStakeAdjusted map
  5. totalDistributedPenalty uint256
  6. exitPenalty uint256
  7. exitPenaltyLP uint256

Features

Main Pools and Loop Pool

Main Pools

Loop Pool

Algos

Both staking and exiting a pool require a set of steps and modification of the Variables

Main Pools

stake(user, amount):

Loop Pool

stake(user, amount): -> the exact same as the Main Pools

exit(user, amount):

addReward(amount):

Ruiub3i commented 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?

fmcruz commented 3 years ago

Hi @Ruiub3i, I've just updated the description and included the info about the algo for exiting, entering and currentStake etc.

Ruiub3i commented 3 years ago

How to integrate uniswap v3 swaps in the SC :

https://github.com/Uniswap/uniswap-v3-core

Ruiub3i commented 3 years ago

Tests necessary :

  1. Create a ERC20 Token in Kovan
  2. Create a pool Uniswap v3 in Kovan
  3. Use that pool id/address for the general tests
sgoia commented 3 years ago

I am interested, working on this one.

sgoia commented 2 years ago

done, awaiting acceptance and pull request merge.

bepro-bot commented 2 years ago

@sgoia is working on this.

bepro-bot commented 2 years ago

@fmcruz, @sgoia has a solution - check your issue

bepro-bot commented 2 years ago

@Ruiub3i is working on this.

bepro-bot commented 2 years ago

@Zyx51940930 is working on this.