Inspiration

Today's market is flooded with thousands of fantasy sports app which claims to make you money by playing on their platform, but how much should we trust them?. On these platforms users trust the brand and play the online fantasy game hoping that the brand will provide them the equal opportunity but in reality, the brand can easily favor some selected group.

Real Sports Dapp minimizes the trust with the help of smart contracts, blockchain, and oracle networks, it provides the users with an equal opportunity and transparency.

What it does

Real Sports Dapp provides a fantasy gaming platform for fantasy cricket, It is an online game where users create a virtual team of real-life players and earn points based on the performances of these players in real matches. A user who scores the maximum points in their joined contests attains the first rank on the leaderboard. A user has to pay a certain fee to join a contest and can win.

How we built it

In order to get the data about scores of a player in a match I use the Any API feature of chainlink and then the smart contract calculates the scores of every team in a contest and calculates the winner accordingly. The Dapp frontend is built using next js, use Moralis for database, and also for web3 connectivity. Moralis live query feature is used to update the data on the frontend in real-time and also used moralis cloud functions. The smart contract is developed and tested using the hardhat library.The dapp is deployed to the Polygon Mumbai Testnet.

Challenges we ran into

The creation of an external adapter to get the response from the API in a proper format for the chainlink oracle is a new thing that I tried for the first time which took some time and the fulfill function also returns an array of uint256 which was a little difficult to implement with chainlink any API. In the end, was able to get the data to the smart contract in the proper format from the API with an external adapter successfully.

I also intend to use chainlink keepers to automate the winner selection but due to time constraints not able to finish it.

The use of the moralis cloud function is a new experience and take some time to implement.

Accomplishments that we're proud of

creating a smart contract that takes off-chain data from a cricket API to get the scores and then finding out the winner is a great task that I am proud of.

What we learned

When we started the hackathon we had a limited understanding of how decentralized oracle networks are solving the oracle problem, but in the process of getting the off-chain data from the API and external adapters, I learned the importance of chainlink in the smart contract world. with the help of chainlink docs, I was able to learn about the chainlink keepers and chainlink any API which I used in this project.

What's next for Real Sports Dapp

Next, I want to finish off the addition of chainlink keepers in the smart contract to automate the selection of winners whenever a contest ends.

secondly, right now the Dapp only provides a platform for cricket and will add other sports such as hockey, football, baseball, and basketball so that all sports lovers can see the beauty of decentralized fantasy dapp.

Built With

Share this project:

Updates