API and data reference
Every Binary AI Engine admin endpoint with its method, path and permission key, plus the thirteen database tables the addon owns and the settlement hooks it exposes to core binary trading.
Every endpoint below is under /api/admin/ai/binary-engine, requires
authentication, and is gated on the permission listed. Errors are returned with
HTTP 200 and the real code in the body — see the platform convention, not this
addon's doing.
There are no user-facing endpoints. The addon operates entirely behind core
binary trading; a user's browser never talks to it. What a trader sees comes from
/api/exchange/binary/*, which belongs to Bicrypto core.
Dashboard
The settlementDecisions object counts the last 24 hours of live settlements by
reason. A rising FAIR:EXPIRY_MINUTE_CLOSED share means settlements are running
after their expiry candle sealed.
recentAlerts is capped at 20 and is a sample, not a population. Never render
its length as a total and never search it for whether something happened —
lastEmergencyStop exists precisely because that pattern is wrong.
Engines
Bulk lifecycle
The status response carries engineAttached — whether this process is genuinely
running the engine rather than merely recording that it should. Treat
status: "ACTIVE" with engineAttached: false as a broken install.
Creating an engine returns 400 for an out-of-contract payload, 404 when the market maker does not exist, and 400 when that market maker already has an engine. Activating returns 400 with a readable message when the market maker is not running.
User tiers
Validation: winRateBonus 0–0.2, tierOrder 0–1000, maxVolume strictly greater
than minVolume, and a non-empty name on create.
Cooldowns
Validation: winRateReduction 0–1, expiresAt a parseable date.
Snapshots
Analytics
Machine learning
Cohorts
A/B tests
Time of day
Price correlation
The config endpoint accepts both vocabularies: enabled or
enableExternalCorrelation; deviationThresholdPercent (a percentage) or
maxDeviationPercent (a fraction); providers (a list, first entry becomes the
primary) or externalPriceSource (a single name). It returns 404 for an unknown
engine rather than a cheerful success, and 400 for an unknown provider or for
enabling monitoring with no provider at all.
Settings
Global settings are not served by this addon. The Settings page reads and
writes binaryAiEngine* keys through the core platform settings endpoint:
Every key is documented in Global settings.
The settlement hooks
Core binary trading reaches the addon through three functions, resolved lazily so an install without the addon simply has no engine.
| Hook | Called from | Effect when absent |
|---|---|---|
getBinaryAiSettlementPrice(order, realClose) |
The settlement path, three call sites | Returns the real close |
reconcileBinaryAiSettlement(order) |
After the settlement transaction commits | No-op |
getBinaryAiMaxOrderExposure(symbol) |
Order placement, live orders only | No cap |
The exposure lookup is asynchronous on purpose — the in-memory engine map is populated on the main thread while order placement happens anywhere. Its caller must await it: an un-awaited promise reads as "no cap" and silently disables the limit everywhere.
Database tables
Thirteen tables, all prefixed binary_ai_engine. Deleting an engine cascades to
every one of them.
| Table | Holds |
|---|---|
binary_ai_engine |
One row per engine: configuration and live period counters |
binary_ai_engine_position |
One row per tracked order, with the steering decision and outcome |
binary_ai_engine_action |
The append-only action log |
binary_ai_engine_daily_stats |
Archived period statistics |
binary_ai_engine_user_tier |
Per-engine tier ladder |
binary_ai_engine_user_cooldown |
Active and historical cooldowns |
binary_ai_engine_snapshot |
Configuration snapshots |
binary_ai_engine_simulation |
Simulation runs |
binary_ai_engine_ab_test |
Experiment definitions and state |
binary_ai_engine_ab_test_assignment |
User-to-arm assignments |
binary_ai_engine_cohort |
Cohort definitions |
binary_ai_engine_correlation_alert |
Deviation alerts |
binary_ai_engine_correlation_history |
Correlation samples |
binary_ai_engine.marketMakerId carries a unique index — one engine per
market maker — and status is indexed for the restart-recovery query.
The driver returns every DECIMAL as a string. Target win rates, thresholds, profits and adjustment percentages are all DECIMAL. If you query these tables directly, coerce before you add — string concatenation is the failure mode, and it is silent.
Enum values
| Column | Values |
|---|---|
binaryAiEngine.status |
ACTIVE, PAUSED, STOPPED |
practiceMode |
DISABLED, SAME_AS_LIVE, CUSTOM |
optimizationStrategy |
CONSERVATIVE, MODERATE, AGGRESSIVE |
whaleStrategy |
REDUCE_EXPOSURE, ALERT_ONLY, FORCE_LOSS |
tierCalculationMethod |
VOLUME, DEPOSIT, MANUAL |
externalPriceSource |
BINANCE, COINGECKO, CRYPTOCOMPARE |
allowedOrderTypes |
RISE_FALL, HIGHER_LOWER, TOUCH_NO_TOUCH, CALL_PUT, TURBO |
Position side |
RISE, FALL |
Position outcome |
PENDING, WIN, LOSS, DRAW |
Position status |
ACTIVE, SETTLED, CANCELLED |
Cooldown reason |
BIG_WIN, STREAK, MANUAL |
A/B test status |
DRAFT, RUNNING, COMPLETED, CANCELLED, STOPPED, PAUSED |
A/B test primaryMetric |
WIN_RATE, PROFIT, RETENTION, VOLUME |
Alert severity |
LOW, MEDIUM, HIGH, CRITICAL |
Note that only RISE_FALL is ever steered, regardless of what allowedOrderTypes
contains. Every other type settles fairly.
The cron job
| Property | Value |
|---|---|
| Name | processBinaryAiEngine |
| Category | binary_ai_engine |
| Period | 10 seconds |
| Gated on | The binary_ai_engine extension row being enabled |
It supervises lifecycle, restart recovery, the kill switch, period rollover, A/B test expiry, correlation monitor reconciliation and ML auto-apply. The per-second steering loop is separate and lives inside the engine singleton.