Babingepet
2.0
Real-time multi-market quantitative trading framework. AI swarm intelligence meets microstructure alpha across crypto futures, Indonesian equities, and bandarmology.
3 Active Markets + 1 Scanner
All markets run in paper trading mode. Live Binance Futures execution is planned for mid-2026 after readiness checklist clears.
| Market | Cycle | Key Feature | AI Agents | Status |
|---|---|---|---|---|
| BTC/USDT Futures | 60 seconds | 13-signal adaptive decision engine | 9-agent swarm | Paper Live |
| Altcoin Futures | 4 hours | 8-factor composite · 30-coin universe | 5-agent swarm | Paper Live |
| IHSG (Indonesia) | 2× daily | Regime-adaptive · 30 LQ45 stocks | 5-agent swarm | Paper Live |
| IHSG Scanner | On-demand | 5-signal bandarmology · 55 brokers | Broker intel DB | API Pending |
Architecture Diagram
Complete layer flow from external data through collection, signals, AI, decisions, execution, learning, memory, and delivery.
BTC/USDT Engine
60-second cycle. 13-signal adaptive decision engine. 9-agent AI swarm (3 generalists + 6 personas). Kelly-sized paper trading from $1,000 base.
signal_evolution.py and factor_analysis.py.
Altcoin Engine
4-hour cycle. 30-coin universe across 9 sectors. 8-factor composite scoring + 5-agent AI swarm with sector diversification gates.
IHSG Engine
Indonesian Stock Exchange. 30-stock LQ45 universe. Session 1 (momentum) + Session 2 (mean reversion). Regime-adaptive weighting, news validation, 5-agent AI swarm.
IHSG Scanner
On-demand bandarmology analysis for any IDX ticker. 5-signal composite, 55-broker intelligence database, whale-adjusted net ratio, money management calculator.
crypto/neobdm/). Dashboard HTML exists (neobdm_dashboard.html). API routes and /neobdm dashboard route are NOT registered in api.py. On-demand access pending wiring.
AI Model Map
All AI via OpenRouter. Cost-optimized April 2026 — generalists dropped from Gemini 2.5 Pro to 20× cheaper Flash tier. 6 distinct models across 5 providers.
| Model | Cost Tier | Used For |
|---|---|---|
| google/gemini-2.5-flash | Mid | BTC generalist + 3 personas · Altcoin (3 agents) · IHSG (2 agents) |
| meta-llama/llama-3.3-70b | Free tier | BTC generalist · Altcoin quant_scorer |
| openai/gpt-4o-mini | Budget | BTC generalist · IHSG momentum_trader |
| deepseek/deepseek-chat | Budget | BTC momentum · Altcoin momentum_hunter · IHSG quant_analyst |
| google/gemini-2.0-flash-001 | Budget | BTC contrarian persona |
| anthropic/claude-3-haiku | Budget | BTC risk_manager · IHSG risk_analyst |
generalist × 0.40 + swarm × 0.60 · Generalist weights driven by historical accuracy (not normalized) · Last 50 predictions injected into next prompts · Agreement metric uses bull/bear count thresholds (p > 0.55 / p < 0.45).
Adaptive Learning Layer
Core runtime system not documented in prior versions. Signal weights and thresholds evolve based on outcome feedback. Factor IC/IR analysis runs weekly. Walk-forward validation gates ML re-elevation.
Decay losers × 0.94
Bounded: [base × 0.5, base × 1.5]
Threshold auto-evo: tighten if WR < 40%, loosen if > 65%
Auto-demotion/promotion overrides
Writes to
data/signal_weight_overrides.jsonExample: ml_xgboost demoted to 0.03
Out-of-sample accuracy scoring
Gatekeeper for re-elevation
Prevents overfitting approval
Condition keys: vpin_regime, ofi_pressure, entry_grade, session, regime
Wilson CI per pattern → skip/reduce/boost
Output:
learning_insights
Populates
crypto_ai_reasoning_logFeeds dashboard reasoning panel
Feeds dashboard reasoning panel
Volatility regimes
Recovery patterns
Empirical
HOUR_WIN_RATE dict
Decay ×0.94
Bounded [0.5×, 1.5× base]
Auto-demote overrides →
overrides.json
→ skip / reduce / boost
Condition-key insights
10.7% accuracy
currently demoted
BM25 search
Context injection
Memory System
Hippocampus is the sole memory layer after Hermes removal (v3.2.0). Engram-based pattern memory with BM25 retrieval and chronicle narratives. Partially integrated — full utilization ongoing.
/root/hippocampus/. Backing store: SQLite at /root/hippocampus/data/babingepet_memory.sqlite.
Risk Management Layer
Multiple guard tiers across all engines: hour vetos, regime gates, vote agreement, AI consensus veto, drawdown circuit breakers, post-loss cooldowns.
Database Schema
Supabase PostgreSQL. 20+ tables across BTC, Altcoin, IHSG, and cross-market learning. Hosted externally, accessed via service key.
API Endpoint Map
60+ total endpoints exposed via FastAPI on port 8420. Grouped by market. Auth via token-based session (daily rotation).
Scheduler Timeline
15 active APScheduler jobs inside the FastAPI lifespan. Mix of interval (60s-4h) and cron (UTC-scheduled) triggers.
| Job ID | Trigger | Schedule | Purpose |
|---|---|---|---|
| btc_collector | interval | 60s | Binance Futures data pull |
| btc_signals | interval | 60s | Signal computation |
| btc_simulator | interval | 60s | Paper trading cycle |
| btc_ai | interval | 20min | 9-agent AI swarm |
| ihsg_session_1 | cron | 01:50 UTC | IHSG S1 full analysis |
| ihsg_session_2 | cron | 06:20 UTC | IHSG S2 full analysis |
| ihsg_price_check | interval | 30min | IHSG exit checks |
| altcoin_analysis | interval | 4h | Altcoin full cycle |
| altcoin_price_check | interval | 30min | Altcoin exit checks |
| health_daily | cron | 23:30 UTC | Daily health rollup |
| health_weekly | cron | Sat 01:00 UTC | Weekly anomaly scan |
| health_alerts | interval | 15min | Real-time alerts |
| factor_ic_weekly | cron | Sun 00:05 UTC | IC/IR factor analysis |
| walk_forward_weekly | cron | Sun 00:20 UTC | OOS validation |
| auth_password_rotate | cron | 23:00 UTC | Daily password rotation |
Deployment Architecture
Ubuntu 22.04+ VPS. FastAPI on port 8420 behind Nginx SSL. Single long-running process after Hermes removal. Domain and credential details redacted.
nohup and requires manual restart after reboot. Registering babingepet.service is a recommended hardening task.
Health Monitoring
Three-tier health check: real-time alerts, daily rollup, weekly anomaly scan. Delivered via Telegram.
Known Gaps & Activation Backlog
Documented deltas between designed architecture and currently-wired production behavior. All items surfaced during v3.1.0 reconciliation.
Polymarket Legacy
Polymarket was part of Babingepet through v2.x. Removed April 18, 2026 after zero trades in a week.
/polymarket)archive/polymarket/recovery.py (try/except)polymarket-quant/ (historical)