# \[GRANT\] Add Idle as a yield source on pooltogether

**URL:** <https://gov.pareto.credit/t/grant-add-idle-as-a-yield-source-on-pooltogether/413>\
**Category:** 🛠 Grants & Bounties\
**Created:** [April 15, 2021, 6:21am UTC](https://gov.pareto.credit/t/grant-add-idle-as-a-yield-source-on-pooltogether/413 "2021-04-15T06:21:02Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![gggggg](https://avatars.discourse-cdn.com/v4/letter/g/dfb087/32.png) [@gggggg](https://gov.pareto.credit/u/gggggg)\
**Post date:** [April 15, 2021, 6:21am UTC](https://gov.pareto.credit/t/grant-add-idle-as-a-yield-source-on-pooltogether/413/1 "2021-04-15T06:21:02Z")

</div>

**[GRANT] Add Idle as a yield source on pooltogether**

### Abstract

PoolTogether is a decentralized protocol for no-loss prize games on the Ethereum blockchain. Prize games are pools of funds whose accrued interest from the yield source is distributed as prizes. Pooltogether allows adding custom yield sources. This proposal is to add idle pools as a yield source.

### Scope of the Work

The work involves writing contracts to add idle as a yield source and testing integration with pooltogether contracts.  
Current WIP repo: [GitHub - 0xrs/idle-pooltogether](https://github.com/0xrs/idle-pooltogether)

### Discussion Links

The idea was proposed by @unicorn on discord [here](https://discord.com/channels/606071749657755668/606071749657755670/831296295850868756)  
Pooltogether: [Website](https://pooltogether.com/) and [Docs](https://docs.pooltogether.com/)

### Budget

_250 $IDLE_ + matching grant by pooltogether [edited]

### Team

@sunnyRK and @gggggg (both have contributed to idle before through gitcoin grants)

### Timeline

Hard deadline for final delivery is 30th April (factoring in time for testing + review)

---

<div class="post-metadata">

**Author:** ![sunnyRK](https://yyz1.discourse-cdn.com/flex031/user_avatar/gov.pareto.credit/sunnyrk/32/304_2.png) [@sunnyRK](https://gov.pareto.credit/u/sunnyRK)\
**Post date:** [April 15, 2021, 9:08am UTC](https://gov.pareto.credit/t/grant-add-idle-as-a-yield-source-on-pooltogether/413/2 "2021-04-15T09:08:14Z")

</div>

Hey Great work I am also developed a smart contract.  
working on testcase side.

---

<div class="post-metadata">

**Author:** ![william](https://yyz1.discourse-cdn.com/flex031/user_avatar/gov.pareto.credit/william/32/10_2.png) [@william](https://gov.pareto.credit/u/william)\
**Post date:** [April 15, 2021, 9:21am UTC](https://gov.pareto.credit/t/grant-add-idle-as-a-yield-source-on-pooltogether/413/3 "2021-04-15T09:21:48Z")

</div>

Hi @gggggg welcome to the forum,  
didn’t know that you were 0xrs, so congrats for winning the tranches Gitcoin Bounty!

It’s great to see that you picked up @unicorn idea!

One thing that I see in the code is that you are using `tokenPrice` directly while instead,  
you should consider the fee also (both when redeeming and when calculating `balanceOfToken`).  
You should check this out [tokenPrice - Idle](https://developers.idle.finance/methods/tokenprice) specifically the `NOTE` section.  
One minor thing also that should be added is a method for transferring out governance tokens (COMP, IDLE) that will be awarded to the pool itself, I will ask more info to the Pooltogether team / invite them in our Discord.

I know that also @sunnyRK (EDIT: Welcome to the forum!), another gitcoin bounty winner for the on-top strategies bounty, was looking at this bounty you may be working together (you guys both used `tokenPrice` and both not handled got tokens initially 🙂 ). I know that the code to develop is not a lot but maybe one can do the code and one the tests? just throwing some ideas

For the budget I think it’s a bit too high for this implementation given the limited scope compared to the Gitcoin bounties, where more complex strategies were required, and also given the different market conditions for IDLE. I think a 200-250 IDLE bounty would be more aligned, but I’m open to hear other voices

---

<div class="post-metadata">

**Author:** ![sunnyRK](https://yyz1.discourse-cdn.com/flex031/user_avatar/gov.pareto.credit/sunnyrk/32/304_2.png) [@sunnyRK](https://gov.pareto.credit/u/sunnyRK)\
**Post date:** [April 15, 2021, 10:39am UTC](https://gov.pareto.credit/t/grant-add-idle-as-a-yield-source-on-pooltogether/413/4 "2021-04-15T10:39:04Z")

</div>

Hey, it’s okay if I don’t win.  
I am doing for learning purpose and would be cool to help even for a small reward…  
I will post my code soon here:)

---

<div class="post-metadata">

**Author:** ![gggggg](https://avatars.discourse-cdn.com/v4/letter/g/dfb087/32.png) [@gggggg](https://gov.pareto.credit/u/gggggg)\
**Post date:** [April 15, 2021, 12:09pm UTC](https://gov.pareto.credit/t/grant-add-idle-as-a-yield-source-on-pooltogether/413/5 "2021-04-15T12:09:15Z")

</div>

Hey @william, Thanks a ton for reviewing the code and pointing those out (I was planning to handle both the issues after setting up basic test flow). Also thanks for awarding me the bounty for tranches issue. I’m really grateful. Regarding the bounty amount I think you’re right this one has a smaller scope so 200-250 IDLE seems fair.  
@sunnyRK Hey sorry I wasn’t aware that you were also working on it. I’m open to creating a team or if you want to pick this one up that’s also perfectly fine with me (looking at the size of this issue, it’s probably not worth the hassle of coordination). I can focus on some other ideas for idle I’ve been toying around with and work on those. Just sharing this in case you haven’t seen this implementation ([GitHub - steffenix/sushi-pooltogether](https://github.com/steffenix/sushi-pooltogether)) to use as a reference.  
Open to hearing any other thoughts.  
Thanks

---

<div class="post-metadata">

**Author:** ![lay2000lbs](https://avatars.discourse-cdn.com/v4/letter/l/a3d4f5/32.png) [@lay2000lbs](https://gov.pareto.credit/u/lay2000lbs)\
**Post date:** [April 15, 2021, 4:30pm UTC](https://gov.pareto.credit/t/grant-add-idle-as-a-yield-source-on-pooltogether/413/6 "2021-04-15T16:30:02Z")

</div>

Hey all! Super excited to see this is being worked on! PoolTogether Inc would be happy to match the bounty being provided by IDLE assuming an integration can be built up to our minimum standards. A few notes from our side:

- I would’t follow the Sushi integration as a template as it wasn’t built the best way, use the Aave integration: [aave-yield-source/ATokenYieldSource.sol at main · pooltogether/aave-yield-source · GitHub](https://github.com/pooltogether/aave-yield-source/blob/main/contracts/yield-source/ATokenYieldSource.sol)

- Integration should follow the contribution guidelines here: [📐 Smart Contract Guidelines - PoolTogether 3.0](https://docs.pooltogether.com/contributing/smart-contract-guidelines)

Let us know any questions! Excited to have this done!!

---

<div class="post-metadata">

**Author:** ![unicorn](https://yyz1.discourse-cdn.com/flex031/user_avatar/gov.pareto.credit/unicorn/32/48_2.png) [@unicorn](https://gov.pareto.credit/u/unicorn)\
**Post date:** [April 16, 2021, 12:43am UTC](https://gov.pareto.credit/t/grant-add-idle-as-a-yield-source-on-pooltogether/413/7 "2021-04-16T00:43:32Z")

</div>

hi @gggggg and @sunnyRK I am really happy to see you guys getting excited and building cool stuff for Idle 🚀

Idle will always be the best as long as we can keep talented members on-board!

I will ask @william to transfer my 25 $IDLE to @sunnyRK and I will DM @gggggg to add 25 $IDLE out of my pocket.

Thanks @lay2000lbs for supporting… This is the best of blockchains.  
🙏

---

<div class="post-metadata">

**Author:** ![william](https://yyz1.discourse-cdn.com/flex031/user_avatar/gov.pareto.credit/william/32/10_2.png) [@william](https://gov.pareto.credit/u/william)\
**Post date:** [April 16, 2021, 2:46pm UTC](https://gov.pareto.credit/t/grant-add-idle-as-a-yield-source-on-pooltogether/413/8 "2021-04-16T14:46:15Z")

</div>

I’m pumped to see such a supportive community and the integration soon live, thanks @lay2000lbs and @unicorn ! 😁

---

<div class="post-metadata">

**Author:** ![Salome](https://yyz1.discourse-cdn.com/flex031/user_avatar/gov.pareto.credit/salome/32/258_2.png) [@Salome](https://gov.pareto.credit/u/Salome)\
**Post date:** [April 16, 2021, 8:27pm UTC](https://gov.pareto.credit/t/grant-add-idle-as-a-yield-source-on-pooltogether/413/9 "2021-04-16T20:27:29Z")

</div>

Great to see that we can move on with this innovative integration! Very excited to see this come to life soon 🚀

In order to spin-off the process, we officially launch this grant formulated here from @gggggg.  
Since @gggggg already used the Idle template for grants we can now confirm that this is an officially approved grant, confirming the allocation of the Budget of **250 $IDLE + matching grant by pooltogether** by the Pilot League Committee.

> [@gggggg](#):
>
> **[GRANT] Add Idle as a yield source on pooltogether**
> 
> ### Abstract
> 
> PoolTogether is a decentralized protocol for no-loss prize games on the Ethereum blockchain. Prize games are pools of funds whose accrued interest from the yield source is distributed as prizes. Pooltogether allows adding custom yield sources. This proposal is to add idle pools as a yield source.
> 
> ### Scope of the Work
> 
> The work involves writing contracts to add idle as a yield source and testing integration with pooltogether contracts.  
> Current WIP repo: [GitHub - 0xrs/idle-pooltogether](https://github.com/0xrs/idle-pooltogether)
> 
> ### Discussion Links
> 
> The idea was proposed by @unicorn on discord [here](https://discord.com/channels/606071749657755668/606071749657755670/831296295850868756)  
> Pooltogether: [Website](https://pooltogether.com/) and [Docs](https://docs.pooltogether.com/)
> 
> ### Budget
> 
> _250 $IDLE_ + matching grant by pooltogether [edited]
> 
> ### Team
> 
> @sunnyRK and @gggggg (both have contributed to idle before through gitcoin grants)
> 
> ### Timeline
> 
> Hard deadline for final delivery is 30th April (factoring in time for testing + review)

---

<div class="post-metadata">

**Author:** ![petar](https://yyz1.discourse-cdn.com/flex031/user_avatar/gov.pareto.credit/petar/32/838_2.png) [@petar](https://gov.pareto.credit/u/petar)\
**Post date:** [April 22, 2021, 1:50pm UTC](https://gov.pareto.credit/t/grant-add-idle-as-a-yield-source-on-pooltogether/413/10 "2021-04-22T13:50:08Z")

</div>

Awesome idea! Looking forward to seeing it implemented. I’ll def pool my IDLEs

---

<div class="post-metadata">

**Author:** ![sunnyRK](https://yyz1.discourse-cdn.com/flex031/user_avatar/gov.pareto.credit/sunnyrk/32/304_2.png) [@sunnyRK](https://gov.pareto.credit/u/sunnyRK)\
**Post date:** [May 9, 2021, 3:00am UTC](https://gov.pareto.credit/t/grant-add-idle-as-a-yield-source-on-pooltogether/413/11 "2021-05-09T03:00:36Z")

</div>

Hey Team,

> **[sunnyRK/IdleYieldSource-PoolTogether](https://github.com/sunnyRK/IdleYieldSource-PoolTogether)**
>
> Contribute to sunnyRK/IdleYieldSource-PoolTogether development by creating an account on GitHub.

I have made changes in the smart contract as @william suggest to me on DM  
and also @Brendan from pooltogether suggests on DM very good instructions for the mock test, Fork script, and code coverage badge…  
both suggestions are done…  
let me know if changes needed…  
Plz have a look if you get time:)

---

<div class="post-metadata">

**Author:** ![william](https://yyz1.discourse-cdn.com/flex031/user_avatar/gov.pareto.credit/william/32/10_2.png) [@william](https://gov.pareto.credit/u/william)\
**Post date:** [May 10, 2021, 5:40pm UTC](https://gov.pareto.credit/t/grant-add-idle-as-a-yield-source-on-pooltogether/413/12 "2021-05-10T17:40:37Z")

</div>

Thanks for the work so far. I reviewed the code and sent some minor comments on Discord, but looks good to me for the Idle side!  
@lay2000lbs and @Brendan let us know if all the guidelins have been followed and in if we can officialy close the grant.

---

<div class="post-metadata">

**Author:** ![lay2000lbs](https://avatars.discourse-cdn.com/v4/letter/l/a3d4f5/32.png) [@lay2000lbs](https://gov.pareto.credit/u/lay2000lbs)\
**Post date:** [June 1, 2021, 12:59am UTC](https://gov.pareto.credit/t/grant-add-idle-as-a-yield-source-on-pooltogether/413/13 "2021-06-01T00:59:52Z")

</div>

Looping back on this, we are going to include the IDLE integration in our upcoming audit (scheduled to be competed in June). Once this is done it means:

1. Anyone can create a prize pool for any asset IDLE supports
2. We can submit a specific prize pool to POOL governance to be incentived with POOL token distribution

---

<div class="post-metadata">

**Author:** ![Salome](https://yyz1.discourse-cdn.com/flex031/user_avatar/gov.pareto.credit/salome/32/258_2.png) [@Salome](https://gov.pareto.credit/u/Salome)\
**Post date:** [June 3, 2021, 8:15pm UTC](https://gov.pareto.credit/t/grant-add-idle-as-a-yield-source-on-pooltogether/413/14 "2021-06-03T20:15:46Z")

</div>

The Treasury League & Dev League have finalized the review of the work delivered by @sunnyRK. We, therefore, proceed now with the payment of **250 $IDLE** , which is going to be paid in the following days 💸. Update on the payment transaction will follow.

Thanks to @sunnyRK for the great work and the outcome for the Idle community 👨‍👩‍👧‍👦 ❤.

---

<div class="post-metadata">

**Author:** ![Salome](https://yyz1.discourse-cdn.com/flex031/user_avatar/gov.pareto.credit/salome/32/258_2.png) [@Salome](https://gov.pareto.credit/u/Salome)\
**Post date:** [June 4, 2021, 4:47pm UTC](https://gov.pareto.credit/t/grant-add-idle-as-a-yield-source-on-pooltogether/413/15 "2021-06-04T16:47:27Z")

</div>

The payment is processed, see details for verification below:

- **250 IDLE** to **0x176c5Ef0FDf36736F9F1F1AC9376D6Dbb893cA14**  
**Hash** : 0xfbd09ff64f3350e042a9080d86a71d0e15e54b40c2d38db0ffa30880131e7c7f

Thanks again for your work @sunnyRK 👏

CC: @lay2000lbs

---

<div class="post-metadata">

**Author:** ![sunnyRK](https://yyz1.discourse-cdn.com/flex031/user_avatar/gov.pareto.credit/sunnyrk/32/304_2.png) [@sunnyRK](https://gov.pareto.credit/u/sunnyRK)\
**Post date:** [June 4, 2021, 6:48pm UTC](https://gov.pareto.credit/t/grant-add-idle-as-a-yield-source-on-pooltogether/413/16 "2021-06-04T18:48:22Z")

</div>

Hey @Salome ,  
Thank you, I got the 250 IDLE Payment!!

---

<div class="post-metadata">

**Author:** ![capncook](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@capncook](https://gov.pareto.credit/u/capncook)\
**Post date:** [August 28, 2021, 6:57pm UTC](https://gov.pareto.credit/t/grant-add-idle-as-a-yield-source-on-pooltogether/413/17 "2021-08-28T18:57:42Z")

</div>

Since the Polygon integration is around the corner - can we use this strategy in a similar way on Polygyon since PT can be used as a source there?
