Inspiration
Prediction markets are one of the most powerful tools for aggregating collective intelligence about the future. Platforms like Kalshi — the only federally regulated prediction exchange in the U.S. — and Polymarket — the largest decentralized exchange by volume — represent a genuinely new financial primitive. But there's a problem hiding in plain sight: the same market trades at different prices on different platforms, simultaneously, all the time.
A trader on Kalshi might pay 58¢ for a YES share that's trading at 54¢ on Polymarket right now. They're leaving money on the table on every single trade, and they don't even know it. Capitalizing on this today means maintaining accounts on multiple platforms, manually switching between dashboards, and converting between USD and USDC on the fly. Most traders don't bother — so the inefficiency persists.
We wanted to build the infrastructure that makes this problem disappear entirely: one account, one interface, always the best price.
What It Does
UniFeed is a unified prediction market terminal that aggregates Kalshi and Polymarket into a single interface.
Smart Order Routing — At the moment you place a trade, our engine compares live prices across both platforms and automatically routes your order to the better deal, showing you exactly how much you saved in the order preview.
AI-Powered Market Sentiment — Before you bet, our backend fetches real-time news articles and online discussions, runs them through the Gemini API, and returns a plain-English sentiment summary — bullish, bearish, or mixed — so you can trade with more context than any single-platform user has access to.
Unified Portfolio & Full Trade Lifecycle — Deposit funds, place YES or NO bets, and sell positions at any time to recover your stake. All positions across both platforms appear in one portfolio view. Balances update in real time across the entire UI.
Crypto Wallet Integration — Connect MetaMask or any WalletConnect-compatible wallet for Polymarket's USDC-based markets, with token swaps handled via 1inch. By integrating Solana wallets as a deposit option, we can allow for fast, low-fee transactions.
How We Built It
Frontend: Next.js (App Router) with TypeScript, Tailwind CSS, and shadcn/ui components. RainbowKit and Wagmi handle wallet connection and on-chain balance reads. We built a dark-mode glassmorphism design with micro-animations, color-coded platform indicators, and a shimmer effect on the AI sentiment card.
Backend: FastAPI with Uvicorn and a SQLite database layer covering users, balances, bets, wallets, and settings — all secured with JWT authentication. Separate routers handle markets, bets, portfolio, deposits, settings, and token swaps. Smart contract layer inspired by popular crypto-based applications.
AI Analysis Pipeline: On each market page, we fire an async request that fetches news from NewsData.io and community discussions from Brave Search, feeds both into Gemini for combined sentiment analysis, and returns the result to the frontend.
Market Data: We aggregate live data from both Kalshi's and Polymarket's public APIs, normalize it into a unified schema, and serve it through our own /api/markets endpoint — the frontend never talks to two different exchanges directly.
Challenges We Ran Into
Silent API failures — Mid-development we hit NewsData.io's free-tier quota. The response silently changed shape: results went from a list of articles to a dictionary containing an error message. This caused a cascading crash in our analysis endpoint with no visible error on the frontend. We had to add defensive type-checking on every third-party response.
Cross-platform data normalization — Kalshi prices are in cents; Polymarket prices are USDC-denominated with different volume semantics. Building a unified Market type that accurately represents both platforms without misrepresenting either required careful schema design.
State synchronization across surfaces — The Kalshi balance appears in the navbar, the order form, and the portfolio — all driven by different data sources. After every user action (buy, sell, deposit), every surface needed to update instantly. We solved this by threading refreshUser() through every mutation and using custom browser events as a lightweight cross-component signal.
Component duplication bug — When we added the Buy/Sell tab system to the order form, we accidentally left the old unconditional buy form in place alongside the new conditional one. Both rendered simultaneously, causing a visually duplicated UI that was invisible until runtime.
Accomplishments That We're Proud Of
A real, working trade lifecycle — Deposit funds, place a bet, watch your balance drop, switch to the Sell tab, sell the position, watch the funds return. No mocked state, no hardcoded values — real database writes and real balance arithmetic on every action.
Smart routing that does actual math — The engine compares live prices on every single trade, picks the winner, and shows the user the savings in dollars. It's not a simulation.
Gemini in the critical path — Getting an LLM into a live financial interface without making it feel laggy required async pipeline design and thoughtful UX. The shimmer animation during loading makes the wait feel intentional.
A UI that doesn't look like a hackathon project — Dark-mode glassmorphism, smooth micro-animations, color-coded platform branding, and consistent spacing across every card. We're proud it looks production-ready.
Built With
- gemini
- kalshi-api
- next
- polymarket-api
- python
- react
- tailwind
- typescript
Log in or sign up for Devpost to join the conversation.