How It Works β’ Architecture β’ Features β’ Contracts β’ Quick Start
Gambit is a native iOS + Apple Watch app for trading 5-minute crypto prediction markets. Swipe right for UP, swipe left for DOWN β trade executes in ~3 seconds. No seed phrases, no browser extensions, no complex DeFi interfaces. Just your watch and a market opinion.
Prediction markets are powerful tools for price discovery and hedging, but they're trapped behind desktop-only interfaces that require technical crypto knowledge. Polymarket β the largest prediction market β has no mobile trading, no watch app, and requires manual wallet management.
Meanwhile, millions of people check their Apple Watch dozens of times a day. What if they could act on a market view in 2 seconds?
Gambit brings prediction markets to the most personal device you own. Real-time crypto charts on your wrist, instant swipe-to-trade, and automatic settlement β all powered by an embedded MPC wallet that requires zero crypto knowledge from the user.
- π± Open iPhone app β tap "Get Started" β sign in with email (no seed phrase)
- π Wallet is created automatically and configured for trading (one-time, ~10 seconds)
- π° Deposit USDC to your wallet address
- β Open Apple Watch β see live crypto charts β swipe to trade
- π Watch positions resolve β claim winnings from iPhone
Watch swipe
β WatchConnectivity message to iPhone
β iPhone asks backend to prepare EIP-712 order data
β Dynamic embedded wallet silently signs (no user prompt)
β Backend submits signed order to Polymarket CLOB
β Polymarket matches the order (Fill-or-Kill)
β Result flows back to Watch with haptic feedback
The user never sees a transaction, never approves a popup, never deals with gas.
βββββββββββββββ WatchConnectivity βββββββββββββββ
β Apple Watch β ββββββββββββββββββββββββΊ β iPhone β
β SwiftUI β price data + trades β SwiftUI β
β Charts β β Dynamic SDKβ
βββββββββββββββ ββββββββ¬βββββββ
β HTTPS
βΌ
ββββββββββββββββ
β Backend β
β Fastify+TS β
β PostgreSQL β
β Redis β
ββββ¬ββββ¬ββββ¬βββ
β β β
ββββββββββββββββ β ββββββββββββββββ
βΌ βΌ βΌ
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Polymarket β β Binance β β Polygon β
β CLOB API β β WebSocket β β RPC β
β Orders β β BTC/ETH/XRP β β USDC/CT β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
| Layer | Technology | Purpose |
|---|---|---|
| π± iOS App | SwiftUI, Combine, Dynamic SDK | Native UI + embedded MPC wallet |
| β watchOS App | SwiftUI, WatchConnectivity | Swipe-to-bet + live charts |
| βοΈ Backend | Node.js, TypeScript, Fastify | Order orchestration + market discovery |
| ποΈ Database | PostgreSQL + Drizzle ORM | Users, wallets, orders, audit log |
| β‘ Cache | Redis | Market data, L2 creds, price history |
| βοΈ Blockchain | Polygon PoS, Arc Testnet | Polymarket settlement + custom markets |
| π Market Data | Binance WebSocket, Polymarket CLOB | Real-time spot prices + odds |
| π Oracle | Chainlink CRE | Decentralized market settlement |
| π Wallet | Dynamic.xyz | Embedded MPC wallet, no seed phrases |
| π Deployment | Hetzner Helsinki, Caddy | Auto SSL, no VPN needed |
β Swipe-to-Bet on Apple Watch β See a 60-second live price chart, swipe right for UP or left for DOWN. Digital Crown selects bet amount. Trade executes in ~3 seconds with haptic feedback.
π Zero-Friction Onboarding β Sign in with email, wallet is created automatically. No seed phrases, no browser extensions, no MetaMask popups. Dynamic's MPC wallet handles everything.
βοΈ Client-Side Signing β All blockchain transactions are signed on the iPhone using Dynamic's embedded wallet SDK. The backend never has access to private keys. Custodial-level UX with self-custodial security.
π Dual Settlement Layer β Trade on Polymarket (Polygon) for deep liquidity, or switch to Arc Testnet for custom prediction markets with Chainlink CRE settlement. Toggle between networks from settings.
π‘ Real-Time Price Pipeline β Binance WebSocket β Redis β SSE β iPhone β WatchConnectivity β Watch. Sub-second price updates across the entire stack.
π€ Automatic Settlement β 5-minute markets resolve automatically. Chainlink CRE fetches final price, achieves DON consensus, and calls settleMarket() on-chain. Winners receive USDC automatically.
Deployed at
0xfE3dd8F80051B2F3da054F8657BaF016478697bD
| Function | Description |
|---|---|
createMarket(asset, strikePrice, duration) |
Creates a new 5-min prediction market |
placeBet(marketId, direction, amount) |
Places a USDC bet on UP or DOWN |
settleMarket(marketId, finalPrice) |
Resolves market with final price (CRE or operator) |
claim(marketId) |
Winners withdraw proportional USDC payout |
requestSettlement(marketId) |
Emits SettlementRequested event for CRE |
| Contract | Address | Usage |
|---|---|---|
| CTF Exchange | 0x4bFb41d5...982E |
Order matching engine |
| Neg Risk Exchange | 0xC5d563A3...f80a |
Negative risk markets |
| Conditional Tokens | 0x4D97DCd9...0045 |
ERC-1155 outcome tokens |
| USDC.e | 0x2791Bca1...4174 |
Settlement token |
The CRE workflow provides decentralized, trustless market settlement:
1. π Contract emits SettlementRequested(marketId, asset, strikePrice, endTime)
2. ποΈ CRE DON nodes detect the event via LogTrigger
3. π Each node fetches price from Binance API via HTTPClient
4. π€ Nodes reach consensus on the price (identical aggregation)
5. π Workflow generates a signed report with encoded settlement data
6. βοΈ Report is written on-chain β settleMarket() executes
7. πΈ Winners receive proportional USDC payout
Compiled to WASM. Backend provides an operator fallback for demo.
| Layer | Approach |
|---|---|
| π Key Management | Dynamic MPC β key shares split between infra and device |
| βοΈ Signing | Client-side EIP-712 on iPhone β backend never touches keys |
| π« Sessions | JWT tokens stored in iOS Keychain |
| π API Auth | HMAC L2 signatures on every Polymarket call |
| π RPC | Custom Polygon endpoint β no rate-limited defaults |
gambit/
βββ backend/ # βοΈ Node.js Fastify server (Polymarket)
β βββ src/
β β βββ modules/ # auth, orders, markets, wallet, prices
β β βββ lib/ # polymarket client, dynamic SDK, errors
β β βββ plugins/ # postgres, redis, auth, websocket
β β βββ db/ # schema + migrations (Drizzle)
β βββ package.json
βββ ios/
β βββ Gambit/ # π± iPhone app (SwiftUI)
β β βββ Auth/ # AuthManager, DelegationManager, Keychain
β β βββ Views/ # LoginView, DashboardView, OnboardingView
β β βββ Networking/ # APIClient, WebSocketManager
β β βββ WatchBridge/ # WatchSessionManager
β βββ GambitWatch/ # β Apple Watch app (SwiftUI)
β β βββ Views/ # MarketView, ActivePositionView, Charts
β β βββ Connectivity/ # PhoneConnector, HTTPFallback
β βββ Shared/ # SharedModels, MessageKeys
βββ arc/
β βββ contracts/ # π GambitMarket.sol (Foundry)
β βββ cre-workflow/ # π Chainlink CRE TypeScript workflow
β βββ backend/ # βοΈ Arc-specific Fastify server
βββ README.md
- Node.js v22+, npm
- PostgreSQL, Redis
- Xcode 16+ (for iOS/watchOS)
- Foundry (for smart contracts)
cd backend
cp .env.example .env # fill in credentials
npm install
npx drizzle-kit migrate
npm run devcd ios
open Gambit.xcodeproj
# Select Gambit scheme β Build & Run on iPhone
# Select GambitWatch scheme β Build & Run on Watchcd arc/contracts
forge build
forge script script/Deploy.s.sol --rpc-url https://rpc.testnet.arc.network --broadcastcd arc/cre-workflow
bun install
bunx cre-compile main.ts gambit-workflow.wasm --skip-type-checksBuilt by ITU Blockchain at ETHGlobal Cannes 2026.
Native iOS embedded MPC wallet with client-side EIP-712 signing. Zero seed phrases, silent transaction signing, custom Polygon RPC configuration via evmNetworks.
GambitMarket.sol deployed on Arc Testnet. USDC-native settlement, 5-minute binary options on BTC/ETH/XRP. Stablecoin gas model.
TypeScript CRE workflow for decentralized market settlement. Fetches price from Binance via HTTPClient, DON consensus, signed report settles markets on-chain. Compiled to WASM.
