Skip to main content
Skip to content
Agentic Finance

Can an AI Trading Ledger Survive a Restart? A 2027 Replay Audit

Correct replay preserves cash 716 and three units; a deliberately wrong restart produces 404 and six.

Two copper ledger rails meet at matching ivory blocks beside a closed blue journal.
Reading options: audio, text size & sections

What Matters: A restarted paper-trading process should reproduce its ledger without applying completed events twice. DN’s authored example ends with cash 716 and three units both uninterrupted and after a correct restart. Replaying the whole log on top of its checkpoint instead produces cash 404 and six units. A separate hash exercise detects an unrehashed edit but does not prove external authenticity.

A saved account balance is not enough to explain how that balance arose. A useful research ledger retains the ordered events, their identities and the transition from one state to the next. That makes it possible to ask whether a restart reproduces the same state or silently applies an event again.

The problem is especially easy to hide when a checkpoint and a complete history are both available. The checkpoint already includes part of the history. Loading it and then replaying every event may look cautious, yet it counts those earlier effects twice. The correct starting point depends on what the checkpoint actually represents.

What the inspected ledger implements

DN Evidence Block — checked 28 November 2026; author: Heath Muchena. DN inspected the pinned AI Hedge Fund paper-ledger source and ran two original standard-library exercises: balance replay and a small SHA-256 record chain. Neither exercise executes the upstream framework or connects to a broker.

The inspected ledger stores linked session records, checks record content hashes while replaying, and can rebuild state from the chain. Its checkpoint path skips sessions already represented by a selected checkpoint. A full-replay option ignores checkpoints. The source also checks a separate halt control. These are distinct controls; a balance calculation alone does not test all of them.

Start with an event sequence that can be checked by hand

Use initial cash of 1,000 quote units and no inventory. Event e1 buys three base units at 104 each, spending 312. Save a checkpoint immediately afterward: cash 688, inventory three. Event e2 records a cash credit of 28. That credit is an assumed external movement, not trading income or a gain on the inventory.

Original fictional ledger
StageCash movementCash after eventBase units
Initial stateNot applicable1,0000
e1: buy three at 104−3126883
Checkpoint after e1No new event6883
e2: external cash credit+287163

No mark price or sale is included. The experiment therefore does not calculate investment return. It asks whether the cash and quantity state can be reproduced from the same two events. Keeping that question narrow prevents a successful replay from being presented as evidence of a successful strategy.

Compare three restart policies

Uninterrupted replay starts from cash 1,000 and applies e1, then e2. The result is 1,000 − 312 + 28 = 716 cash and three units. A correct checkpoint restart starts from cash 688 and three units, recognises that e1 is already represented, and applies only e2. It reaches exactly the same result.

The intentionally incorrect policy starts from the checkpoint but applies both events again. Cash becomes 688 − 312 + 28 = 404. Inventory increases from three to six. Nothing in the event history authorised the second purchase; it is an artefact of replaying an already represented transition.

Same log, different interpretation of the starting state
PolicyStarting pointEvents appliedFinal cash / units
UninterruptedInitial statee1, e2716 / 3
Correct restartCheckpoint after e1e2 only716 / 3
Blind replayCheckpoint after e1e1, e2 again404 / 6

The wrong result is not a rounding difference. It duplicates the entire first event. A reconciliation that checks only whether the application starts successfully would miss it. Comparing the resulting cash and inventory with a known uninterrupted replay exposes the mismatch directly.

Use the restart reconciliation explorer

Restart reconciliation explorer

Compare uninterrupted replay, a restart after a known checkpoint, and an intentionally incorrect replay of the whole log on top of that checkpoint. No orders are sent.

Works in your browser with your inputs. No account, data subscription or broker connection is required.

A checkpoint already includes earlier events. Applying them again double-counts their effects.

Uninterrupted final cash
716
Uninterrupted final units
3
Correct restart cash
716
Correct restart units
3
Blind replay cash
404
Blind replay units
6
StageCashUnits
Initial10000
Checkpoint6883
Uninterrupted7163
Correct restart7163
Incorrect full replay on checkpoint4046

The cash credit is an authored external movement, not trading profit.

The intentionally incorrect replay may produce an impossible negative balance.

This explorer checks replay arithmetic only. It does not authenticate a checkpoint, hash a log or reconcile a broker.

The initial result is a worked example. Changing an input changes the stated scenario, not an exchange account or a verified market result.

The calculator accepts a bounded sequence of uniquely identified buy, sell and cash events. A checkpoint is defined as the state after a selected number of those events. The tool computes that state from the supplied history, so it does not rely on an unverified balance typed into a separate checkpoint field.

Set the checkpoint count to zero and both replay paths start from the initial state. Move it past the first event and the effect of incorrectly replaying the prefix becomes visible. The calculator rejects duplicate IDs, unsupported event types and invalid quantities. It does not submit, cancel or infer any real order.

What the hash experiment establishes

