Inspiration
We wanted prediction markets to feel like something other than a spreadsheet. Clash Royale gave us the metaphor: two armies facing off across a shrinking or expanding front line, where every soldier on the field is really just a slice of real order-book depth. The harder, more interesting idea underneath that was combining three things that don't usually show up in the same hackathon project: a live financial data feed (Polymarket), a real time-series database built for exactly this kind of data (Tiger Data), and an actual blockchain wallet (Solana) — not as separate demo boxes to check off, but wired together into one thing you can actually play.
What it does
Battlecoin is a gamified trading arena built on Polymarket's live BTC "Up or Down" markets. You sign up with a real account (bcrypt-hashed, stored in Tiger Data), and get a real Solana devnet wallet generated for you. Deposit real devnet SOL, convert it into simulated trading capital via an actual on-chain transfer to a house vault, then drag pixel-art troop cards onto the battlefield to place trades against the live market. Troops on the field represent aggregated order-book depth, not individual traders; the front line — the shared UP/DOWN territory split — moves with a live size-weighted microprice: $$ \text{microprice} = \frac{\text{ask} \cdot \text{bidQty} + \text{bid} \cdot \text{askQty}}{\text{bidQty} + \text{askQty}} $$
Every trade event — a fill, a cancel, a closed position, an order expiring when the round rolls over — gets written to a TimescaleDB hypertable, so your trade history survives a page reload instead of vanishing with the tab.
How we built it
The stack is React + Vite + PixiJS v8 on the frontend, FastAPI + asyncpg on the backend, Tiger Data (TimescaleDB) for storage, and @solana/web3.js for wallets — all devnet. We didn't start there. The build went in layers: a plain username/password placeholder first, then real Solana wallets, then adopting and merging a teammate's standalone live-market-arena prototype into the login/sidebar shell we'd already built, then a real FastAPI backend to replace localStorage, then trade-history persistence, then a full pixel-art visual pass — ambient scenery, wind-animated flags, pixel-shatter hit effects, an animated tutorial — layered on top without touching the underlying market logic.
Challenges we ran into
- The devnet faucet rate-limits aggressively. We ended up running a local solana-test-validator for development and only pointing at real devnet for the actual demo build.
- Real git conflicts, not toy ones. With multiple people — and multiple AI pair-programming sessions — pushing to the same branch, we hit a genuine collision: two different pixel-font systems (a real PixiJS BitmapFont atlas vs. a simpler web font) landed in the same file at the same time. We had to consciously pick one and carefully re-thread the other side's unrelated work (trade-recording hooks) through the winning implementation, so neither branch's real progress got silently dropped.
- A subtle legibility bug. One CSS file's font rule silently overrode an earlier one's for the entire dashboard, and the resulting pixel font's digits (0/6/8, 3/8) were genuinely hard to tell apart in a trading UI where every important number is a digit. Fixed by pinning numeric displays specifically to a monospace terminal font while keeping the more stylized font for labels.
- Staying honest under time pressure. It would've been easy to fake more of this. We drew a hard line in our own heads (and in the README) between what's real — auth, database persistence, on-chain SOL transfers — and what's simulated — the trading capital itself, which is deliberately not a real settled asset.
Accomplishments that we're proud of
- A genuinely full stack, not a static demo: real auth, a real database-backed trade history, real on-chain SOL movement.
- Recovering cleanly from non-trivial concurrent-development conflicts without losing either side's work.
- An arena that stays smooth against a live public data feed while layering ambient animation and hit effects on top, thanks to a rendering pipeline that caches geometry and skips repainting anything unchanged. ## What we learned
- How to actually model and query time-series trading data in TimescaleDB, including hypertables.
- How to coordinate fast-moving, concurrent work across teammates and AI coding sessions on one shared branch — fetch and diff before every push, and resolve conflicts by intent, not by just picking a side.
- That small typography decisions matter a lot more in a live trading-style UI than they look like they should — legibility isn't a cosmetic afterthought when every important piece of information is a number.
What's next for Battlecoin
- Automatic round settlement, so positions don't just sit "awaiting settlement" forever.
- A replay mode, so a bad venue wifi connection or a flat market doesn't sink a live demo.
- Real wallet-adapter connect (Phantom/Solflare) instead of a generated custodial keypair.
- Actual on-chain settlement of trades themselves, not just deposits and withdrawals.
Log in or sign up for Devpost to join the conversation.