Skip to main content

Module runtime

Module runtime 

Expand description

Math-runtime deployment + local address cache.

The math runtime classes (one per market family) are declared on mainnet by the upstream contract deployer but no instances exist — consumers like the cpi-arb bot need a runtime instance to perform chain-faithful preflight via compute_hints_view / quote_*.

This module provides:

  • Family — the four supported families and their canonical mainnet class hashes.
  • runtime_class_hash — class-hash lookup keyed by (chain, family), with mainnet hashes embedded as compile-time constants and sepolia hashes pulled from the bundled manifest.
  • projected_deploy_address — pure address derivation via the get_udc_deployed_address helper. Used for dry-runs and idempotency checks.
  • RuntimeCache / RuntimeEntry — TOML-on-disk cache of previously-deployed runtime instances, keyed by chain key + family.

Actual on-chain deploy submission lives in the CLI (it needs an OwnedAccount) — this crate stays provider/account-free so it can be embedded in lighter consumers.

Modules§

mainnet_class_hashes
Mainnet math-runtime class hashes (from the-situation deployment-mainnet-01.json).

Structs§

RuntimeCache
In-memory mirror of ~/.config/deadeye/runtimes.toml.
RuntimeEntry
A cached, previously-deployed math-runtime instance.

Enums§

ChainKey
A short, opinionated chain identifier used as the top-level key in RuntimeCache. We deliberately collapse the full hex felt to a human-readable slug so the cache stays grep-friendly.
Family
The four market-runtime families supported by the Deadeye contract suite.

Constants§

LEGACY_UDC_ADDRESS_HEX
Legacy UDC contract address (Cairo 0). This is the only deployer that is predeployed on starknet-devnet-rs and the historical mainnet UDC — every Deadeye contract deployed to date used this UDC.

Functions§

legacy_udc_address
Legacy UDC contract address as a Felt.
projected_deploy_address
Compute the address a math-runtime instance will land at when deployed via the legacy UDC with unique = 0 (deterministic by salt).
projected_deploy_address_unique
Same as projected_deploy_address but with unique = true (the UDC mixes the deployer address into the salt). Exposed for symmetry; the CLI defaults to unique = false for true idempotency.
runtime_class_hash
Return the canonical math-runtime class hash for the given (chain, family). For sepolia, falls back to the bundled deployment manifest; for mainnet, returns the pinned constant.