AI-Powered Automated Trading Platform for Deriv.com
DerivBot Pro is an Android application that automates trading strategies on the Deriv platform. It features a built-in HTTP server (NanoHTTPD), machine learning models (TensorFlow.js via WebView), multi-contract support, and a rich WebView-based UI with real-time streaming via WebSocket.
| Dashboard | Trading | Strategies |
|---|---|---|
![]() |
![]() |
![]() |
| Login | Settings |
|---|---|
![]() |
![]() |
- Rise / Fall — Predict whether the price will rise or fall
- Under / Over — Predict digit above/below a barrier
- Even / Odd — Predict even/odd digit
- Match / Diff — Predict if digit repeats or changes
- Asian Up / Down — Predict average above/below
- Touch / No Touch — Predict if price touches a barrier
- Trend + ML — Momentum analysis combined with neural network
- Technical Indicators — RSI, MACD, Bollinger Bands, Stochastic
- Reversal — Entry against extreme movements
- Frequency — Historical pattern-based analysis
- Advanced ML + Patterns — Deep neural network with TensorFlow.js (128/64/32 architecture)
- Continuous real-time model training and market adaptation
- Configurable stake, duration (3-30 ticks/seconds/minutes/hours)
- Smart Martingale (on/off)
- Consecutive loss limit
- Stop loss and stop win targets
- OAuth2 login with one click via Deriv
- Manual API token alternative
- 23 synthetic indices:
- Volatility 10, 25, 50, 75, 100
- Boom 300, 500, 1000
- Crash 300, 500, 1000
- Basket indices
- Crypto indices
- English
- Portuguese
- Spanish
┌─────────────────────────────────────┐
│ Android App (APK) │
│ ┌───────────────────────────────┐ │
│ │ WebView (UI Layer) │ │
│ │ (HTML/JS/CSS - assets/www/) │ │
│ └──────────┬────────────────────┘ │
│ │ HTTP │
│ ┌──────────▼────────────────────┐ │
│ │ MiniHttpServer (NanoHTTPD) │ │
│ │ - REST API (comments, │ │
│ │ trades, users, license) │ │
│ │ - Static file serving │ │
│ └──────────┬────────────────────┘ │
│ │ │
│ ┌──────────▼────────────────────┐ │
│ │ WebSocket (wss:// │ │
│ │ ws.derivws.com) │ │
│ │ ↓ Direct Deriv API │ │
│ └───────────────────────────────┘ │
│ │
│ ┌───────────────────────────────┐ │
│ │ BotService (Foreground) │ │
│ │ - Keeps bot running in │ │
│ │ background │ │
│ └───────────────────────────────┘ │
│ │
│ ┌───────────────────────────────┐ │
│ │ Start.io Ads (Banner) │ │
│ └───────────────────────────────┘ │
└─────────────────────────────────────┘
- Launch screen with 2-second delay
- Transitions to
MainActivity
- Embeds
MiniHttpServeron port 8080 - Loads WebView UI from
http://127.0.0.1:8080 - Renders banner ads via Start.io SDK
- Starts
BotServicefor background operation - Requests notification permission (Android 13+)
Serves the trading web application and provides REST endpoints:
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/comments |
List comments |
| POST | /api/comments |
Create comment |
| PUT | /api/comments/:id |
Edit comment |
| DELETE | /api/comments/:id |
Delete comment |
| POST | /api/register |
Create account |
| POST | /api/login |
Authenticate user |
| POST | /api/forgot-password |
Reset password |
| POST | /api/trades |
Record trade |
| GET | /api/ranking |
Get user rankings |
| GET/POST/DELETE | /api/license |
License management |
- Keeps the bot running in the background
- Shows persistent notification: "DerivBot Pro — Robô rodando em segundo plano"
All user data is stored as JSON files in the app's internal storage (files/deriv_data/):
users.json— Registered users with SHA-512 hashed passwordstrades.json— Trade history (up to 5000 entries)comments.json— User comments (up to 200 entries)license.json— License key storage
- Passwords hashed with SHA-512 + 16-byte salt + 1000 iterations
- CORS headers configured for API access
- Static file serving restricted to known extensions only
- Android Studio Hedgehog (2023.1.1) or newer
- JDK 17
- Android SDK 34
# 1. Clone the repository
git clone https://github.com/pythonbottrader/deriv-bot-pro.git
cd deriv-bot-pro
# 2. Open in Android Studio
# File → Open → select android/ directory
# 3. Build
# Menu: Build → Make Project
# Or via Gradle:
cd android
./gradlew assembleDebug
# 4. The APK will be at:
# android/app/build/outputs/apk/debug/DerivBotPro-1.0.apkderiv-bot-pro/
├── android/ # Android app source
│ ├── app/
│ │ ├── build.gradle.kts # App-level build config
│ │ └── src/main/
│ │ ├── AndroidManifest.xml # Permissions, activities, services
│ │ ├── assets/www/ # Web UI assets (HTML/JS/CSS)
│ │ ├── java/com/deriv/app/ # Java source code
│ │ │ ├── MainActivity.java # WebView + server host
│ │ │ ├── MiniHttpServer.java # Embedded HTTP server
│ │ │ ├── BotService.java # Background service
│ │ │ └── SplashActivity.java # Splash screen
│ │ └── res/ # Android resources
│ ├── build.gradle.kts # Root build config
│ ├── gradle.properties # Gradle properties
│ ├── settings.gradle.kts # Project settings
│ └── app-ads.txt # Ads.txt for Start.io
├── apk/
│ └── DerivBotPro-1.0.apk # Pre-built APK
├── img/ # Screenshots
├── LICENSE
└── README.md
| Technology | Purpose |
|---|---|
| Java 17 | Android app logic |
| NanoHTTPD 2.3.1 | Embedded HTTP server for REST API + static files |
| Android WebView | UI rendering (WebView-based SPA) |
| Deriv WebSocket API | Real-time trading via wss://ws.derivws.com |
| TensorFlow.js | Machine learning models in WebView |
| Start.io SDK 5.2.5 | In-app banner advertisements |
| Gson 2.10.1 | JSON serialization/deserialization |
| SHA-512 + Salt | Password hashing |
This project is licensed under the MIT License — see the LICENSE file for details.
Trading involves significant financial risk. This tool is provided for educational purposes only. Always test strategies on a demo account before trading with real funds. Past performance does not guarantee future results. The authors are not responsible for any financial losses incurred through the use of this software.




