Open the app
Execution & risk

Execution engine

An isolated service that only it holds exchange credentials, accepts structured instructions, and validates every order deterministically.

The execution engine is a separate, isolated service. Only it receives exchange credentials, and it accepts structured instructions, not free-form text— every order is validated deterministically before it leaves.

Structured instruction

execution/instruction
strategy_version · exchange · symbol · side · order_type
quantity · limit_price · maximum_slippage · time_in_force
stop_conditions · take_profit_plan · expires_at · approval_id

Deterministic validation (before every order)

The engine checks, in code:

  • strategy status
  • human approval (where required)
  • risk limits
  • balance
  • current liquidity
  • spread
  • maximum slippage
  • market status
  • instruction expiry
  • duplicate execution
  • audit record created

Execution intents

A strategy produces a signal; the risk engine turns it into an approved execution intent; only then does the executor build an order. The intent is immutable after approval — any change requires a brand-new intent.

execution/intent (immutable)
intent_id · signal_id · risk_decision_id · venue · symbol · side
order_type · quantity · limit_price · stop_price · target_price
maximum_slippage_percent · expires_at
strategy_version · risk_model_version

Precision & idempotency

Quantities are rounded down to the venue step size, then the planned risk is re-validated on the rounded number:

Every order carries an idempotency key, so a retry, restart or duplicated message can never create a second position:

idempotency key
clawlas:{strategy_id}:{signal_id}:{intent_version}

Order lifecycle

Orders move through normalized states. A timed-out request may still have created an order, so the engine never assumes failure — an UNKNOWN state forces reconciliation against client/exchange IDs, open/closed orders and balance changes.

  1. CREATED → VALIDATED
    Intent built and checked
  2. SUBMITTED → OPEN
    Live on the venue
  3. PARTIALLY_FILLED → FILLED
    Fills tracked, remaining quantity updated
  4. CANCELED · REJECTED · EXPIRED
    Terminal non-fill states
  5. UNKNOWN → RECONCILIATION_REQUIRED
    Resolved against the real account — never assumed

The exit engine

Because holding periods are short, exits are continuously evaluated. Triggers include:

  • take-profit, trailing stop, maximum loss, maximum holding duration;
  • volume collapse, liquidity removal, spread expansion, momentum reversal;
  • whale distribution, social momentum reversal, strategy invalidation;
  • contract-risk event, exchange incident.
Kill switch & idempotency
A global kill switch blocks new orders, optionally cancels open orders, preserves logs, notifies the dashboard and requires explicit human reactivation. Every live order carries a client_order_id idempotency key, and the engine reconciles against the real exchange account on boot so a restart never duplicates a position.