Solana RPC (WebSocket)
↓
Transaction Monitor Service
↓
Marketplace Program Filter
↓
cNFT Sale Parser
↓
Probability Calculator
↓
PostgreSQL Database
↓
NestJS API Endpoints
↓
DePredict Frontend
Tech Stack
- Language: TypeScript
- Database: PostgreSQL (schema provided, you migrate as needed)
- RPC: WebSocket connections to Solana RPC
- Metadata: Helius DAS API for cNFT data
- Oracle: Switchboard
- Infrastructure: Existing AWS Setup
- Monitoring: Health checks + alerting
Architecture
Decision: WebSocket RPC
- Connect to Solana RPC via WebSocket
- Subscribe to logs for marketplace program IDs
- Parse transaction data to extract:
- cNFT mint address
- Sale price (USDC or SOL)
- Marketplace
- Buyer/seller
- Fetch cNFT metadata to get:
market_id
outcome_side (YES/NO)
shares
- Calculate implied probability:
sale_price / shares
- Store in database (Postgres on AWS)
- Expose via REST API (NestJS compatible)
Probable Challenges
Challenge 1: Monitoring 12+ Marketplaces