A Next.js 15 application for trading crypto prediction markets on Polymarket. Focus on up/down binary markets for cryptocurrency assets.
- 🎯 Tinder-Style Swipe Interface: Swipe right for UP, left for DOWN
- 📱 Mobile-First Design: Optimized for touch and gesture controls
- Real-time Market Data: Live updates from Polymarket API
- Crypto-Focused: Filtered to show only crypto up/down markets
- Trading Interface: Execute trades directly from the dashboard
- Position Management: Track P&L and manage open positions
- Risk Management: Built-in position sizing and risk controls
- Real-time Updates: WebSocket integration for live price feeds
- Responsive Design: Beautiful gradient UI with smooth animations
See PROJECT_STRUCTURE.md for detailed documentation of the folder organization.
predictpark/
├── app/ # Next.js 15 App Router
├── components/ # React components
├── lib/ # Core libraries (Polymarket, trading logic)
├── types/ # TypeScript definitions
├── hooks/ # Custom React hooks
├── services/ # External service integrations
├── config/ # Configuration files
└── public/ # Static assets
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- State Management: Zustand / React Context
- Data Fetching: TanStack Query / SWR
- API Integration: Polymarket API
- Real-time: WebSocket / Socket.io
- Deployment: Vercel
- Node.js 18+
- yarn 1.22+
- Privy App ID (Get it here)
- Polymarket API credentials
.env.local - NEVER commit sensitive data!
See SECURITY.md for comprehensive security guidelines.
- Clone the repository:
git clone https://github.com/yourusername/predictpark.git
cd predictpark- Install dependencies:
npm install- Set up environment variables:
Create .env.local in the root directory:
touch .env.localAdd your API keys (see ENV_SETUP.md for detailed instructions):
# Privy Authentication (REQUIRED)
NEXT_PUBLIC_PRIVY_APP_ID=your_privy_app_id
# Polymarket API (for live trading)
POLYMARKET_API_KEY=your_api_key
POLYMARKET_SECRET_KEY=your_secret_key
POLYMARKET_API_URL=https://api.polymarket.com/v1
# App Configuration
NEXT_PUBLIC_APP_URL=http://localhost:3000.env.local to Git! It's already in .gitignore.
- Run the development server:
yarn dev-
Open http://localhost:3000 in your browser
-
Try the swipe interface at http://localhost:3000/dummy
yarn dev # Start development server
yarn build # Build for production
yarn start # Start production server
yarn lint # Run ESLint
yarn type-check # TypeScript type checkingVisit /dummy to test the Tinder-like swipe interface with dummy data:
- 👉 Swipe Right = Bet on price going UP
- 👈 Swipe Left = Bet on price going DOWN
- See
SWIPE_UI_GUIDE.mdfor detailed documentation
/app: Next.js 15 app router pages and API routes/lib/polymarket: Polymarket API client and market data/lib/trading: Trading strategies and execution logic/components: Reusable React components/types: TypeScript type definitions
- Automatically filters for crypto-related markets
- Shows only up/down binary markets
- Configurable volume and liquidity thresholds
- Position size limits
- Maximum account exposure controls
- Stop-loss and take-profit support
- Slippage protection
- Market orders (instant execution)
- Limit orders (price-specific)
- API keys stored in environment variables
- Server-side API calls only
- No sensitive data in client bundles
- Rate limiting on API routes
- Push your code to GitHub
- Import project in Vercel
- Add environment variables
- Deploy!
# Or use Vercel CLI
npm install -g vercel
vercel| Variable | Description | Required |
|---|---|---|
POLYMARKET_API_KEY |
Polymarket API key | Yes |
POLYMARKET_SECRET_KEY |
Polymarket secret key | Yes |
POLYMARKET_API_URL |
Polymarket API endpoint | Yes |
NEXT_PUBLIC_APP_URL |
Your app URL | No |
DATABASE_URL |
Database connection string | No |
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details
This is a trading application. Always trade responsibly and never risk more than you can afford to lose. This software is provided "as is" without warranty of any kind.