Status Flow
Step-by-Step Flow
User Creates RFQ
The user submits a parlay bet request with 2-5 legs, each referencing a Kalshi market ticker and a side (yes/no).The system validates each leg against Kalshi market data, checks the user’s USDC balance, and broadcasts the RFQ to all connected market makers via WebSocket.Status:
openMarket Makers Submit Quotes
Market makers see the RFQ on the The payout is calculated as:
rfqs:open WebSocket channel and submit quotes with their payout odds.- total_cost = bet_amount (e.g., $100)
- total_payout = bet_amount x payout_odds (e.g., $400)
- mm_payout (MM’s risk) = total_payout - total_cost (e.g., $300)
quotedUser Accepts Best Quote
The user reviews quotes (sorted by best payout odds) and accepts one.This rejects all other pending quotes and gives the market maker a 60-second confirmation deadline.Status:
acceptedMarket Maker Confirms
The market maker must confirm within 60 seconds, triggering the on-chain escrow.Status:
confirmedOn-Chain Escrow Execution
The system executes a 3-step Solana transaction flow:
- create_parlay — Oracle creates the escrow PDA and token account
- deposit_user — User’s USDC stake is transferred to the escrow
- deposit_mm — Market maker’s risk USDC is transferred to the escrow
executedTimeout Protection
Two background services protect against stuck escrows:- Settlement Service (every 30s) — Checks if all legs have resolved and settles the escrow
- Timeout Service (every 60s) — Cancels escrows past their deadline (default 1 hour) and refunds deposits
Validation Rules
| Parameter | Constraint |
|---|---|
| Legs per parlay | 2-5 |
| Bet amount | 10,000 USDC |
| Payout odds | 1.01x - 1000x |
| RFQ expiration | 60 - 3600 seconds |
| Quote validity | Configurable (default 60s) |
| MM confirmation window | 60 seconds |
| Escrow deadline | Configurable (default 1 hour) |