Kraken Trading Lab
A local PAPER-only prototype exploring a practical question: how can an automated decision remain bounded, explainable and recoverable when data or persistence fails?
Status: Documented V1 implementation; simulated execution only. No real orders, profitability or current runtime health is claimed. The historical project tests have not been rerun for this website.
Why I built it
A strategy signal is only one part of an automated system. The more useful engineering challenge was deciding whether a proposed action was permitted, recording what happened, and recognizing when a restart must stop for review.
I used public market observations as input to a local learning project. Its value here is the separation of responsibilities and failure handling, rather than any investment outcome.
My contribution
I built the paper-execution workflow around deterministic strategy logic, risk evaluation and persisted local state. I worked on replay identities, operator stops, monitoring and recovery specifications.
The portfolio evidence is a reviewed documentary snapshot. It supports the component boundaries and mapped tests described below, rather than a fresh independent reproduction of every method.
Architecture and execution boundary
Public Kraken REST observations are fetched, normalized and validated. Only coherent closed candles feed a simple deterministic moving-average strategy. The strategy produces a BUY, SELL or HOLD proposal; it cannot authorize a broker action.
The paper execution service applies replay checks and the persistent manual stop, then requests an ALLOW or BLOCK decision from the risk engine. Only an allowed action reaches the paper broker. SQLite stores paper orders, fills, portfolio snapshots and processing progress.

Deterministic controls before a paper fill
Freshness and market availability checks reject unsuitable inputs. The documented risk policies examine cash, holdings, spread, order size, exposure and daily-loss limits before new simulated execution.
A persistent STOP_TRADING flag prevents new activity and requires a person to remove it. A local runner lock protects single-writer ownership of the paper database; it is not distributed coordination.
The strategy, risk decision and broker have different responsibilities. A new strategy must still pass through the same execution boundary; it does not inherit permission simply because it produced a signal.
Recovery starts with knowing what committed
An already finalized candle must not create another fill. If a fill committed before processing progress was finalized, a stable logical order identity allows reconciliation with the existing paper effect.
A failure before the transaction commits should roll back the financial paper writes. An uncertain commit, corrupt state or fatal condition must stop new activity until an operator reconciles it. These paths should not be collapsed into a blanket exactly-once guarantee.
The fill and progress updates are not presented as one universal transaction. The gap between them is precisely why stable identities and explicit recovery decisions matter.

Visibility and operator control
Read-only health, status and reporting surfaces help explain the recorded state. Structured events and logging are part of the documented operational design; they do not prove every incident will be detected.
An unhealthy Docker healthcheck does not itself restart a process. The operator remains responsible for the environment, stop state and decisions around uncertainty. SQLite backup, validation and restore comparison are documented as specific checks, not unrestricted disaster-recovery assurance.
What the historical evidence establishes
The failure matrix contains 34 documented scenarios: 32 map to named automated tests, one has a partially tested Docker-health transition, and one is a manual-only abrupt Docker lifecycle drill. A scenario row is not a newly passing test.
The supplied inventory lists 38 test modules, but it does not establish a collected or passing test count. No new pytest collection, pytest execution, Ruff run or destructive lifecycle drill was performed for this website.
Mapped areas include invalid market data, risk limits, replay, persistent stops, runner locking, transaction rollback, state integrity, backup and redacted logging. That coverage is useful documentary evidence; current suite success remains unverified.
Limits that remain important
There is no live exchange order submission, leverage, withdrawal path or verified financial return in this case. No live trading safety or uninterrupted soak result is inferred from paper behavior.
A general append-only ledger, distributed coordination, autonomous AI strategy discovery and a multi-asset V2 are not delivered capabilities here. The optional public WebSocket foundation is distinct from the REST-based baseline.
Destructive restart and corruption drills belong in disposable test environments. The active research runner was not touched during portfolio preparation.
What I take into integration work
Keep a proposed action separate from authorization. Give repeated work a stable identity, make ambiguous state a reason to stop, and test the windows between side effects and progress bookkeeping.
Those lessons transfer to CRM writes and business workflows even when the domain has nothing to do with trading.