ODIN SuiteAsgard Hashworks

// Engineering briefODIN v1.9.2counted at commit df410d3 · 2026-11-27

Rules that hold because a test fails if they don't.

ODIN spends real money on its owners' accounts, so the rules below are written as code and checked by named tests that every release must pass. Everything on this page was counted in the source of v1.9.2.

2 s
one cycle of six steps
409
tests in the trading engine (408 run on every build; 1 is a manual check against a live market)
17
simulated sessions of the real program
18
tests in SLEIPNIR
12
direct dependencies in ODIN (13 on Windows), each scanned for known vulnerabilities

Counted with cargo test -- --list and odin/Cargo.toml at commit df410d3, 2026-11-27. The full test list.

01One program, six steps

ODIN is one program. main reads the command line, sets up, builds an Engine that holds everything carried between cycles, and then calls engine.cycle() in a loop. A cycle is six steps in a fixed order: read the markets, decide, work the NiceHash orders, run the other markets, keep records, draw the screen.

Each step is a struct. It takes this cycle's values by copy, what it only reads by shared reference, and the state it may change by mutable reference, so a step's reach is visible in its field list: the drawing step holds no way to reach an order. Time comes from one clock and every outside address goes through one door; tests replace both.

Fig. 1: main builds the Engine and calls cycle() in a loop. The cycle runs six steps in order; orders and venues can spend and sit behind the hold. Every step uses one clock, one door to the outside, one learned model, the Sats money type, the safety module and the audit chain.main.rsflags, setup, Engine::newengine.rsloop { engine.cycle() }01 READreading.rs · struct Readreads markets and config02 DECIDEdecide.rs · struct Decidereturns a Decision03 ORDERSorders.rs · struct OrderDeskmay change NiceHash orders04 VENUESvenues.rs · struct OtherMarketsmay change venue state05 RECORDSrecords.rs · struct Recordsledger, report, learned state06 PRESENTpresent.rs · struct Framereads onlyGOLD: CAN SPEND · DASHED: BEHIND THE HOLD (venue_hold)SHARED BY EVERY STEP · TESTS REPLACE THE CLOCK AND THE DOORclock.rsthe one clocknet.rsthe one door outsidemodel.rslearned state, 6 functionsmoney.rsSats, whole satoshissafety.rscaps, kill switch, holdaudit.rsSHA-256 chain
  1. 01 READ reading.rs · struct Read: reads markets and config
  2. 02 DECIDE decide.rs · struct Decide: returns a Decision
  3. 03 ORDERS orders.rs · struct OrderDesk: may change NiceHash orders
  4. 04 VENUES venues.rs · struct OtherMarkets: may change venue state
  5. 05 RECORDS records.rs · struct Records: ledger, report, learned state
  6. 06 PRESENT present.rs · struct Frame: reads only
  7. SHARED clock.rs (the one clock), net.rs (the one door outside), model.rs, money.rs, safety.rs, audit.rs
Fig. 1 Structure of one cycle. Notice that only the two gold steps can spend, and both sit behind the hold.

Enforced by: only_the_order_desk_places_funds_or_reprices_nicehash_orders · no_module_imports_everything

02The gates and the one hold

A spending action needs every gate open: the market set to LIVE, ODIN not in watch-only (DRY_RUN=0), the kill switch armed, a paid plan, a key and a budget, and fresh data. Braiins is the reference every newer market is gated against.

Since v1.6.4 there is one hold for all markets: venue_hold() turns watch-only and a tripped kill switch into a single reason that every market reads. While held: no new orders or rentals, no raised bids, no re-bids; safety stops still run. The Clore and Vast passes read the hold again right before each spending call and start out held. A NiceHash outage also sets the hold, because the kill-switch checks need NiceHash.

The hold gives a reason for watch-only and for a trip: watch_only_and_the_kill_switch_hold_every_venue. Markets obey it: clore_full_pass_never_raises_a_bid_while_held · vast_full_pass_never_rebids_while_held_but_does_when_allowed

03The kill switch

The kill switch trips on the daily loss cap across all markets (default 20,000 sats, counting only verified, already-used cost, with a warning at 75%) or on a file named odin_KILLED.flag created while ODIN runs. A trip about money cancels ODIN's own NiceHash orders and Braiins bid, destroys the Vast rentals it started and cancels the Clore rentals it started; anything you placed yourself is left running and listed in one urgent alert. If ODIN can't show a Clore rental is its own, it cancels nothing and tells you to check by hand. In watch-only it holds but stops no rentals. Each stop is made once, from a list read that minute; an unreadable flag stops nothing, because destroying is never the fail-safe direction, holding is.

