Reactive Application Model

An Aurum strategy is an active program that declares event sources and effects in its sdk::Application. It is not a collection of framework-owned strategy callbacks.

Events and current values

on(TOPIC<...>, handler) reacts to each value delivered on a typed topic. ref(TOPIC<...>) reads the latest value when that resource has one. Event delivery and latest-value access are different contracts: an append-only order event stream is not equivalent to a cached market value.

Logical time

The scheduler orders admitted source events, timers, deadlines, and controls on the engine thread. Handlers observe engine time rather than assuming that wall-clock arrival order is the business order.

In LIVE mode, logical time follows live inputs under the configured late event policy. In REPLAY mode, eligible historical events drive logical time; ReplayConfig::speed controls wall-clock pacing, not event timestamps.

Effects and receipts

Queries, order submissions, and cancellations are effects. Submitting an effect returns a typed receipt with named outcome branches such as ok, err, timeout, accepted, filled, or rejected.

auto receipt = executor.submit(order);

on(receipt.accepted) = [](const OrderAccepted&) {
  log::info("order accepted");
};
on(receipt.rejected) = [](const OrderDenied& denied) {
  log::warn("order rejected: {}", denied.reason);
};

The submit call confirms local admission to the effect pipeline, not a fill. Strategy logic must handle every terminal outcome relevant to its risk model.

Policies

Effect policies express timeouts, retry, idempotency, serialization, latest request wins, ownership, and backlog limits. Apply them according to operation semantics. Retrying an idempotent state query is different from blindly retrying an order submission.

Determinism boundary

Replay can be deterministic when the application uses the same ordered input, configuration, and effect results. External network calls, wall-clock reads, unseeded randomness, and mutable out-of-process state sit outside that guarantee and must be controlled by the strategy author.