A real-time web application that tracks significant movements in Polymarket prediction markets and connects them to news events. Built with Laravel backend and React frontend.
Prophit monitors Polymarket prediction markets for significant price movements (1%+ change in 24 hours) and provides a clean, functional interface for understanding market dynamics. The application fetches real-time data from Polymarket's API and stores it efficiently for analysis and visualization.
- Live market activity with real-time updates
- Significant movement detection (configurable threshold)
- Price history tracking with interactive charts
- Volume and probability monitoring
- Keyword search across market questions and categories
- Live market activity filtering
- Movement history search
- Category-based filtering
- Interactive price charts with Chart.js
- Movement overview charts
- Grid and list view modes
- Responsive design for all devices
- Modern, clean design with Tailwind CSS
- Collapsible mobile navigation
- Real-time sync status
- Loading states and animations
- Framework: Laravel 12.3.0
- Database: SQLite (configurable for production)
- API: RESTful endpoints for frontend consumption
- Scheduling: Automated data sync every 5 minutes
- Authentication: Laravel Sanctum (ready for implementation)
- Framework: React.js with Inertia.js
- Styling: Tailwind CSS 3.x
- Charts: Chart.js with react-chartjs-2
- Build Tool: Vite 7.1.1
- State Management: React hooks
- Polymarket CLOB API:
clob.polymarket.com - Polymarket Gamma API:
gamma-api.polymarket.com
ayanadevs_prophit/
βββ app/
β βββ Console/Commands/
β β βββ SyncPolymarketData.php # Data sync command
β β βββ TestPolymarketApi.php # API testing command
β βββ Http/Controllers/
β β βββ Api/MarketController.php # API endpoints
β β βββ DashboardController.php # Web routes
β βββ Models/
β β βββ Market.php # Market model
β β βββ MarketMovement.php # Movement model
β β βββ MarketPriceHistory.php # Price history model
β βββ Services/
β βββ PolymarketService.php # API integration service
βββ database/migrations/
β βββ create_markets_table.php # Markets schema
β βββ create_market_movements_table.php # Movements schema
β βββ create_market_price_history_table.php # Price history schema
βββ resources/
β βββ js/
β β βββ Components/
β β β βββ Layout.jsx # Main layout
β β β βββ MovementCard.jsx # Movement display
β β β βββ StatsGrid.jsx # Statistics display
β β β βββ PriceChart.jsx # Chart component
β β β βββ MovementsChart.jsx # Overview chart
β β β βββ MarketChangesGrid.jsx # Grid view
β β β βββ LiveMarketChanges.jsx # Live activity
β β β βββ MarketChangesSummary.jsx # Summary component
β β βββ Pages/
β β βββ Dashboard.jsx # Main dashboard
β β βββ MarketDetail.jsx # Market details
β β βββ HistoricMovements.jsx # Historic data
β βββ views/
β βββ app.blade.php # Main layout template
βββ routes/
β βββ api.php # API routes
β βββ web.php # Web routes
β βββ console.php # Scheduled tasks
βββ config/
βββ services.php # API configuration
- Linux or MacOS (Windows needs too many things for setup which I can't bother with)
- PHP 8.2+
- Node.js 18+
- Composer
- npm or yarn
-
Clone the repository
git clone <repository-url> cd ayanadevs_prophit
-
Install PHP dependencies
composer install
-
Install Node.js dependencies
npm install
-
Environment setup
cp .env.example .env php artisan key:generate
-
Configure Polymarket API credentials Add your Polymarket API credentials to
.env:POLYMARKET_PRIVATE_KEY=your_private_key POLYMARKET_API_KEY=your_api_key POLYMARKET_SECRET=your_secret POLYMARKET_PASSPHRASE=your_passphrase
-
Database setup
php artisan migrate
-
Build frontend assets
npm run build
-
Start the application
php artisan serve
-
Run the schedule worker
php artisan schedule:work
| Variable | Description | Required |
|---|---|---|
POLYMARKET_PRIVATE_KEY |
Polymarket private key | Yes |
POLYMARKET_API_KEY |
Polymarket API key | Yes |
POLYMARKET_SECRET |
Polymarket secret | Yes |
POLYMARKET_PASSPHRASE |
Polymarket passphrase | Yes |
APP_ENV |
Application environment | No |
APP_DEBUG |
Debug mode | No |
The default movement threshold is set to 1% (configurable). To change:
- Backend: Modify
$thresholdinDashboardController.php - Frontend: Update threshold options in
Dashboard.jsx
- polymarket_id: Unique Polymarket identifier
- question: Market question text
- current_probability: Current probability (0-1)
- volume: Trading volume
- category: Market category
- end_date: Market end date
- active: Market status
- metadata: Additional market data
- market_id: Associated market
- probability_before: Probability before movement
- probability_after: Probability after movement
- change_percentage: Percentage change
- movement_started_at: Movement start time
- movement_detected_at: Detection time
- volume_during_movement: Volume during movement
- additional_data: Additional movement data
- market_id: Associated market
- probability: Probability at time of recording
- volume: Volume at time of recording
- recorded_at: Recording timestamp
GET /api/movements- Get recent movementsGET /api/markets/{id}- Get market detailsGET /api/markets/{id}/price-history- Get price historyGET /api/markets/search- Search marketsGET /api/stats- Get statistics
POST /api/sync- Trigger manual sync
GET /- Main dashboardGET /market/{id}- Market detailsGET /historic- Historic movements
# Manual sync
php artisan polymarket:sync
# Test API endpoints
php artisan polymarket:testThe application automatically syncs data every 5 minutes via Laravel's scheduler.
- Real-time movements with search and filtering
- Multiple view modes (List, Grid, Chart)
- Live market activity sidebar
- Statistics overview
- Interactive charts with price history
- Movement details with before/after probabilities
- Quick navigation to market details
- Price history visualization with Chart.js
- Interactive tooltips with formatted data
- Responsive design for all screen sizes
- Color-coded by movement direction
- Real-time filtering by keywords
- Category-based search
- Results counter display
- Keyword search across market questions
- Category filtering
- Time-based filtering
The application is fully responsive with:
- Mobile-first design approach
- Collapsible navigation for mobile
- Adaptive layouts for different screen sizes
- Touch-friendly interactions
-
Environment configuration
APP_ENV=production APP_DEBUG=false
-
Database configuration
- Use PostgreSQL or MySQL for production
- Configure database credentials
-
Asset compilation
npm run build
-
Queue configuration (optional)
- Configure Redis for job queues
- Set up supervisor for queue workers
- Database indexing on frequently queried columns
- Caching for API responses
- Asset optimization with Vite
- CDN for static assets
# Test Polymarket API endpoints
php artisan polymarket:test# Run tests (if configured)
npm test# Start Laravel server
php artisan serve
# Start Vite dev server
npm run dev
# Run scheduler
php artisan schedule:work- PHP: PSR-12 standards
- JavaScript: ESLint configuration
- CSS: Tailwind CSS utilities
- Laravel logs:
storage/logs/laravel.log - API errors: Logged with context
- Sync operations: Detailed logging
- Market count: Total active markets
- Movement count: Recent movements
- Sync status: Last successful sync
- API health: Endpoint availability
For support and questions:
- Check the documentation
- Review the code comments
- Open an issue on GitHub
Built with β€οΈ using Laravel and React