Betric — Portfolio Project by Muhammad Daffa Ashdaqfillah
A comprehensive cryptocurrency ecosystem featuring an XGBoost machine learning predictor, a Next.js dashboard, an iOS app, and an automated Polymarket trading bot.

Published on April 30, 2026
Project Details

Description
Betric is a full-stack cryptocurrency prediction and automated trading ecosystem. It captures market signals using machine learning, displays real-time predictions to users across web and mobile platforms, and executes algorithmic trades on binary prediction markets based on those signals.
Problem
Cryptocurrency markets move rapidly, requiring traders to monitor prices continuously and synthesize complex technical indicators. Manual trading on binary platforms like Polymarket can be inefficient and prone to human error, necessitating an automated, data-driven approach to identify trends and execute trades before opportunities close.
Solution
The project delivers a multi-platform solution consisting of four main components:
- Machine Learning Backend: A Python-based service that continuously polls 1-minute BTCUSDT kline data from Binance. It computes technical indicators and uses a trained XGBoost model to predict 1-hour price movements, generating actionable Take Profit (TP) and Stop Loss (SL) signals.
- Next.js Dashboard: A web frontend for real-time visualization of predictions and market states.
- Native iOS App: A SwiftUI-based mobile application providing users with on-the-go access to the ML-generated trading signals.
- Polymarket Trading Bot: An automated TypeScript worker that connects to Polymarket's Central Limit Order Book (CLOB) via WebSockets. It executes both trend-following and binary market arbitrage strategies based on configurable price and time thresholds.
Key Features
- Real-Time ML Predictions: Continuous monitoring and prediction of BTC prices using XGBoost and technical analysis indicators.
- Automated Arbitrage & Trend Following: A sophisticated bot capable of locking in arbitrage margins on binary markets or riding short-term trends.
- Multi-Platform Access: Signals and performance reports are accessible via a Next.js web dashboard and a native iOS application.
- Configurable Strategies: Trading parameters like entry/exit thresholds, take profit, stop loss, and emergency swaps are highly customizable via TOML.
Architecture
mermaidflowchart TD
A[Binance API] -->|1m Kline Data| B[Python ML Backend]
B -->|Features & XGBoost| C[Signal Generator]
C -->|JSON State / MD Report| D[Next.js Dashboard]
C -->|API/State| E[iOS App]
F[Polymarket CLOB & RTDS] -->|Real-time Orderbook| G[Trading Bot]
G <-->|Execute Trades| FImplementation
- Machine Learning: The prediction engine is built in Python using Pandas for data manipulation, ta for technical indicators, and XGBoost for the classification model. It includes robust logging and markdown report generation.
- Trading Bot: Built with Node.js and TypeScript, utilizing Polymarket's CLOB client. It features an auto-claim worker and runs configurable strategies defined in trade.toml.
- Frontend & Mobile: The Next.js dashboard uses Tailwind CSS for styling, while the iOS app leverages native SwiftUI for its views and interface.