Simulation and Replay¶
Use a paper executor to test order and accounting behavior without sending an
order to a live venue. Use REPLAY mode when the input source supplies
historical events.
Paper execution¶
Paper accounts use the same executor and receipt interfaces as live accounts:
device::BoundExecutor paper_;
paper_ = bind<device::BoundExecutor>(paper::Account{
.id = "paper",
.balances = {
{.asset = "USDT", .amount = Notional{100'000}},
{.asset = "BTC", .amount = Notional{0}},
},
.instruments = {
Instrument::Spot("BTCUSDT", "BTC", "USDT"),
},
.simulation = paper::fromBar{
.topic = "bar://okx/BTCUSDT@1m",
.latency = time::milliseconds(100),
},
});
fromBar fills from the configured bar stream. Choose a model that matches
the data available to the run; a fill model is not a substitute for exchange
queue simulation.
Replay mode¶
sdk::Application({
.mode = sdk::RuntimeMode::REPLAY,
.replay = ReplayConfig{.speed = 0.0},
})
speed = 0 processes eligible events without wall-clock pacing. A positive
speed maps logical event time to wall time.
Runtime controls¶
Installed replay projects support pause and resume:
aurum pause replay-demo
aurum resume replay-demo
Runtime controls currently operate on the selected local Aurum home and do not
accept --server. Use the Forge environment’s operator surface when the
instance runs remotely.
Validate before live trading¶
Confirm at least the following before replacing a paper executor:
expected resource keys appear in the runtime catalog;
rejected and partially filled receipts are handled;
balances and positions converge after fills;
replay completes without dropped lossless events;
strategy identity and version are ready for an immutable push.