Article · first published August 2026 · updated November 2026

Order execution as a separate service

Reasoning and order placement are two processes with opposite failure modes. This page describes the split, the checks in between, and what is still missing before real capital.


Two processes

In the first versions the engine placed its own orders in the same event loop. That worked until it did not: a model API timeout or a database lock could freeze the loop, and a position could sit open with nothing watching it. The engine that reasons and the process that talks to the exchange are now separate.

The engine writes an atomic decision: symbol, side, size, stop, target, leverage, confidence, reasoning and an order_id. The executor — a small service in its own repository, llm_trader_executor — reads decisions over HTTP with a JSON-file fallback, places orders through CCXT, sets exchange-side protection, and writes a journal entry for each decision. If the engine dies, the executor and the exchange-side stop stay alive with the position.

The executor is not open source yet; the engine is. That asymmetry is a fact about the current state, not a claim that the hidden part is more trustworthy.

The decision object

A decision is a small JSON document: order_id, symbol, signal (BUY, SELL, CLOSE, UPDATE), quantity, entry_price, stop_loss, take_profit, leverage, confidence, reasoning. The order_id is the idempotency key: the same decision can arrive through the API and through the file fallback with different metadata, and only the first one executes.

Checks before an order leaves

The executor validates every entry in src/safety.py of its own repository, in this order:

  1. Duplicate detection — by order_id and by a content hash of the decision, persisted to disk, so a restart cannot re-execute the same trade;
  2. Actionable signal — anything that is not a known entry, close or update is dropped;
  3. Confidence floor — entries below the configured minimum are blocked; CLOSE and UPDATE are deliberately exempt, because a low-confidence signal should still be able to exit a losing position;
  4. Quantity sanity — entries need a positive size;
  5. Leverage cap — anything above the configured maximum is rejected;
  6. Order type — with market entries configured, limit orders are refused rather than quietly resized;
  7. Maximum position notional — quantity × entry price has to fit the USDC limit, re-priced from the exchange when the decision arrives without a price.

On the engine side the same decision already passed the configured-symbol guard, the position-size cap and the entry R/R policy (described in the cycle article). A spot SELL is capped to what is actually held, so a short cannot be created by accident. If any check cannot decide safely, the system fails closed: no order, no exception path around it.

Why a journal

A successful HTTP call is not proof that an order exists. Instead of assuming, the executor appends one JSONL line per processed decision — executed, blocked or error — with the reason, keyed by the engine's order_id. The engine reads that file back to find out what actually happened to its own decision, and the dashboard shows the result.

Friction is reported rather than swallowed: a clamped position size or a blocked decision appears in the journal and on the dashboard, and an unknown state is shown as unknown instead of as a green checkmark.

Where this stands (October 2026)

  • The executor runs against an exchange testnet (ENABLE_TESTNET=true, sandbox endpoints). It has placed test orders and it has never touched real funds.
  • It was last exercised in November 2026: the verdict journal in the bot's repository has executed entries up to 2026-11-15. Since then the work went into the engine, the tests and the R/R policy, so the live path is the least recently certified part of the system.
  • The weakest part is reconciliation: proving that what the exchange holds matches what the journal claims, including late fills and partially executed orders. That has to be boring and reliable before any real capital is considered, and it is not there yet.
  • Capital stays simulated until the pipeline has survived a long enough period to say something. That is a decision, not a limitation being hidden.

What this does not prove

  • Testnet is not live. Fills, slippage, rate limits, maintenance windows and exchange rejects behave differently with real orders and real liquidity.
  • Guards reduce risk, they do not remove it. Each check prevents a known class of mistake; none of them makes a bad thesis profitable.
  • The journal is only as true as reconciliation. A blocked or executed line is a record of what the executor believes it did.
  • The executor is closed source for now, so the seven checks above cannot be verified by a reader of this site — only by their effect on the journal.

The dashboard shows the current position, the latest decision and the audit trail behind it.

Live dashboard ↗Engine source ↗
Risk notice: This is an experimental open-source project, not financial advice. Real-money trading is not enabled; everything you see runs on simulated capital or an exchange testnet. Trading crypto carries substantial risk. See the full risk disclaimer.