Inspiration

I want to create a no-loss game using different leading platforms and trustless manner for choosing a winner after a period of time. I am working on this idea from the previous hackathon of chainlink at Gitcoin.

So, This is our second phase for this project. In the first phase, we already used chainlink alarm clock and AAVE lending. But this time we are introducing Chainlink VRF and even more option for the lending opportunity using yearn.finance. Because I can understand to choose a winner is a difficult task on on-chain. So, Chainlink-VRF will be the best option for us to implement.

What it does

yield-game is a no-loss and crypto saving platform to win interest using trustless blockchain technology. Using chainlink alarm clock, chainlink VRF function, yearn.finance and AAVE protocol

How I built it

This is our second phase. 

In the first phase during Gitcoin Hack, we only introduce Chainlink Alarm clock and AAVE.

This time we give more ability to platform to generate interest and select trustless winner using Chainlink VRF Function.

To generate interest,  
1). yield farming using yearn finance  
2). AAVE lending protocol  

Note: Pod is where all participants come and deposit crypto tokens.

When Contract owner will create POD, It chooses method to generate interest from yearn finance(Yield Farming) or AAVE. And it triggers the chainlink alarm clock to wait until to finish time-period.

During this time period, it accrues interest on the deposited crypto token which is deposited by participants(staker). And during this time period, anyone can see live interest generate on the dashboard.

Once Time-period complete the chainlink-alarm-clock recognize it. and then using the callback function of chainlink-alarm-clock, it triggers the chainlink VRF function to get the winner among participant using randomness functionality of VRF.

once Chainlink VRF decides the winner, the admin needs to disburse all the original tokens to all users and "original token + interest" to the winner.

Challenges I ran into

I am using the 2 protocols one is aave and second is yearn to generate interset or yield farming. So, how they work together with these. then after brainstorming with community members I got to know. And how to automate winner result. so then, I used chainlink alarm clock which will wait until time period and automatically calls the Chainlink VRF function to decide the winner.

Accomplishments that I'm proud of

Automation of winner declaration using a chainlink alarm clock and VRF. which was the biggest challenge for me to do on-chain. which is now possible by chainlink. And integrate 2 lending protocols to accrue the interest. which give the advantage of yield farming.

What I learned

I can say now I can use any defi lego or protocol and can integrate with the platform.

What's next for chain-yield-game

This is already the second phase for this project in this hackathon. We are the initial level of defi or student you can say. So, We want to audit the contracts. So, we can confirm that smart contract is ready for mainnet.

Built With

  • aave
  • chainlink-alarm-clock
  • chainlink-vrf
  • react.js
  • web3.js
  • yearn.finance
Share this project:

Updates