Inspiration
Everyone at a hackathon thinks they're the smartest person in the room. We wanted a way to settle it. Talk is cheap, so we made it cost money (a tiny amount). Prediction markets are the most honest test of "being smart": you commit before you know the answer, and the price tells you exactly how much the crowd disagreed with you.
Then we found the domain are-you-a-geni.us, and the whole product fell out of the name. The URL asks the question. The app makes you answer it.
What it does
- Browse markets on hackathon life ("Will the judges laugh at our domain pun?", "Will the pizza run out before 9pm?"), crypto, AI, gaming, weather and science, each with live odds.
- Bet SOL on YES or NO. No wallet install needed: the site creates a burner keypair in your browser and the treasury funds it with an on-chain transfer. Phantom works too.
- Every bet is a real Solana transaction: a SOL transfer to the market treasury plus an on-chain memo receipt (
geni.us:v1:<market>:<YES|NO>). A 3-step tracker shows it being signed → confirmed on Solana → verified & settled in MongoDB Atlas, usually in under a second. - Odds move live for everyone. An Atlas change stream pushes every trade to every open browser: the live tape, the odds and the price chart.
- Markets resolve and winners get paid in SOL on-chain, in batched treasury transfers linked from your positions.
- Genius IQ leaderboard. Being right at 20% beats being right at 90%. Titles range from "Needs More Coffee" to "Certified Geni.us".
- An on-chain receipt page reads any bet straight from the Solana RPC and shows it next to the exact MongoDB document it created.
How we built it
Node.js + Express, a vanilla JS front end, Solana as the money layer and MongoDB Atlas as the market engine. Used Cursor as the coding engine, and used multiple Grok Agents to reason and automate the workflow.
◎ Solana: the money and the proof
- Bets are on-chain transactions. The browser builds
[SystemProgram.transfer(user → treasury), Memo("geni.us:v1:<market>:<side>")]and signs it with a burner keypair or Phantom. - The chain is the source of truth. The server relays the signed tx, waits for
confirmed, then re-reads the parsed transaction from the chain. It checks that the transfer goes to the treasury, that the source is the signer, the amount, and the memo's market and side. Only then does the bet count, so a client can't fake one. - Payouts are on-chain. On resolution, the treasury pays every winner in SOL with batched transfers plus a payout memo.
- Why Solana: a prediction market needs lots of small bets that settle immediately. Bets confirmed in roughly 400–500 ms for a 5,000-lamport fee, so 0.01 SOL micro-bets and fast-moving odds actually work.
🍃 MongoDB Atlas: the market brain
- Market-maker state. Each market stores LMSR state $q_{yes}, q_{no}, b$. Prices come from the cost function $$C(q) = b \ln\left(e^{q_{yes}/b} + e^{q_{no}/b}\right), \qquad p_{yes} = \frac{1}{1 + e^{(q_{no} - q_{yes})/b}}$$
- Multi-document ACID transactions. Each verified bet updates
trades,markets,positionsandusersatomically (snapshot reads, majority writes). - Exactly-once settlement. A trade's
_idis its Solana signature, so replaying a tx hits the unique key and aborts the whole transaction. - Time series collection (
price_ticks) stores odds history, bucketed with$dateTruncfor the chart. - Change streams on
trades+markets, fanned out over server-sent events, update every browser with no polling. - Atlas Search. The app creates its own
markets_searchindex (autocomplete + fuzzy). Typing "snwo" still finds the snow market. - Aggregation pipelines. Genius IQ is
$lookup → $group → $setWindowFields($rank). Payouts are another aggregation over winning positions. - TTL indexes rate-limit the faucet.
Genius IQ rewards edge, not volume: $$\text{IQ} = 100 + 150 \cdot \overline{\text{edge}} + 4\ln(n+1), \qquad \text{edge} = \begin{cases} 1 - p & \text{if right} \ -p & \text{if wrong} \end{cases}$$ where $p$ is the average price you paid and $n$ is your number of calls.
🌐 GoDaddy Registry
are-you-a-geni.us reads as "are you a genius?" The domain is the product's question, brand and punchline. The logo is the URL with a question mark.
Challenges we ran into
- Trusting the client. Our first version took the browser's word for what it bet. We moved to the server re-reading the confirmed tx from Solana and verifying it.
- Double counting. Network retries could count a bet twice. Using the Solana signature as the MongoDB
_idinside an ACID transaction made settlement exactly-once. - Faucets. The devnet and testnet RPC airdrops are closed. We built a treasury-funded faucet for burner wallets, made the app cluster-agnostic, and recorded our demo on a local
solana-test-validator. It's the same code and the same transactions, and it works on devnet by changing one env var. - LMSR math. A closed-form "shares for X SOL" with a numerically stable log-sum-exp, so prices never go NaN.
- Time series writes can't join a multi-document transaction, so price ticks are written right after commit.
Accomplishments that we're proud of
- Every number on screen comes from a confirmed Solana transaction or a MongoDB Atlas query. There's no mock data.
- Click to settled in about a second, with a visible 3-step tracker.
- Zero-install onboarding: judges can place a bet within ten seconds.
- Our demo video is recorded by a script that drives the live app, so every bet in it is a real transaction.
What we learned
- Atlas replaced what would have been four services: transactions, change streams, time series, search and window functions in one database.
- When confirmation takes half a second, you can put the chain in the hot path of every click.
- Verifying parsed transactions server-side makes the chain your source of truth without writing a custom program.
What's next
- Move the treasury into an Anchor program escrow with oracle resolution (Switchboard or Pyth).
- Sell shares before resolution.
- Atlas Vector Search for related and duplicate markets.
- A "Certified Geni.us" compressed NFT for IQ 140+.
Built With
- atlas-search
- css3
- cursor
- docker
- express.js
- ffmpeg
- godaddy-registry
- grok
- html5
- javascript
- mongodb
- mongodb-atlas
- node.js
- phantom
- playwright
- server-sent-events
- solana
- solana-web3.js