Inspiration
Sports Statistics and Gaming has always been a strong interest of our team. Originally, we sought to create an odds-finding model. When planning this we thought about what sports odds truly were and came to the conclusion that sports odds are just an abstract estimate of a chaotic event’s probability. A game’s odds are not an objective existing proven fact, but rather a subjective perception of an outcome, created by a casino, model, or bookie. We strayed further down this ideological rabbit hole of what odds truly meant, and in doing so, thought of a new way to create them. Instead of using a model, scouting players, or looking at historical trends, we’d create odds by crowdsourcing public opinion, and through the law of large numbers, generate odds that accurately mirror the perceived consensus outcome of an event. This then led to the question of how to get this group consensus. Simple: have people put their money where their mouth is. We’d create a betting platform where the odds are solely determined by how the users decide to place their bets.
What it does
LetsBet is a decentralized peer-to-peer sports betting social platform. By decentralized we mean there is no central entity (bank, casino, bookie) taking in these bets. User’s purely bet against or with other users on the platform. This is best explained through an example:
Step 1: Jake bets $10 that Tom Brady will throw for at least 4.5 touchdowns next week. Step 2: Another user matches the bet. Sid thinks that Tom Brady will throw for under 4.5 touchdowns next week. He matches Jake’s bet. Step 3: The bet goes live to the public, and users buy equity. Zach sees this bet and agrees with Jake. He bets $30 on the over. The total pot for the over is now $40, of which Jake has 25% and Zach 75% Step 4: The game starts and the bet closes. Tom Brady throws for 6 touchdowns. Since over wins, all users with equity in the winning pot, get their proportion of the losing pot. Jake would win $2.50, Zach $7.50, and Sid would lose $10. This process of a user placing a bet about any player or team performing any statistical feat in terms of a spread bet or over/under bet, another user matching this bet, and then the line launching to the public for all users to buy shares in is the core of our project.
How we built it
LetsBet runs on an HTML/CSS webpage with a Flask Python backend, and data is stored in an SQLite database. User-submitted information is sent to the backend, where Python functions sort data using Pandas and Numpy and web-scrape using Selenium and BeautifulSoup4. These functions return variables that are then displayed on the webpage using Jinja templates.
Challenges we ran into
A challenge that we faced was being able to verify which side wins a bet. Our original idea was to use an API to get the data for every team and player involved in a bet. However, after writing the code, we came to the unfortunate conclusion that the API was not the best solution. The API call was too slow, the API charged a subscription fee to access the advanced data analytics, and most importantly had inaccurate data, such as 0.3 touchdowns for a QB, which is impossible in football. Our solution to this dilemma was to switch to web scraping using Selenium and BeautifulSoup4 on Basketball Reference for the NBA statistics and Pro Football Reference for the NFL statistics. This allowed us to create pandas DataFrame structures of player and team statistics for any game, given one team and the date. Furthermore, we spent a lot of our time on exception testing, effectively dummy-proofing our project. This was crucial for LetsBet because we need precise information to guarantee accurate bets that the users desire involving their hard-earned money.
Accomplishments that we're proud of
An accomplishment that we’re proud of is learning Flask in less than 36 hours. Since most of our team experience was with back-end coding, one of us had to step up to handle the front end. This involved learning a new technology from scratch and basing our entire project around it. At first, it was difficult to learn the file structuring and syntax, and very frustrating as we received many service/request errors, but then everything started to come together.
What we learned
One major lesson we learned was the importance of teamwork in the division of labor. At first, we all started to work on the backend code but eventually realized that we kept stepping on each others’ toes and that there would be no front end. As a result, we decided to have half of our team work on the backend code while the other half of the team worked on the front end. After both teams had done a considerable amount of work, we met up again to work on integrating the two together. Another major lesson we learned was the importance of proper documentation in code. We had a few instances where there were bugs in our program due to team members calling the same variable by different names. Additionally, we realized that adding comments to our code and creating descriptive variable names would help each other as well as a third party understand the code.
What's next for LetsBet
We would love to expand our betting services to include live in-game bets, which would have a much shorter duration and involve quicker payouts. That, in our opinion, would serve to fill the opportunity of sports enjoyers' egos when they are willing to bet that a certain outcome will occur in the short-term, such as a claim of “I bet Tom Brady will throw an interception on the next play”. Aside from that, considering that this is a decentralized betting platform, we believe that the next step in securing the financial transactions would involve the incorporation of Blockchain technologies and expanding to Cryptocurrency payments. We believe it would be a great idea to include social networking to allow people to become friends in order to see each other’s bets as well as bet against each other. This would make the program more enjoyable for the users as they would have even more freedom in the bets they place, such as a private bet open to only their friends. Finally we would like to add a feature where users can trade, buy, and sell the shares that they have bought in their bets.
Log in or sign up for Devpost to join the conversation.