← Terminal
Simulation Only — No Real Funds

₿TC-BOT
Technical Reference

A high-fidelity Bitcoin paper-trading simulator. Real-time Binance data, EMA-cross strategy engine, and a Supabase-backed $1,000 virtual wallet — with zero financial risk.

Starting Balance
$1,000
Market Data
Binance
Strategy
EMA Cross
Max Leverage
10×

Strategy & Backtesting

How the EMA-cross signal works, stop loss / take profit logic, and how to backtest against up to 5 years of historical data.

API Reference

All five Cloudflare Pages Function endpoints — status, history, settings, execute-trade, and backtest — with request and response shapes.

Risk Management

Position sizing (95% of balance as margin), leveraged PnL formula, and how stop loss and take profit are enforced intra-candle.

Database Schema

Supabase PostgreSQL tables: wallet (single-row balance), positions (every trade), and bot_settings (JSONB strategy config).

System Architecture

How the three layers talk to each other.

Browser
Vanilla TypeScript
TradingView Charts
WebSocket
Binance
Public API
BTC/USDT stream
/api/*
Cloudflare
Pages Functions
TypeScript
SDK
Supabase
PostgreSQL
wallet · positions
EMA calculation, signal detection, SL/TP monitoring — all run in the browser via WebSocket feed.
Trade execution is persisted server-side through Cloudflare Functions (Supabase service key never reaches the browser).