Privacy-enhanced prediction/trading platform integrating prediction markets, zero-knowledge privacy, and AI-driven trading.
┌─────────────────────────────────────────────────────────────────────┐
│ Frontend (Next.js) │
│ Wallet Connect • Market Dashboard │
└────────────────────────────────┬────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────┐
│ Privacy RPC Layer │
│ Encrypted Orders • ZK Proof Validation │
└────────────────────────────────┬────────────────────────────────────┘
│
┌──────────────────────┼──────────────────────┐
▼ ▼ ▼
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ PNP Exchange │ │ AI Agent │ │ ZK Contracts │
│ Prediction Mkts │ │ Signals/Trade │ │ Proof Verifier │
└──────────────────┘ └──────────────────┘ └──────────────────┘
BlackboxAlpha/
├── apps/
│ └── web/ # Next.js frontend
├── packages/
│ ├── ui/ # Shared UI components
│ ├── config/ # Shared configurations
│ ├── types/ # Shared TypeScript types
│ └── zk-circuits/ # Circom ZK circuits
├── services/
│ ├── privacy-relay/ # Privacy RPC layer (Express.js)
│ └── ai-agent/ # AI trading agent (FastAPI)
└── contracts/
└── privacy/ # Solana programs (Anchor)
├── shielded_pool # Privacy pool for deposits/withdraws
├── pnp_market_wrapper # PNP prediction market wrapper
└── groth16_verifier # ZK proof verification
- Node.js >= 18.0.0
- pnpm >= 8.0.0
- Python >= 3.10 (for AI agent)
- Rust >= 1.70 (for Solana contracts)
- Solana CLI (for contract deployment)
# Install all dependencies
pnpm install
# Install AI agent dependencies
cd services/ai-agent && pip install -e .You need to run three services for the full application:
cd services/privacy-relay
cp .env.example .env # Configure your settings
pnpm devcd services/ai-agent
cp .env.example .env # Configure your settings
python -m uvicorn src.main:app --reload --port 8000cd apps/web
cp .env.example .env.local # Configure your settings
pnpm devOr run all services from the root:
pnpm dev # Starts frontend with TurboEach service has an .env.example file. Copy and configure:
- Frontend (
apps/web/.env.local): API URLs, Solana RPC, contract addresses - Privacy Relay (
services/privacy-relay/.env): Solana RPC, private key for signing - AI Agent (
services/ai-agent/.env): Privacy relay URL, optional API keys
pnpm build- Deposit SOL to the shielded pool
- Trade on prediction markets with hidden positions
- Withdraw with zero-knowledge proofs
- Browse live markets from PNP Exchange
- LONG (YES) or SHORT (NO) positions
- Real-time price updates via AMM
- News sentiment analysis
- Market momentum indicators
- Automated trade execution
- View all positions across markets
- Track unrealized P&L
- Redeem winning positions
Privacy Relay (http://localhost:3001)
| Endpoint | Method | Description |
|---|---|---|
/api/markets |
GET | List all PNP markets |
/api/markets/:id |
GET | Get market details |
/api/markets |
POST | Create new market |
/api/trading/buy |
POST | Buy YES/NO tokens |
/api/trading/sell |
POST | Sell tokens |
/api/trading/redeem |
POST | Redeem winning position |
/api/trading/positions/:wallet |
GET | Get wallet positions |
/api/proof/verify |
POST | Verify ZK proof |
AI Agent (http://localhost:8000)
| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Service health check |
/signals/{market_id} |
GET | Get trading signal |
/analyze |
POST | Analyze multiple markets |
/trade |
POST | Execute AI trade |
/status |
GET | Agent status |
| Program | Address |
|---|---|
| Shielded Pool | HmbTLCmaGvZhKnn1Zp6QahzU3cU9kNuZmBfKn5s2yPze |
| PNP Wrapper | G5a4u8VDvE1X8p6i3hDyJLM7vWqGMYxHZ7LjJvNMpmf1 |
| Groth16 Verifier | Ds1WkRKa2qDQhwZxSv2xkNKHqKnf8eJnDFPxPFpKLpTN |
Private - All Rights Reserved