near / bounties

Specs for technical and non-technical work that earns NEAR tokens
https://devgovgigs.near.social
72 stars 8 forks source link

Pool Together delegation | Bounty: 2000 NEAR #8

Closed ilblackdragon closed 3 years ago

ilblackdragon commented 4 years ago

Description

Use idea of PoolTogether with delegation rewards. Create a smart contract that users can delegate to. All delegations then are re-delegated to one of the smart contract pools. Every X blocks (can be 12h, day or week), a lottery will be run weighted by how much coins they delegated and one of delegators will win all rewards from everyone.

Context

PoolTogether is a way to pool together funds and win lending rewards: https://www.pooltogether.com/

Acceptance

Bounty

2000 $NEAR

zavodil commented 4 years ago

Shall we consider number of seats? Can user with 1 NEAR stake win all rewards?

ilblackdragon commented 4 years ago

@zavodil Sure, it should be weighted by how much they deposited into contracts.

andytcf commented 4 years ago

Is this one still ongoing? Is there any additional details and requirements that haven't been included as this issue was opened a while back?

Thanks

aj07 commented 3 years ago

Is this bounty still Open ?

ilblackdragon commented 3 years ago

Yes, this bounty is still open. If anyone wants to work on it - please post progress here for everyone to see.

ouromoros commented 3 years ago

I'm interested in working on this. My draft smart contract have the following change methods:

stake: transfer some amount of NEAR to the protocol account which it will delgate to speicific pool evaluate: evaluate (calculate lottery winner) and update the balance(staked + reward) of all staked users, this function should be called by party of interest in a timely manner, and possibly be rewarded to incentivise unstake: unstake some amount of NEAR that's staked in the pool withdraw: withdraw the amount of NEAR that's unstaked three epochs ago

The contract should store and manage records of corresponding balance of each participant. One problem is how do we make sure evaluate is called every epoch? If there isn't some built-in mechanism in NEAR to implement it, then we'll have to deal with the special condition when evaluate is not called and multiple epochs have passed.

I'm fairly new to NEAR contract programming, I would appreciate some suggestions.

gagdiez commented 3 years ago

With @lunafromthemoon we have created Pool Party! You can see its first version running in the testnet in the following link: https://siasky.net/hns/poolap/.

How does it work? The pool is completely functional. Users can stake, unstake, and withdraw their NEAR, and at most once per day the interest generated is raffled between the participants.

We have performed exhausting testing on the smart contract, and found no way to leave the money stalled or locked in the pool. Furthermore, we tested our raffle algorithm, and it is highly performant, allowing us to handle thousands of subjects without running out of gas.

What are the next steps?

@ilblackdragon is our current status enough to claim the bounty? Or would something else be needed?

ilblackdragon commented 3 years ago

Looks great! I think the current state is good to claim the bounty. How about you add your near account to Github description to facilitate payment?

gagdiez commented 3 years ago

@ilblackdragon Great news! I have updated my profile with my near wallet: gagdiez.near

ilblackdragon commented 3 years ago

@gagdiez can link to the source code here and I'll close it.

gagdiez commented 3 years ago

The source code is in: https://github.com/gagdiez/pool_party

We will work on adding more information to the README.md soon.

We have received the bounty. Thank you @ilblackdragon.

We will get in contact soon with the NEAR community to inform the launch in mainnet.