Inspiration
Our inspiration came from the observation that intramural sports, while incredibly fun to play rarely capture the attention of the wider campus community. We wanted to bridge this gap by bringing the interactive nature of prediction markets to our own campus. By allowing students to wager virtual currency on their friends' intramural games and ultimately trade their winnings for high-value raffle prizes, we can transform everyday matchups into highly anticipated events. This gamified approach fosters deep community engagement, amplifies rivalries, and injects real excitement into the local sports ecosystem without the risks of real-money gambling.
What it does
PolyJacket is a sports prediction market platform where users trade shares on the outcomes of real basketball games. Users start with 500 tokens and can:
- Buy and sell shares on game outcomes with prices that shift based on market activity using an LMSR (Logarithmic Market Scoring Rule) pricing model
- View live price history charts for each game with multiple time windows
- Chat publicly about games in real time, including reporting and voting on live scores
- Earn raffle tokens by placing bets, which can be redeemed for discounted bulk raffle ticket bundles to win Actian Mystery Swag
- Track their portfolio with live profit/loss calculations
How we built it
- Backend: Python + FastAPI with a SQLite database, using LMSR for automated market making and real-time price discovery
- Frontend: Single-page Vue.js application with Chart.js for price history visualization, served as static files through FastAPI
- Data: Live game data scraped and refreshed on a background loop to keep markets up to date
- Auth: Session-based authentication with bcrypt password hashing
- Market lifecycle: Automated market creation, closing, settlement, and push logic — including a background job that refunds bets on games with no posted result by the next day
Challenges we ran into
- LMSR pricing stability: Tuning the liquidity parameter
bto make trades feel impactful without wild swings in low-volume markets took significant iteration - Negative balances: Floating point precision in the LMSR cost function produced
-0.0values that slipped throughmax()checks — requiring explicit guards at both the application and database layers - Market persistence vs. refresh: The background refresh loop was overwriting settled and pushed markets back to
closedon every cycle, undoing payouts. Fixed by skipping any market already in a terminal state
Accomplishments that we're proud of
- A fully functional automated market maker that prices odds dynamically based on real trading activity
- A complete trade lifecycle, buy, sell, settle, push, with accurate profit/loss tracking
- A real-time public chat with score reporting and upvote/downvote verification, keeping the community honest about live scores
- A raffle system that rewards active traders with discounted bulk ticket tiers and an admin-controlled draw system
- An admin panel that lets organizers manually settle games, run multiple raffle draws, and manage the raffle lifecycle without touching the database
What we learned
- LMSR is a powerful but nuanced pricing mechanism, small changes to
bhave enormous effects on market feel, especially at low volume - Vue's reactivity system is excellent for real-time UIs but requires careful DOM lifecycle management when integrating third-party libraries like Chart.js
- Building a fair market requires thinking about manipulation vectors at every step, initial liquidity, trade size limits, and settlement integrity all matter
- Keeping a tight feedback loop between market mechanics and user experience is critical: numbers that look right in isolation can feel completely wrong in practice
What's next for PolyJacket
- Live in-game markets: Dynamic odds that update as the game progresses, not just pre-game
- Social features: User profiles, leaderboards, and the ability to follow other traders
- Real prize tiers: Multiple concurrent raffles with tiered prizes based on platform activity
- Mobile app: Native iOS/Android experience for on-the-go trading
- Machine learning: Smarter initial odds seeding using historical matchup data beyond basic Elo ratings
Built With
- bcrypt
- chart.js
- fastapi
- html/css
- javascript
- passlib
- python
- sqlite
- uvicorn
- vue.js
Log in or sign up for Devpost to join the conversation.