Inspiration
We wanted to make friendly wagers and prediction markets accessible, trustless, and fun for everyone—without the need for a central authority or manual settlement. With the rise of blockchain, DEXs, and powerful AI, we saw an opportunity to combine these technologies to automate the entire wager lifecycle, from natural language creation to escrow, swap, and payout.
What it does
WagerX is a Telegram bot that lets users create, join, and resolve friendly wagers using natural language. The bot: Detects wager proposals in chat using Perplexity AI. Creates a Solana escrow wallet for each wager. Accepts both SOL and USDC, and auto-swaps SOL to USDC using the OKX DEX API. Verifies outcomes with Perplexity AI and automates payouts. Stores all wager data in Firestore for transparency and auditability.
How we built it
Backend: Next.js (TypeScript) serverless API. Telegram Bot: Node.js with node-telegram-bot-api. Blockchain: Solana Web3.js for wallet, escrow, and transactions. DEX Integration: OKX DEX API for token swaps (with a mock for region restrictions). AI/NLP: Perplexity API (Sonar model) for wager detection and outcome verification. Database: Firebase Firestore for storing wagers, users, and logs. DevOps: GitHub, Vercel, and local devnet for rapid iteration.
Challenges we ran into
API Region Restrictions: OKX DEX API is not accessible in some regions, so we had to implement a mock for demo purposes. Airdrop Rate Limits: Solana devnet faucet limits required us to generate new wallets and handle manual funding gracefully. Natural Language Parsing: Ensuring Perplexity AI consistently returns structured JSON for wager detection was tricky, especially with ambiguous or unexpected responses. Token Swaps on Devnet: Many DEX APIs are mainnet-only, so we had to adapt addresses and logic for devnet compatibility. Error Handling: Making the bot robust to API failures, network issues, and user mistakes.
Accomplishments that we're proud of
End-to-End Automation: From natural language wager creation to escrow, swap, and payout—all handled by the bot. AI Integration: Seamlessly using Perplexity AI for both wager detection and outcome verification. User Experience: The bot guides users through every step, handles errors gracefully, and provides real-time feedback. Hackathon Resilience: We built in mocks and fallbacks so the demo works even if APIs are down or restricted.
What we learned
AI + Blockchain is Powerful: Combining LLMs with smart contracts and DEXs unlocks new, user-friendly experiences. APIs Can Be Unpredictable: Always plan for rate limits, region restrictions, and non-standard responses. User-Centric Design: Clear instructions and robust error handling are key for onboarding non-crypto users. Rapid Prototyping: Serverless, TypeScript, and modular design let us iterate quickly and adapt to hackathon surprises.
What's next for WagerX
Mainnet Launch: Move from devnet to mainnet for real stakes. More Oracles: Integrate Chainlink and other data feeds for broader wager types. Multi-DEX Support: Add fallback DEXs (e.g., Jupiter) for swaps. Advanced Wagers: Support multi-party, conditional, and recurring wagers. Mobile/Web UI: Build a companion web dashboard for tracking and analytics. Open Source: Release the code for community-driven improvements.

Log in or sign up for Devpost to join the conversation.