For a second, separate exercise, DN encodes each authored event together with the preceding record’s hash and calculates a SHA-256 digest. The original two-record chain verifies. Changing e1’s price from 104 to 105 without updating its stored hash causes verification to fail.

This is an internal-consistency result. The stored digest no longer matches the edited content. It is useful for detecting an accidental or unrehashed change, but it is not proof that the original event was true, that a broker executed it or that the person supplying the file was authorised.

DN also rebuilds every hash after changing that price. The rewritten chain passes its own internal verification and has a different final hash. That deliberate boundary test demonstrates why a self-contained chain is not automatically an externally anchored, tamper-proof history. A trusted independent reference or authentication scheme would be a separate design requirement.

Keep four controls separate

Questions a trustworthy restart must distinguish
ControlQuestionEvidence in this article
Replay consistencyDo the same events produce the same state?716 cash and three units in two correct paths
Duplicate handlingWas an already represented event applied again?Incorrect prefix replay produces 404 and six units
Record integrityDo contents still match stored chain hashes?Unrehashed edit fails the original check
External reconciliationDoes the history agree with the actual account?Not tested; no external account exists in this exercise

A good result in one row cannot fill an evidence gap in another. A perfectly replayable ledger can faithfully reproduce a wrong fill quantity. A hash-consistent file can contain invented events. An externally correct balance can still lack enough history to explain a duplicate command or recover an intermediate state.

Rebuilding state is different from repeating side effects

A replay function should reconstruct what the recorded events mean. Sending a purchase request again is a new external action, not a reconstruction. The toy example makes this distinction visible through quantities, but it does not implement a production command protocol or guarantee exactly-once exchange behaviour.

A real integration would need to distinguish intended commands, submission attempts, acknowledgements, unique executions and reconciliation observations. A process can stop between any two of those records. Restarting with only the latest intended order risks treating an unknown external result as if nothing happened.

That is why a checkpoint needs an explicit boundary: which events it includes, the ordering convention, its source history and the state-transition version. A changed interpretation of an old event can produce a different result even when the event bytes themselves are unchanged. Versioned transformation rules belong in the reproducibility packet.

A practical recovery record

Retain the initial state, ordered event identifiers, units, fees and external cash movements. Identify the checkpoint’s last included event. Preserve the reason for a halt and any manual intervention separately from the trading history. Compare a full replay with the resumed result before using the reconstructed state in further research.

When the two disagree, preserve the conflicting evidence instead of rewriting one balance to match the other. Find the earliest divergent transition. A small, inspectable difference is more informative than an unexplained adjustment added at the end, because it identifies whether the problem is duplication, missing data or an interpretation change.

Verify what the checkpoint claims to contain

A checkpoint is a claim about a state at a particular boundary. Matching its last-event identifier is useful, but an independent full replay is the stronger arithmetic comparison when the complete history is available. Compare cash, quantities and other relevant state fields, not just whether both paths mention the same final event.

The explorer computes its checkpoint from the authored events, so it deliberately avoids the separate problem of accepting a stale or incorrectly edited checkpoint file. The inspected framework has its own checkpoint checks; this independent calculation is not an audit of every possible corruption or trust scenario in that implementation.

Also preserve quantity units and rounding rules. A base-asset fee can change credited inventory, while a quote-currency fee changes cash. The tiny example excludes both rather than burying them inside a price. Adding either would require an explicit event interpretation and new expected balances. Otherwise two apparently identical replays can disagree because they are reconstructing different economic events.

Methodology and limits

DN reran ten balance and validation checks plus four hash checks. The original arithmetic and Python integrity example use only local authored data. There was no upstream installation, market feed, exchange call, latency measurement or investment-performance test. The credit of 28 remains an external cash movement throughout.

The Trading Tool Lab provides the restart explorer. Use the Research Data route for the accompanying evidence context. The useful outcome is a state that can be explained from its events, with unresolved external facts still explicitly unresolved.

Download the dated source and scenario record (JSON) · Download the reproducible calculation pack (ZIP).

Frequently asked questions

Was a live broker or the upstream ledger tested?

No. DN inspected pinned source and ran independently authored local arithmetic and hash-chain examples.

Why does blind replay produce six units?

The checkpoint already includes the first three-unit purchase. Applying that event again duplicates it.

Is the 28-unit cash credit profit?

No. It is an authored external cash movement and the example calculates no investment return.

Does a valid hash chain prove the events are authentic?

No. A fully rewritten chain can be internally consistent without an independent trusted reference.

Primary sources and evidence

Editorial disclosure: This research explains documented capabilities and original worked examples. Inclusion does not imply endorsement, a commercial relationship or verified trading performance. No placement in this article was purchased.

Corrections and updates: Send source-backed corrections to press@decentralised.news. This 2027 edition was checked on 28 November 2026; documentation, permissions and product availability can change.

Get the most talked about stories directly in your inbox

Join the Decentralised News briefing for independent crypto, DeFi and AI analysis. No spam, unsubscribe anytime.