NFTs to De-risk your Bets

Harsha R
3 min readOct 14, 2021

--

In my previous posts I discussed a DApp to bet on football matches.

Quick Recap: We use External Adapters to bring off-chain data (in this case football match results) on-chain. This is done through a Chainlink Oracle Node. The results are used by the Smart Contract to settle bets and transfer the winnings.

Problem Statement

A week before the big match, Chelsea vs. Liverpool, Bob places a $100 bet on Liverpool. He could potentially win a $1000 from this position.

But two days before the match, Liverpool are in the midst of an injury crisis, with most of their top players injured and unable to take part. Bob realises that Liverpool’s hopes and his chance at winning the bet are slim. He now realises he will most likely lose all of his bet.

Liverpool Injury crisis

Solution:

On FootyOracle, Bob could convert his bet into an NFT and list on OpenSea. This will allow, someone with a higher risk profile, Alice, to consider buying Bob’s position.

Convert your bet to NFT on FootyOracle

In this scenario, Bob will list his original bet of a $100 (with potential winnings of $1000) at a reduced price of $20 in the hope that someone would purchase. Alice, considers this a bargain. For $20 she could purchase a bet, that could potentially win her $1000. We assume that Alice is aware of the risk involved and is fully aware of Liverpool’s injury crisis.

Alice buys the NFT on Opensea for $20

If Liverpool win the match, Alice can bring her NFT to FootyOracle and redeem her winnings.

Alice redeems her NFT for $1000 (the position Bob had taken)

If Liverpool don’t win, Alice still has an NFT to remember the match.

Converting Bets to NFTs — A Secondary Market

NFTs created on FootyOracle are similar to Uniswap LP Tokens. They represent a financial position and allow the creation of a secondary market.

Advantage to Bob: He may have to sell his bet at a lower value than his original payment. He gets something when the chances of winning are pretty low. Bob has managed to re-coup something from a position where he could have lost all of his bet.

Advantage to Alice: Alice, with a higher risk appetite, can purchase the NFT associated with the bet. She purchases the financial position at a lower value and very high potential winnings.

How we built it

Moralis for smart contract administration.
UI — Vue JS and Typescript
Smart contract deployed on Polygon for low-gas fees.
Chainlink to bring football match results on-chain.
IPFS to store NFT/Bet metadata.
BetNFT is a wrapper around ERC721 standard from OpenZepellin
External Adapter in Javascript to fetch football match results.

Future Work

Extending sports betting to Fantasy would be an interesting challenge. The real problem lies in bringing large amounts of data on-chain. Fantasy sports requires player stats, game stats and historical data to arrive at a reasonable value. There needs to be an easy way to store this information securely and fetch it in a decentralised manner.

This work was done as part of the Ethonline hackathon by Harsha R, Frank Kohn and Baraa Elalami.

--

--