Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/deskiziarecords/QUIMERIA-HYPERION/llms.txt

Use this file to discover all available pages before exploring further.

The AEGIS bridge is the final layer between SMK signal generation and real order placement. It wires the step() result through a CLM tokenizer, a SequenceStopLossManager, and (when installed) AegisExtensions for Kelly sizing and venue routing. All bridge dependencies are lazy-loaded — a missing stop_loss_manager.py or aegis_extensions.py degrades gracefully without crashing the server.

AEGIS bridge architecture

SMK step() result
    ↓  r['veto']['trade_allowed'] == True?
    ├── NO  → skip, log to veto.log
    └── YES ↓
        CLMTokenizer.sequence(last 8 bars)   →  "BWBUID…" (7-symbol alphabet)
        SequenceStopLossManager.calculate()  →  SL%, TP multiplier, lot size, R:R gate
        AegisExtensions.on_signal()          →  kelly_size + venue_allocation[]
            MandraBitGate → RevPeriodGuard → SchurRouter
        result stored in r['execution']
The key execution gate is r['veto']['trade_allowed']. AEGIS checks this boolean before invoking any order logic. If it is False, the execution section of the step result will show action: "VETO".

POST /api/live/start

Start the Bitget REST polling live feed. The feed polls the Bitget spot candle endpoint every 5 seconds, bootstraps 100 bars of history to warm the pipeline, then processes each new closed candle through step() and broadcasts results to ws://localhost:8000/ws/live subscribers.

Request body

api_key
string
default:""
Bitget API key. Leave empty to use the BITGET_API_KEY environment variable, or to access public endpoints only.
symbol
string
default:"EURUSDT"
Bitget spot symbol to poll, for example "BTCUSDT" or "EURUSDT".
granularity
string
default:"1m"
Candle interval for the live feed: "1m", "5m", "15m", "1H".

Response

status
string
"ok" when the feed starts successfully.
symbol
string
The symbol being polled.
granularity
string
The candle interval.

Example

curl -X POST http://localhost:8000/api/live/start \
  -H "Content-Type: application/json" \
  -d '{"symbol": "EURUSDT", "granularity": "1m"}'
{"status": "ok", "symbol": "EURUSDT", "granularity": "1m"}

POST /api/live/stop

Stop the Bitget polling live feed. Existing WebSocket connections to /ws/live are not closed but will receive no further bar messages.

Response

status
string
"stopped" when successfully halted, or "realtime not available" if the realtime module was not loaded.

Example

curl -X POST http://localhost:8000/api/live/stop
{"status": "stopped"}

GET /api/execution/status

Return AEGIS bridge availability and current configuration. Use this to verify whether the full execution chain is wired before starting live trading.

Response

slm_available
boolean
true if StopLossManager imported successfully from managers/stop_loss_manager.py.
aegis_available
boolean
true if AegisExtensions imported successfully from utils/aegis_extensions.py.
enabled
boolean
Whether the bridge is currently enabled (will process PROCEED bars).
capital
number
Capital amount configured for Kelly position sizing.

Example

curl http://localhost:8000/api/execution/status
{
  "slm_available": true,
  "aegis_available": true,
  "enabled": true,
  "capital": 10000.0
}
If slm_available or aegis_available is false, the pipeline still runs and generates signals, but the r['execution'] section of each bar result will be minimal — no Kelly sizing, no venue allocation, and no stop-loss levels.

GET /api/execution/stats

Return session statistics from the StopLossManager, including win/loss counts, average R:R ratios, and sequence pattern frequency.

Response

status
string
"ok" when the bridge is available, or "unavailable" with an error key when it is not.
stats
object
Session statistics from the StopLossManager.

Example

curl http://localhost:8000/api/execution/stats
{
  "status": "ok",
  "stats": {
    "total_signals": 42,
    "wins": 28,
    "losses": 14,
    "win_rate": 0.667,
    "avg_rr": 1.85,
    "dominant_pattern": "BWBUI"
  }
}

The veto flow: r[‘veto’][‘trade_allowed’]

Every bar processed by step() produces a veto section. This is the canonical execution gate that AEGIS and the frontend both read.
{
  "veto": {
    "decision": "Proceed",
    "reasons": [],
    "trade_allowed": true
  }
}
When any Ring 0 condition triggers, trade_allowed flips to false and one or more reason codes are added:
Reason codeTrigger
MANDRA:DE<0Mandra Gate: negative information energy gain (ΔE < 0.02)
TOPO:H1_FRACTUREPersistent homology H₁ loop sum exceeds threshold
FUSION:LAMBDA_VETOLambda fusion engine issued a hard veto
L3:LIAR_STATEHarmonic trap: FFT phase inversion > π/2
KL:REGIME_FRACTUREKL divergence > 1.3× threshold
CONF:INSUFFICIENTFusion confidence < 0.2
ACTION_CENTER:PENDINGAction Center awaiting human confirmation
{
  "veto": {
    "decision": "Halt",
    "reasons": ["MANDRA:DE<0", "CONF:INSUFFICIENT"],
    "trade_allowed": false
  }
}
Stream the veto log via GET /api/logs/veto.log?lines=50 to trace which conditions are triggering most frequently during a backtest session.

Build docs developers (and LLMs) love