PLEASE WATCH THIS VIDEO BEFORE WATCHING OUR SKIT

https://www.youtube.com/watch?v=5o0B-ULR_cM The skit is funnier if you understand the reference.

Inspiration

We feel that too many young men are affected by the gambling industry, especially sports betting, which is designed to suck you in and keep you losing. Many of these young men enter into a pit that is almost impossible to escape of, the pit of a gambling addiction. We wanted to alleviate this by making bets a casual, friend-only activity, and that's why we built Wagr. Wagr allows you to express your own creativity by customizing fun bets with your friend group and keeps gambling a social activity only.

What it does

Wagr allows you to bet on either custom events (e.g. "Will my friend talk a girl tonight?" or "Who's gonna show up latest?") or on sport events with custom bets (e.g. "Will Real Madrid beat Barcelona with Mbappe scoring a hat-trick?" or "How many goals will Romania score versus Turkey?").

Bet Types

There are 3 types of bet types that allow you to choose the best one for your bet: moneylines (i.e. binary bets, 2 choices), n-way moneylines (i.e. n choices) and target proximity bets (i.e. bets that deal with numbers, you choose a target and whoever gets the closest target wins). With each of these bets, you can set custom options, which adds to the creativity aspect we wanted to achieve. The stake amount (i.e. the amount each user that enters a bet has to put in) is capped at $25, which is done explicitly to keep it casual and fun, where the loss is never going to be truly detrimental to one's life.

Social Aspects

The app also features many social aspects, including league (group) stats (e.g. most bets placed, best PnL, etc.) and personal stats (e.g. win rate, greatest win, etc.). You as a user also have a balance that will update according to your wagers placed and PnL incurred. A special type of user is the "commissioner", which is first the creator of the league, but any user in the league can be made commissioner. The commissioner is the "admin" with the responsibility to resolve all bets (i.e. end them and say if the bet hit or not, which will then distribute the payout accordingly using our betting logic). The commissioner should be agreed upon outside the app by the league members to be an impartial judge, identical to how a commissioner in a fantasy league operates.

How we built it

We built the app using Expo for the frontend to create an iOS app since it should be something easy to use with your friends. The backend was done in Python, with a database created using MongoDB. The use of AI and agents was used primarily to connect these distinct sections, and an agent (Gumloop) was used heavily in the sports betting aspect of the app, since it continuously fetches games and changes bets accordingly. The betting logic is an integral part of the app, and is quite nice.

The moneyline (binary) payoff is as follows: The payoff (for winners, the losers get 0) is calculated using this equation: $$ Payoff = b\times(\frac{(1-p)M}{M_{win}}) $$ where b is the bet placed by the player, p is the cut Wagr takes, M is the total amount wagered by all players and M_win is the total amount wagered by the winning players. M is just a sum of all players' bets, where n is the number of players and b_i is the bet wagered by player i.

The n-way moneyline (multiple choice) payoff has identical payoff scheme, with the winning players being chosen for only one outcome out for the n outcomes.

Finally, for the target proximity bets, the math is a bit more complicated (and nicer!). We had to decide how the payout would be distributed depending on how far a player is from the target, should the distribution be flat or should it be centered around the mean? We chose to be closer to the latter, i.e. make it proximity-weighted: $$ Payoff = \begin{cases} (1 - p) \times effectiveWeight \times (\frac{M}{W}),\hspace{5pt}if M > 0\hspace{5pt}and \hspace{5pt}W > 0 \ 0, \hspace{5pt} o/w \end{cases} $$ where W is the sum of effective weights and the effective_weight is defined by $$ effectiveWeight = b \times exp[\frac{-|g - T|}{s}] $$ where g is the guess of a player, T is the target and s is a scale parameter that when lowered increases the proximity weighting of the distribution (currently at 3).

Challenges we ran into

The biggest challenge we ran into was connecting the three distinct parts of our app (frontend, backend, database) together, as we first worked in a very siloed way. Another challenge was state management across these parts was also a big challenge as the dataflow became complicated as the app grew in scope.

Accomplishments that we're proud of

We are proud that we were able to mathematically model these bets in a super clean and efficient way, and that we were able to connect each siloed part of the app.

What we learned

We learnt that we have to create better architecture and think more about the software design before we start, as being too siloed caused complications down the line. We also learnt that defining a scope for the app and completely agreeing on features and implementation even if you weren't on the team doing that part was necessary as that created some conflicts as the project went on.

What's next for Wagr

More sport events (it's currently only soccer), more social aspects, better authentication so its truly friends-only, better payment system and more seamless state updating.

Built With

Share this project:

Updates