Put your ETH where your mouth is
Welcome to Predict ETHSF, a decentralized prediction market built by Stably. The premise is simple - find a team, put an ETH stake behind them, and reap the rewards if they win the hackathon. And if your team wins, you'll get a portion of the total staked ETH!
- 20%: Top 10 winners of the hackathon will get 2% each of the total staked ETH
- 80%: All accounts that put a stake in the winning teams will proprotionately split the remaining ETH
How It Works
If you are a hackathon team: Click register on the top right of the site, and enter your project information. Make sure you have MetaMask or a similar client installed on your browser - once you hit submit, provide the Ethereum wallet address that you would like to be paid out to. If your team is announced as a winner, you will be paid out 2% of the total staked ETH!
If you want to place a stake: Find a team below that you think will be among the 10 winners for the hackathon and then choose an amount of ETH you want to stake behind the project. Make sure you have MetaMask or a similar client installed on your browser, and link the Ethereum wallet address you want to use. If you chose a winning team, you will be paid out proportionately to the rest of the winners, based on the size of your stake.
How we built it
We built Ethereum smart contracts to handle several actions:
- The creation of a new hackathon project, with winners being paid out to their respective Ethereum address
- A user putting down a stake on a hackathon project
- Stopping the creation of new teams and accepting bets
- Paying out the winners and accounts who staked on the winning teams
The backend was built with Flask and hosted on AWS on Lambda and EC2. The database used was DynamoDB. The backend handles the following:
- Website hosting
- High availability and throughput data stores for the frontend
- Updating state based on the Ethereum network
- Registers new hackathon projects
- Displays registered hackathon projects and corresponding informaiton, such as: name, description, project screenshot, link, implied odds to win, total ETH staked
- Allows users to put down an ETH stake on a project
Challenges we ran into
Creating a user experience that was both straightforward as well as resistant to attack was a consideration that forced us to go back to the drawing board multiple times. We wanted users to have faith that their submissions could not be tampered with but still make the user experience minimal and intuitive.
Accomplishments that we're proud of
We created a flexible user experience, where we make it dead simple to list new projects as well as vote on existing ones. Anyone can visit the site to see listings without a web3 enabled client and our service scales up to thousands of users out of the box with our serverless infrastructure.
What we learned
Creating a fun and easy to use Ethereum experience is still hard! We had to hack together a lot of functionality that you might expect there to be dev tools or libraries for, such as parsing our own Events and supporting multiple formats of web3 injection.
What's next for Predict ETHSF
We tried to take a slightly unique approach to the hackathon - this project was something fun we designed specifically to live just for this weekend. However the code is generalizable to other betting games where there are N of M winners. It could also be used for other hackathons - as we learned, this would be much better as something that was set at the beginning of the event, rather than us trying to get users at the end.