Enforced by: the_kill_switch_stops_all_spending_and_cancels_the_orders · kill_switch_stops_running_clore_and_vast_rentals_once · paid_plan_kill_stop_stops_only_odins_own_clore_rentals · lost_clore_memory_kill_stop_leaves_the_rental_and_says_check_by_hand · a_refused_kill_switch_cancel_is_retried_until_it_goes_through_and_never_twice

04Unknown replies

A timeout or an unreadable answer to a rental request does not mean “no”. ODIN counts the rental as placed (it takes a slot and counts toward the budget), reads the account again, and sends no second request. On Braiins the same request is retried under Braiins' own idempotent rule until it is confirmed, and Vast's create re-reads the instance list first.

Enforced by: mrr_unclear_answer_to_a_rental_never_rents_twice · clore_unclear_answer_to_a_rental_never_rents_twice

05Stale data and hostile numbers

ODIN never prices from a NiceHash order book older than 20 seconds; stale data marks the market as waiting. Every number read from an outside API passes one reader that rejects NaN, infinities and absurd values. A recorded NiceHash order book and thousands of corrupted copies (wrong types, nulls, 1e308, truncated bodies, outage pages) are replayed through every parser by the test suite.

Enforced by: freshness_gate_blocks_old_market_data · hostile_nicehash_pages_never_panic_or_leak_bad_prices · chaos_number_and_money_readers_never_panic_and_stay_in_range

06Whole satoshis

Amounts sent to an exchange and balances read from one are Sats: a whole number of satoshis in a 64-bit integer, parsed digit for digit and written back exactly. Prices, rates and margins stay decimal on purpose, because they are rates, not money. A balance ODIN can't read as a proper amount means hold.

Enforced by: a_decimal_string_is_read_exactly · spendable_amounts_never_round_up

07Simulated sessions

The real ODIN program is started by a test on a clock the test controls, with its outside address pointed at a stand-in NiceHash. Each session trades up to 80 minutes of scripted market in seconds, about 9 hours across all 17. The test then reads back every request ODIN actually sent and checks the money rules on them. To prove a refactor changed nothing, the request logs of the old and new build are compared byte for byte.

Fig. 2: the test starts the real ODIN program built with simulation hooks, gives it a controlled clock and a stand-in NiceHash, runs a plan of market moves, then reads back every request ODIN sent and checks the money rules.TEST PLANmarket moves, cyclesODINthe real programSTAND-IN NICEHASHanswers, records requestsREQUEST LOGevery call ODIN madeMONEY RULESasserted per requestODIN_SIM_START_MS · ODIN_SIM_CYCLES · ODIN_SIM_PLAN · ODIN_SIM_APITHE HOOKS EXIST ONLY IN THE TEST BUILD · A RELEASE PROGRAM THAT NAMES ONE IS REJECTED
  1. TEST PLAN market moves and a number of cycles
  2. ODIN the real program, built with test hooks
  3. STAND-IN NICEHASH answers and records every request
  4. REQUEST LOG every call ODIN made
  5. MONEY RULES asserted on each request
Fig. 2 A simulated session. Notice that the program under test is the real one; only the clock and the exchange are stand-ins.

08The audit chain

Every create, re-price, re-bid, cancel and destroy is written to odin_audit.jsonl. Each record holds a sequence number, a time, the event and the SHA-256 of the record before it; the first record points at 64 zeros. odin --verify-audit reports the first edited, removed or reordered line.

{"seq":1841,"ts":"2026-11-27T14:05:12.481…+00:00","event_type":"ORDER_PRICE", … ,"prev_hash":"4be0…71c2","hash":"9f3c…2a1b"}
{"seq":1842,"ts":"2026-11-27T14:05:14.902…+00:00","event_type":"QUANT_CHANGEPOINT", … ,"prev_hash":"9f3c…2a1b","hash":"d61a…0e93"}
{"seq":1843,"ts":"2026-11-27T14:05:16.117…+00:00","event_type":"ORDER_CANCEL", … ,"prev_hash":"d61a…0e93","hash":"27b8…c4f0"}

$ odin --verify-audit odin_audit.jsonl

Fig. 3 Format only: synthetic values, shortened hashes. Notice that each record's prev_hash is the hash of the line above.

Enforced by: chain_verifies_detects_tampering_and_survives_a_torn_write

09Keys, licences and secrets

No withdraw rights. Setup tells you to make every market key with withdrawals off; ODIN cannot check a key's rights; what ODIN controls is its own code, and the source contains no withdrawal or transfer call to any market. Keys at rest: on Windows, keys in odin.env are sealed with DPAPI. On Linux, sudo odin-seal-secrets (offered by the installer) encrypts each key with systemd's encrypted credentials, bound to the machine and to its TPM2 chip when it has one; systemd decrypts them only for the ODIN service. It needs systemd 250 or newer (Ubuntu 24.04+, Debian 12+); on Ubuntu 22.04 the keys stay in a root-only file. A key ODIN can't open is never used: that market stays watch-only.

