MBC 2025 Hackathon Submission
Solana Main Track + Polymarket Bounty ($5,000)
Bet on the Truth directly from Twitter/X using Solana Blinks.
A browser extension and dApp that bridges Web2 social media with Web3 prediction markets using Solana Blinks (Blockchain Links) and Actions. Place USDC bets on viral claims without leaving your Twitter feed.
- Hackathon Submission Details
- Architecture Overview
- Features
- Deployed Contracts
- Quick Start
- Project Structure
- Tech Stack
- API Reference
- Smart Contract
- Testing
- Team
- License
| Field | Value |
|---|---|
| Project Name | TruthBlink |
| Track | Solana Main Track + Polymarket Bounty |
| Team | Amar Kushwaha |
| GitHub | https://github.com/kushwahaamar-dev/truth |
| Video Demo | https://youtu.be/R2hBaZrOQdU |
| Program ID (Devnet) | BMLPwQE7THXBWM72ihnEJ63mjvw2Bmg7Ert2oXbpj9sX |
- Deployed to Solana Devnet
- Uses Anchor Framework (Rust)
- Uses @solana/web3.js
- Uses @solana/actions (Blinks)
- Uses SPL Token (USDC)
- Public GitHub with documentation
- Functional demo (Chrome extension + web app)
- Integrates Polymarket public APIs (gamma-api.polymarket.com)
- Cross-chain data integration (Polymarket EVM → Solana betting)
- Clear utility: Bet on predictions from Twitter
- Original UX: First Solana Blinks + Polymarket + Twitter integration
┌─────────────────────────────────────────────────────────────────┐
│ TRUTHBLINK ARCHITECTURE │
└─────────────────────────────────────────────────────────────────┘
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Twitter/X │ │ Polymarket │ │ Solana │
│ (Web2 Feed) │ │ (EVM Data) │ │ (Settlement) │
└────────┬────────┘ └────────┬────────┘ └────────┬────────┘
│ │ │
▼ ▼ │
┌─────────────────────────────────────────┐ │
│ CHROME EXTENSION (Plasmo) │ │
│ • Tweet Scanner (MutationObserver) │ │
│ • Bet Button Injection │ │
│ • Tooltip with Live Odds │ │
└────────────────────┬────────────────────┘ │
│ │
▼ │
┌─────────────────────────────────────────┐ │
│ NEXT.JS API SERVER │ │
│ │ │
│ /api/search-market │ │
│ └─ Gemini AI matching │ │
│ └─ Polymarket API fetch │ │
│ │ │
│ /api/actions/bet (Solana Blink) │──────────────┤
│ └─ GET: Blink metadata + odds │ │
│ └─ POST: Transaction builder │ │
│ │ │
│ /api/markets │ │
│ └─ List all markets │ │
└────────────────────┬────────────────────┘ │
│ │
▼ ▼
┌─────────────────────────────────────────────────────────────────┐
│ ANCHOR SMART CONTRACT │
│ Program ID: BMLPwQE7...oXbpj9sX │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────────┐ │
│ │ initialize │ │ place_bet │ │ resolve_market + claim │ │
│ │ market │ │ │ │ │ │
│ └─────────────┘ └─────────────┘ └─────────────────────────┘ │
│ │
│ Accounts: │
│ • Market PDA (betting pool state) │
│ • UserBet PDA (individual bets) │
│ • Vault (USDC escrow) │
└─────────────────────────────────────────────────────────────────┘
- User scrolls Twitter → Extension scans tweets
- AI matches tweet → Polymarket market found
- Bet button appears → Shows live odds from Polymarket
- User clicks Bet → Opens Solana Blink (Dialect)
- User signs transaction → USDC transferred to on-chain vault
- Market resolves → Winners claim proportional payouts
- 🐦 Twitter Integration: Automatically detects bettable claims in tweets
- 🤖 AI Matching: Gemini AI matches tweets to Polymarket prediction markets
- ⚡ Solana Blinks: One-click betting with Solana Actions
- 💰 USDC Betting: Bet with stablecoins, winners take the pool
- 📊 Live Odds: Real-time odds from Polymarket displayed inline
- 📱 Mobile Ready: Responsive Blink preview pages
- 🔐 Admin Dashboard: Initialize and resolve markets
| Network | Program ID | Status | Explorer |
|---|---|---|---|
| Devnet | BMLPwQE7THXBWM72ihnEJ63mjvw2Bmg7Ert2oXbpj9sX |
✅ Live | View |
- Node.js 18+
- Chrome Browser
- (Optional) Rust & Anchor CLI for smart contract deployment
git clone https://github.com/kushwahaamar-dev/truth.git
cd truth
npm installCreate apps/web/.env.local:
NEXT_PUBLIC_SOLANA_NETWORK=devnet
SOLANA_RPC_URL=https://api.devnet.solana.com
NEXT_PUBLIC_PROGRAM_ID=BMLPwQE7THXBWM72ihnEJ63mjvw2Bmg7Ert2oXbpj9sX
NEXT_PUBLIC_USDC_MINT=4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU
GEMINI_API_KEY=your_key_here
NEXT_PUBLIC_BASE_URL=http://localhost:3000cd apps/web
npm run devcd apps/extension
npm run build- Open
chrome://extensions - Enable Developer mode
- Click Load unpacked
- Select
apps/extension/build/chrome-mv3-prod - Browse Twitter/X and look for ⚡ Bet buttons!
truthblink/
├── anchor/ # Solana Smart Contract (Anchor/Rust)
│ ├── programs/truthblink/
│ │ └── src/
│ │ ├── lib.rs # Main program (betting logic)
│ │ ├── state.rs # Market & UserBet accounts
│ │ ├── error.rs # Custom errors
│ │ └── constants.rs # PDA seeds
│ └── tests/ # Integration tests
│
├── apps/
│ ├── extension/ # Chrome Extension (Plasmo)
│ │ ├── content.tsx # Tweet scanner & button injector
│ │ ├── popup.tsx # Extension popup UI
│ │ └── styles.css # Styling
│ │
│ └── web/ # Next.js Blink Server
│ ├── app/
│ │ ├── api/
│ │ │ ├── actions/bet/ # Solana Actions (Blinks)
│ │ │ ├── search-market/ # AI tweet matching
│ │ │ ├── markets/ # Market listing
│ │ │ └── admin/ # Admin endpoints
│ │ ├── admin/ # Admin dashboard
│ │ └── blink/[marketId]/ # Mobile Blink preview
│ └── lib/
│ ├── gemini.ts # AI matching
│ ├── polymarket.ts # Market data
│ └── polymarket-odds.ts # Live odds
│
├── ENV_SETUP.md # Environment setup guide
└── README.md # This file
| Component | Technology |
|---|---|
| Smart Contract | Anchor (Rust) on Solana |
| Web Server | Next.js 14 (App Router) |
| Extension | Plasmo (React) |
| AI Matching | Google Gemini 1.5 Flash |
| Prediction Data | Polymarket API |
| Token | USDC (SPL Token) |
| Blinks | @solana/actions |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/actions/bet?marketId=xxx |
Blink metadata with live odds |
POST |
/api/actions/bet?marketId=xxx&side=yes&amount=10 |
Transaction payload |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/markets |
List all markets from Polymarket |
POST |
/api/search-market |
AI match tweet → market |
POST |
/api/admin/initialize |
Create new market (auth) |
initialize_market(external_id)- Create betting pool linked to Polymarketplace_bet(amount, side_yes)- Deposit USDC, record bet directionresolve_market(outcome_yes)- Admin closes market with outcomeclaim_winnings()- Winners withdraw proportional payouts
pub struct Market {
pub authority: Pubkey, // Admin
pub external_id: String, // Polymarket market ID
pub total_yes: u64, // USDC on YES
pub total_no: u64, // USDC on NO
pub resolved: bool,
pub outcome: Option<bool>,
pub bump: u8,
}
pub struct UserBet {
pub owner: Pubkey,
pub amount_yes: u64,
pub amount_no: u64,
pub claimed: bool,
pub bump: u8,
}curl "http://localhost:3000/api/actions/bet?marketId=btc-100k-2025"https://dial.to/?action=solana-action:http://localhost:3000/api/actions/bet?marketId=btc-100k-2025
| Name | Role | GitHub |
|---|---|---|
| Amar Kushwaha | Solo Developer | @kushwahaamar-dev |
MIT License - Built for MBC 2025 Hackathon
TruthBlink - Where Web2 meets Web3 prediction markets ⚡
GitHub •
Solana Explorer