# Binary Options Trading Platform

A complete binary options trading platform with real-time Binance API integration, admin panel, and user trading interface.

## Features

### User Panel
- ✅ Real-time trading with Binance live data
- ✅ Live candlestick charts (TradingView Lightweight Charts)
- ✅ 10+ Technical Indicators (SMA, EMA, Bollinger, RSI, MACD, etc.)
- ✅ 12+ Drawing Tools (Lines, Fibonacci, Shapes, etc.)
- ✅ Multiple trading durations (30s to 1 hour)
- ✅ Demo account with virtual money
- ✅ UPI Deposit with QR Code (Auto Detection)
- ✅ Instant Wallet Credit
- ✅ Withdrawal system
- ✅ Trade history & transactions
- ✅ Referral system
- ✅ KYC verification

### Admin Panel
- ✅ Complete dashboard with statistics
- ✅ User management (block/unblock, balance adjustment)
- ✅ Trade management with override control
- ✅ Deposit/Withdrawal approval
- ✅ UPI Payment Management
- ✅ Risk management (global & per-user win rate)
- ✅ Asset management
- ✅ **Powerful SEO System** (Keywords, Pages, Sitemap, Robots.txt)
- ✅ Settings & configuration
- ✅ Activity logs

### SEO System Features
- ✅ Unlimited Keywords Management
- ✅ Bulk Import/Export Keywords (CSV)
- ✅ Page-specific SEO Settings
- ✅ Auto Sitemap Generation
- ✅ Robots.txt Editor
- ✅ URL Redirects (301, 302, 307)
- ✅ Open Graph Tags
- ✅ Twitter Cards
- ✅ Schema.org JSON-LD
- ✅ Google Analytics Integration
- ✅ Facebook Pixel Integration
- ✅ Search Console Verification

### UPI Payment Gateway
- ✅ QR Code Payment
- ✅ UPI Deep Link (Open App)
- ✅ Auto Payment Detection
- ✅ Webhook Support
- ✅ Manual Confirmation

## Requirements

- PHP 8.0+
- MySQL 8.0+
- PDO Extension
- cURL Extension
- OpenSSL Extension

## Installation

1. Upload files to your web server
2. Open `install.php` in your browser
3. Follow the installation wizard
4. Delete `install.php` after installation
5. Add your QR code image to `assets/images/payment-qr.png`

## Configuration

### Database
Edit `config/config.php`:
```php
define('DB_HOST', 'localhost');
define('DB_NAME', 'binary_options');
define('DB_USER', 'your_username');
define('DB_PASS', 'your_password');
```

### Site URL
```php
define('SITE_URL', 'https://yourdomain.com');
```

### UPI Payment
Edit `config/payment.php`:
```php
define('UPI_MERCHANT_NAME', 'Your Name');
define('UPI_ID', 'your-upi@bank');
```

### Binance API
Get your API keys from [Binance](https://www.binance.com/en/my/settings/api-management):
```php
define('BINANCE_API_KEY', 'your-api-key');
define('BINANCE_API_SECRET', 'your-api-secret');
```

## Cron Jobs

Add these cron jobs:
```bash
# Close expired trades (every minute)
* * * * * php /path/to/binary-options/cron/close-trades.php

# Expire pending payments (every 5 minutes)
*/5 * * * * php /path/to/binary-options/cron/expire-payments.php

# Generate sitemap (daily at midnight)
0 0 * * * php /path/to/binary-options/cron/sitemap.php
```

## Default Admin Login

- **URL:** `/admin/login.php`
- **Username:** admin
- **Password:** Admin@123

⚠️ **Change the default password immediately after installation!**

## Directory Structure

```
binary-options/
├── admin/                  # Admin panel
│   ├── includes/          # Admin templates
│   ├── dashboard.php      # Admin dashboard
│   ├── users.php          # User management
│   ├── trades.php         # Trade management
│   ├── deposits.php       # Deposit management
│   ├── upi-payments.php   # UPI Payment management
│   ├── seo.php            # SEO Management
│   └── settings.php       # Platform settings
├── api/                    # API endpoints
│   ├── trade/             # Trading API
│   ├── payment/           # Payment API
│   ├── seo/               # SEO API
│   └── user/              # User API
├── assets/                 # Static assets
│   ├── css/               # Stylesheets
│   ├── js/                # JavaScript
│   └── images/            # Images (payment-qr.png)
├── config/                 # Configuration
│   ├── config.php         # Main config
│   ├── database.php       # Database connection
│   └── payment.php        # UPI Payment config
├── cron/                   # Cron jobs
├── database/               # Database schema
├── includes/               # Core classes
│   ├── Auth.php           # Authentication
│   ├── TradingEngine.php  # Trading logic
│   ├── SEO.php            # SEO Helper
│   └── functions.php      # Helper functions
├── uploads/                # User uploads
├── user/                   # User panel
├── .htaccess              # Apache config
├── robots.txt             # SEO robots file
├── sitemap.xml            # SEO sitemap
└── install.php            # Installation wizard
```

## SEO Management

### Adding Keywords
1. Go to Admin → SEO Management → Keywords
2. Add single keywords or bulk import
3. Set priority, category, and target page

### Page SEO
1. Go to Admin → SEO Management → Pages
2. Add page URL and meta tags
3. Configure Open Graph and Schema

### Sitemap
1. Go to Admin → SEO Management → Sitemap
2. Click "Generate Sitemap"
3. Submit to Google Search Console

## Security Features

- CSRF protection
- Password hashing (bcrypt)
- SQL injection prevention (PDO prepared statements)
- XSS protection
- Session security
- IP logging
- Activity logs
- Security headers (.htaccess)

## Risk Management

The platform includes built-in risk management:

1. **Global Win Rate:** Controls overall platform profitability
2. **Per-User Win Rate:** Override for specific users
3. **Trade Override:** Admin can force win/lose on pending trades
4. **Trade Limits:** Min/Max trade amounts per asset

## Support

For support, contact: arbudahosting@gmail.com

## License

Copyright © 2025 Arbuda IT. All rights reserved.

---

**⚠️ Disclaimer:** Binary options trading involves significant risk. This platform is for educational/demo purposes. Ensure compliance with your local regulations before operating.