By rule, keys never appear in HUGINN, logs, alerts, the support file, the audit log or error strings. Tests check the places a key or a balance could leak: the support e-mail masks balances and the pool account, HUGINN Fleet sends its key only in a header of a read request.

Licences fail closed. Offline licence files are Ed25519-signed and checked locally; online licence answers are signed by the licence server, and offline grace runs from the date inside that signature. A lapsed or forged licence means watch-only.

Enforced by: support_email_masks_balances_and_the_pool_account · every_request_is_a_get_with_the_key_in_a_header_never_in_the_address · packet_sends_the_key_only_as_x_api_key_on_a_get · offline_grace_needs_the_servers_own_signature · offline_licence_roundtrip_and_tamper_checks · a_sealed_key_outside_the_service_is_never_used · the_linux_sealing_script_seals_exactly_what_odin_calls_a_secret

10Supply chain and signing

Every release must pass, before it is published: lint with warnings treated as errors, a scan of every dependency against the RustSec vulnerability database (any known vulnerability stops the release), the full test suite, the simulated sessions, and a check that the release program names no test hook. Each release ships a CycloneDX software bill of materials for ODIN and SLEIPNIR and a SHA256SUMS.txt over every file, signed with the Asgard Hashworks key (Ed25519), which never leaves the signing PC.

odin --upgrade reads the latest version, requires a valid signature on that version's checksum list, checks the file's SHA-256, test-runs it, swaps it in, keeps the old program, and puts it back if the new one doesn't report that it started.

Enforced by: an_upgrade_installs_only_a_newer_program_that_asgard_signed · a_release_signature_covers_exactly_the_published_checksums

11The models

Every number ODIN can measure, it measures on your own account. On NiceHash every estimate carries an error band, and a dip boost needs the band's lower bound to clear your rule. Vast and Clore value cards with the pool's rates and a fixed delivery allowance, without a band. These are the models in the source, each with the test that checks it on known data.

ModelWhat it doesWhereChecked by
Bayesian online change-pointThe full posterior over how long the current market regime has lasted. Its predictive is a Student-t (a bell curve with heavier tails), so one spike does not read as a shift.quant.rs §3bocpd_finds_a_level_shift_and_ignores_noise
Two-sided CUSUMA fast alarm on the clearing price; fill history from before a shift is down-weighted.main.rscusum_flags_a_level_shift_but_not_noise
Ornstein–Uhlenbeck reversionMean reversion on two time scales, with exact first-passage times: how long a dip lasts before it would cost a fee.quant.rs §7ou_fit_recovers_parameters_and_passage_times
Conformalised quantile forecastThe clearing price 30 minutes ahead as a 10–50–90 band, learned online and scored against a random walk.quant.rs §8forecaster_is_calibrated_and_beats_a_random_walk_on_mean_reverting_prices
Adaptive conformal inferenceError bars whose long-run coverage holds for any data sequence; on NiceHash a dip boost needs the lower bound to clear.quant.rs §2conformal_hits_its_coverage_even_when_noise_jumps
Kalman delivery filterWhat the pool really credits, tracked as a hidden level with its own error bar. Its consistency is checked by NIS, the normalised innovation squared, which sits near 1 when the filter's error bar is honest.quant.rs §1kalman_tracks_a_level_and_shrinks_uncertainty
Rival ceiling posteriorEach rival bot's ceiling bracketed from where it gave up, product-limit estimated for the ones still bidding.quant.rs §4rival_posterior_brackets_and_pools
Thompson samplingLearns which bid step actually wins against each market's bots, weighed against the headroom it leaves.quant.rs §5thompson_learns_the_arm_that_wins
Backtest-overfitting probabilityCombinatorially symmetric cross-validation; a tuned setting is adopted only if its win is unlikely to be luck.quant.rs §6pbo_flags_noise_mining_and_passes_real_edge
Isotonic fill curveHow much of an order really fills at each distance from the clearing price; a higher bid can never fill less.main.rsfill_curve_is_monotone_and_learns_partial_fills

12Rules the code enforces

Each rule as it stands in v1.9.2: the mechanism that makes it true, the tests that fail if it breaks, and the version since which it has held in this form.

RuleMechanismTest that proves itSince
Only one part of the program can place, fund or re-price a NiceHash order.The order desk (orders.rs) is the single caller of create, refill and re-price. The test reads every source file and fails if any other file calls them (main.rs, where they are defined, and orders.rs are exempt).only_the_order_desk_places_funds_or_reprices_nicehash_orders settings.rsv1.8.0
Watch-only sends nothing that could move money; live trading never bids above the profitable maximum or past the wallet.The real program, on a controlled clock, against a stand-in NiceHash; the test reads back every request it sent.watch_only_sends_nothing_that_could_move_money tests/sim_session.rslive_trading_never_bids_above_the_profitable_maximum_or_past_the_wallet tests/sim_session.rsv1.8.0
A money trip stops all new spending and cancels only ODIN's own orders and rentals, exactly once, retried until it goes through.Daily loss cap across every market, or odin_KILLED.flag created while running. The hold gives every market a reason to stop; the Clore and Vast passes re-read it before each spending call. Only ODIN's own: NiceHash since v1.9.0, Clore since v1.9.2.the_kill_switch_stops_all_spending_and_cancels_the_orders tests/sim_session.rsa_refused_kill_switch_cancel_is_retried_until_it_goes_through_and_never_twice tests/sim_session.rskill_switch_stops_running_clore_and_vast_rentals_once clore.rspaid_plan_kill_stop_stops_only_odins_own_clore_rentals clore.rsv1.9.2
Watch-only and a trip each produce a hold reason; held markets raise no bid and rent nothing.venue_hold() turns watch-only and a tripped kill switch into one reason string; the full-pass tests run a whole Clore and Vast pass while held and assert that no spending request is sent.watch_only_and_the_kill_switch_hold_every_venue main.rsclore_full_pass_never_raises_a_bid_while_held clore.rsvast_full_pass_never_rebids_while_held_but_does_when_allowed clore.rsv1.6.4
A reply whose outcome is unknown never leads to a second order or rental.On a timeout or an unreadable answer, the rental counts as placed and the account is read again before anything else is sent.mrr_unclear_answer_to_a_rental_never_rents_twice mrr.rsclore_unclear_answer_to_a_rental_never_rents_twice clore.rsv1.9.0
Stale or absurd data means hold, never a trade.A freshness gate (NiceHash book at most 20 s old) and one reader for every outside number that rejects NaN, infinities and absurd values.freshness_gate_blocks_old_market_data main.rshostile_nicehash_pages_never_panic_or_leak_bad_prices main.rschaos_number_and_money_readers_never_panic_and_stay_in_range chaos_tests.rsv1.6.3
A limit ODIN cannot read as a number puts every market on watch-only.One reader for number settings; anything that is not a finite number is named on screen and in odin --doctor.a_limit_odin_cannot_read_means_watch_only_not_a_guess tests/sim_session.rsv1.8.0
Amounts sent to an exchange are exact whole satoshis.A Sats type (a 64-bit integer) for every amount sent or balance read; prices and rates stay decimal on purpose.a_decimal_string_is_read_exactly money.rsspendable_amounts_never_round_up money.rsv1.8.0
The audit log is tamper-evident.Each record carries the SHA-256 of the one before it; odin --verify-audit names the first edited, removed or reordered line.chain_verifies_detects_tampering_and_survives_a_torn_write audit.rsv1.3.0
An upgrade installs only a newer program that Asgard Hashworks signed.An Ed25519 signature over the release's SHA256SUMS.txt, then the file's SHA-256, then a test run; the old program is kept and put back if the new one doesn't start.an_upgrade_installs_only_a_newer_program_that_asgard_signed upgrade.rsa_release_signature_covers_exactly_the_published_checksums lic.rsv1.8.0
HUGINN is read-only and key-gated.Answers reads only; keys compared in constant time; connection limits per address; a wrong key is answered slowly.huginn_is_read_only_key_gated_and_survives_a_flood main.rsv1.6.5
Every module lists what it uses, and the main source files carry no known personal identifiers.No catch-all imports; a scan of 13 main source files for five known personal patterns.no_module_imports_everything settings.rsrelease_source_carries_no_personal_identifiers main.rsv1.8.0

13Known limits

  • Model outcomes on live data (coverage of the forecast band, skill against a random walk, sample size, window) are not yet published here.
  • Cycle timing (p50 / p99 of one cycle) is not yet published here.
  • MiningRigRentals rentals can't be cancelled; a trip holds new spending, and a running rental runs to the end of the hours paid for.
  • The per-card hashrate the pool reports for Vast rentals is shown as “pool-reported”: the pool does not state its unit or averaging time.
  • One PeakMiner measurement exists (an H100 SXM); one measurement is not a comparison, so SRBMiner runs everywhere.
  • The release checks are run by hand on each release until they move to Asgard Hashworks' own build machines.
  • The setup's own test suites run on Windows PowerShell, and the Linux key-sealing script has its own shell test suite; their case counts are not stated here until counted on the machines they run on.
  • Windows code signing is in final review with the certificate authority; until then Windows may warn on first run.