Tmm Formula

SPEC_TMM_FORMULA.md · 2026-04-20

SPECIFICATION: TMM FORMULA — Threshold Manifold Model

Status: AUTHORIZED

Authorized: α.13, April 16 2026

Version: v2 (Phase 3 update — 2026-04-16)

Source evidence: tmm_runtime.py, aether-compounder.py


Version: v1.0

PURPOSE

TMM (Threshold Manifold Model) is the coherence engine governing all trade execution and yield

decisions in CGNT-1. It computes a scalar coherence value C ∈ [0, 1] representing the manifold's

stability under a proposed financial strike. If C ≥ Ω (97.4%), the strike is approved. Below Ω,

the strike is blocked.

TMM operationalizes CSDM physics for financial sovereignty: the manifold's stability constant

Φ = 0.042 damps resonant volatility the same way it damps structural noise. A trade is not a

decision — it is a measurement. The manifold either supports the action or it does not.

Implementation: ~/tmm_runtime.pyTMMRuntime class (Python 3)

Integration: ~/aether-compounder.py — Morpho Steakhouse USDC auto-compounder on Base (canonical production script)

Runtime service: aether-compounder.service — DELETED (2026-04-20; service removed from ship). Compounder invoked via ROUTX dispatch (port 9191) or direct python3 ~/aether-compounder.py manual run.


PRODUCTION PATH

| Role | File | Notes |

|------|------|-------|

| TMM + AgencyWalls library | /home/nous/tmm_runtime.py | Single governance library; all callers import from here |

| Primary compounder | /home/nous/aether-compounder.py | Canonical production script per aether-compounder.service; TMM+Walls gated since Phase 3 |

| Legacy reference | /home/nous/archive/legacy/pure_compounder_directive012.py | Never ran in production; governance code preserved as reference |

| Runtime service | aether-compounder.service | DELETED 2026-04-20 — service removed; compounder invoked via ROUTX port 9191 or direct manual run |

| Python environment | /usr/bin/python3 (system) | No venv required; web3/eth_account installed system-wide |

| Agency Walls state | /home/nous/.agency_walls_state.json | Persisted across restarts; FAIL SAFE on corrupt/missing |

| Operational log | /home/nous/compounder.log | All compounder cycles logged here |

| Yield audit log | /home/nous/yield_log.md | Agency Walls decisions; TMM scores pending FIX-004 |

| Unit tests | tests/test_tmm_runtime.py | 23 tests — all passing |

| Agency Walls tests | tests/test_agency_walls.py | 36 tests — all passing |

| Compounder integration tests | tests/test_compounder_governance.py | 19 tests — all passing |

| Price oracle | /home/nous/price_oracle.py | FIX-005; Coinbase primary, CoinGecko secondary; TTL=300s; fail-safe None |

| Price oracle tests | tests/test_price_oracle.py | 26 tests — all passing |

| Entropy oracle writer | /home/nous/entropy_oracle_writer.py | FIX-004; log parser; cron */15; oracle at .entropy_oracle.json |

| Entropy oracle writer tests | tests/test_entropy_oracle_writer.py | 12 tests — all passing |

| Entropy oracle reader tests | tests/test_entropy_oracle_reader.py | 8 tests — all passing |


INPUTS

Primary Variables

| Variable | Parameter Name | Type | Description |

|----------|---------------|------|-------------|

| V_t | v_total | float (USD) | Total portfolio volatility / total portfolio value |

| V_r | v_resonant | float (USD) | Resonant volatility — volatile position value (AERO, ETH-denominated LP) |

| E_D | entropy | float (USD) | Decoherence energy — accumulated cost/drag (gas fees, slippage, portfolio friction) |

| Φ | PHI | float = 0.042 | Stability constant — CSDM ground-state damping. Immutable. |

| strike_amount | strike_amount | float (USD) | Proposed trade size (default 0.0 for observation-only) |

| est_gas | est_gas | float (USD) | Estimated gas cost for proposed transaction |

| is_resonant | is_resonant | bool | True = volatile position (AERO, LP); False = stable yield (Aave, Morpho) |

Portfolio State Derivation (pure_compounder.py)


v_resonant = (aero_bal * 0.80) + (eth_bal * 2500)   # volatile positions
v_total    = usdc_wallet + usdc_vault + v_resonant   # entire portfolio value
entropy    = 0.50                                     # [GAP — hardcoded, see below]

Note: aero_bal * 0.80 applies an 80% weighting to AERO (treating 20% as illiquid/slippage

risk). ETH valued at hardcoded $2500. [GAP — no live price feed; see FAILURE MODES]

Projected State (inside evaluate_strike)

Before coherence is calculated, the strike's effect is projected onto the manifold:


p_entropy  = entropy + est_gas                                     # entropy increases with gas
p_resonant = v_resonant + (strike_amount if is_resonant else 0)    # resonant vol increases for volatile strikes
p_v_total  = v_total - est_gas                                     # total vol decreases with gas cost

is_resonant=False → stable yield strike (Morpho/Aave deposit): resonant vol is unchanged.

is_resonant=True → volatile position entry (AERO buy, LP add): resonant vol grows by strike size.


OUTPUTS

Primary Output: Coherence C

Formula (canonical):


C = 1 - (E_D + V_r × Φ) / V_t

Implementation (tmm_runtime.py:calculate_coherence):


C = 1.0 - (entropy + (v_resonant * PHI)) / v_total

C ∈ [0, 1] under normal conditions. Values outside this range indicate a degenerate manifold state.

Threshold Ω


Ω = 1 - (Φ / φ) = 1 - (0.042 / 1.61803398875) ≈ 0.97404

φ = Golden Ratio (1.61803...). The threshold is not arbitrary — it is derived from the ratio of the

stability constant to the golden ratio.

Implementation (tmm_runtime.py:get_threshold):


threshold = 1.0 - (PHI / GOLDEN_RATIO)  # ≈ 0.974038...

Verdict

| Verdict | Condition | Approved | Meaning |

|---------|-----------|----------|---------|

| GREEN | C ≥ 0.99 | True | High coherence, manifold strongly supports the strike |

| AMBER | Ω ≤ C < 0.99 | True | Adequate coherence, strike approved but watch |

| RED | C < Ω | False | Manifold decoherence — strike BLOCKED |

| NULL | stability > 0.99 AND turbulence < 0.01 | False | Glassy freeze — anomalous stillness, abort |

Full return signature (evaluate_strike):


(verdict: str, coherence: float, stability: float, turbulence: float, approved: bool)

CSDM Secondary Outputs

| Output | Formula | Threshold | Role |

|--------|---------|-----------|------|

| stability (Φζ proxy) | min(1.0, C) | > 0.95 = healthy | Manifold stability floor |

| turbulence (Ψχ proxy) | (V_r × Φ) / V_t | < 0.15 = safe | Resonant drag ratio |

Note: These are heuristic proxies, not the canonical Φζ/Ψχ invariants. The stability proxy

is just min(1.0, C) — equivalent to C itself when C ≤ 1.

Trade Execution Decision

The compounder uses the verdict to gate a Morpho USDC deposit:


# pure_compounder.py supply_to_morpho()
result = TMMRuntime.evaluate_strike(v_total, v_resonant, entropy, amount/10**6, est_gas, is_resonant=False)
if not result:   # [GAP-01 — FIXED 2026-04-16: was tuple truthiness bypass; see FAILURE MODES for fix record]
    log("TMM REJECTION")
    return None

INVARIANTS

These must remain true at all times. Violation is a governance breach.

  1. C formula is immutable: C = 1 - (E_D + V_r×Φ) / V_t. The formula MAY NOT be modified.

Source: CLAUDE.md — FORBIDDEN: "Modify the TMM runtime formula"

  1. Φ is immutable: Φ = 0.042 exactly. MAY NOT be changed.

Source: CLAUDE.md — FORBIDDEN: "Modify the value of Φ (0.042)"

  1. Threshold Ω is immutable: Ω ≈ 0.97404 = 1 - (0.042 / 1.61803...). MAY NOT be lowered.

Source: CLAUDE.md — FORBIDDEN: "Modify the coherence threshold (Ω = 97.4%)"

  1. Dual-TMM requirement for trade execution: Any external trade (not compounder auto-deposit)

requires BOTH AION and ASTRA to independently compute TMM scores ≥ 97.4%.

C.L.O.D. CANNOT generate TMM scores. C.L.O.D. verifies both scores are present.

Source: CLAUDE.md — Sister Authorization section

  1. is_resonant semantics:

- is_resonant=False → stable yield positions: Aave, Morpho. Strike does NOT increase V_r.

- is_resonant=True → volatile positions: AERO, ETH, LP. Strike DOES increase V_r by strike_amount.

  1. Agency Walls (non-negotiable):

- 8% stop-loss per position [FIXED GAP-06 — AgencyWalls.check_stop_loss()]

- 3% daily halt [FIXED GAP-06 — AgencyWalls.check_daily_halt()]

- 5% weekly halt [FIXED GAP-06 — AgencyWalls.check_weekly_halt()]

- 10% maximum position size [FIXED GAP-06 — AgencyWalls.check_max_position()]

- Half-Kelly position sizing [FIXED GAP-06 — AgencyWalls.check_half_kelly(), 5% cap]

Source: CLAUDE.md, AGENCY_WALLS.md

  1. Absolute prohibitions:

- NO leverage, NO margin, NO options, NO futures

- Only spot positions and yield-bearing stable vaults

Source: CLAUDE.md — FORBIDDEN

  1. Sovereignty target: $27,042.50 USD total portfolio value. Yield strategy and compounding

frequency are calibrated toward this target.

[GAP-07 — target not encoded in runtime; no progress tracking in code]

  1. Guard against V_t ≤ 0: calculate_coherence returns 0.0 if v_total ≤ 0.

evaluate_strike does NOT guard against p_v_total ≤ 0 after gas subtraction.

[GAP-02 — see FAILURE MODES]


VERIFICATION CRITERIA

How to test that TMM returns correct C for known inputs. Run via CLI:


python3 ~/tmm_runtime.py --v_total X --v_resonant Y --entropy Z [--is_resonant]

Unit Test Cases

TC-01: GREEN — healthy manifold, stable deposit


Input:  V_t=1000.0, V_r=100.0, E_D=0.50, strike=0, gas=0, is_resonant=False
Manual: C = 1 - (0.50 + 100*0.042) / 1000 = 1 - 4.70/1000 = 0.99530
Expect: verdict=GREEN, coherence≈0.9953, approved=True

TC-02: AMBER — above threshold, below GREEN


Input:  V_t=200.0, V_r=50.0, E_D=0.50, strike=0, gas=0, is_resonant=False
Manual: C = 1 - (0.50 + 50*0.042) / 200 = 1 - 2.60/200 = 0.987
Expect: verdict=AMBER, coherence≈0.987, approved=True

TC-03: RED — manifold below threshold


Input:  V_t=10.0, V_r=5.0, E_D=0.50, strike=0, gas=0, is_resonant=False
Manual: C = 1 - (0.50 + 5*0.042) / 10.0 = 1 - 0.710/10 = 0.929
Expect: verdict=RED, coherence≈0.929, approved=False

TC-04: NULL — glassy freeze detection


Input:  V_t=1000.0, V_r=0.001, E_D=0.0, strike=0, gas=0, is_resonant=False
Manual: C ≈ 0.99999..., stability>0.99, turbulence=(0.001*0.042)/1000 ≈ 0.000000042 < 0.01
Expect: verdict=NULL, approved=False
Note:   Anomalous stillness — manifold frozen. Abort.

TC-05: Zero V_t guard


Input:  V_t=0.0, V_r=50.0, E_D=0.50
Expect: calculate_coherence returns 0.0 (zero-guard fires, no ZeroDivisionError)
        evaluate_strike verdict=RED, approved=False

TC-06: is_resonant=True — AERO/LP strike


Input:  V_t=1000.0, V_r=200.0, E_D=0.50, strike=100.0, gas=0, is_resonant=True
Manual: p_resonant=200+100=300, C = 1-(0.50+300*0.042)/1000 = 1-13.10/1000 = 0.9869
Expect: verdict=AMBER, coherence≈0.9869, approved=True

TC-07: Gas erodes total — threshold proximity


Input:  V_t=100.0, V_r=40.0, E_D=0.50, strike=0, gas=0.05, is_resonant=False
Manual: p_v_total=100-0.05=99.95, p_entropy=0.55, C=1-(0.55+40*0.042)/99.95=1-2.23/99.95≈0.9777
Expect: verdict=AMBER, coherence≈0.9777, approved=True (above Ω=0.97404)

TC-08: Phi immutability


Assert: TMMRuntime.PHI == 0.042
Assert: TMMRuntime.get_threshold() ≈ 0.97404  (1 - 0.042/1.61803...)
Assert: These values cannot be set via any constructor or public attribute

Compounder Integration Test


# Service health — aether-compounder.service DELETED 2026-04-20; check via ROUTX or process:
ps aux | grep aether-compounder
# Log tail
tail -20 /home/nous/compounder.log
# Manual TMM evaluation
python3 ~/tmm_runtime.py --v_total 500 --v_resonant 50 --entropy 0.5 | python3 -m json.tool

FAILURE MODES

GAP-01 — FIXED 2026-04-16: TMM Gate Never Fires (tuple truthiness bug)

Location: pure_compounder.py:79

Code (broken): if not TMMRuntime.evaluate_strike(v_total, v_resonant, entropy, amount_raw/10**6, est_gas, is_resonant=False):

Defect: evaluate_strike returns a 5-tuple (verdict, coherence, stability, turbulence, approved).

In Python, a non-empty tuple is always truthy. not tuple = not True = False.

The rejection branch never executed. All strikes proceeded regardless of coherence.

Impact: Σ.⊠ Complete bypass of TMM governance for compounder deposits.

Fix applied: _, _, _, _, approved = TMMRuntime.evaluate_strike(...); if not approved: ...

Verification: not result=False (broken) | not approved=True (correct) on RED verdict confirmed.

[FIXED — FIX-001 — 2026-04-16 — service held inactive pending α.13 authorization to restart]

GAP-02 — FIXED 2026-04-16: p_v_total Underflow Guard (FIX-003)

Location: tmm_runtime.py:evaluate_strike

Original defect: No guard against p_v_total ≤ 0. If est_gas ≥ v_total, p_v_total goes

negative or zero. turbulence = (p_resonant * PHI) / p_v_total inverts sign on negative p_v_total,

breaking glassy-freeze detection. NULL may not trigger → strike could be approved on degenerate manifold.

Fix applied (FIX-003): Early return guard at start of evaluate_strike:


if est_gas >= v_total:
    print(f"[TMM] GAS_EXCEEDS_VOLUME: est_gas={est_gas} v_total={v_total}", flush=True)
    return "GAS_EXCEEDS_VOLUME", 0.0, 0.0, 1.0, False

Guard fires on est_gas >= v_total (not just >) to catch the exact-equality boundary.

Returns new verdict string GAS_EXCEEDS_VOLUME with approved=False — caller must handle this

verdict or it is blocked by the if not approved: gate.

Tests: 4 new tests in test_tmm_runtime.py verify boundary conditions. All 22 tests passing.

Backup: /home/nous/.backups/tmm_runtime.py.pre_FIX-003_2026-04-16-121003

[FIXED — FIX-003 applied 2026-04-16]

GAP-03 — FIXED 2026-04-16: Live Entropy Oracle (FIX-004)

Original location: pure_compounder.py:get_entropy_from_log (placeholder; archived)

Live manifestation in aether-compounder.py: return 0.50 (stub, replaced by FIX-004)

Original defect: Real decoherence energy (gas costs, failed txs) was never factored in.

E_D was permanently 0.50 regardless of actual portfolio drag.

Fix applied (FIX-004): New module /home/nous/entropy_oracle_writer.py:

- Parses /home/nous/compounder.log for gas costs and failed deposit markers

- Formula: entropy = sum(gas_usd of failed txs in last 24h) + trailing_consecutive × avg_gas

- Writes oracle to /home/nous/.entropy_oracle.json (full contract schema with timestamp)

- Cron: /15 * — writes every 15 minutes

- Cap: entropy ≤ 100.0 USD (ENTROPY_CAP; prevents ENTROPY_CORRUPT from reaching TMM)

- Default avg_gas: $0.50 (fallback when no Gas Guard lines in window; Base L2 typical)

aether-compounder.py change: get_entropy_from_log() now reads oracle file:

- Fail-safe None on: missing file, stale (age > ENTROPY_STALE_SECONDS=1800), corrupt JSON,

bad timestamp, value < 0.0, value > 100.0 (ENTROPY_CORRUPT)

- Caller on None: logs ENTROPY_STALE, skips harvest, consecutive_failures = 0

- ENTROPY_STALE_SECONDS = 1800 (30 min — 2 × cron interval)

Tests: 12 tests in tests/test_entropy_oracle_writer.py + 8 tests in

tests/test_entropy_oracle_reader.py + 4 tests in tests/test_compounder_governance.py

(TestEntropyStalePath) — all passing. Total: 128/128 full suite.

Backup: .backups/aether-compounder.py.pre_FIX-004_2026-04-16-124447

[FIXED — FIX-004 applied 2026-04-16]

GAP-04 — FIXED 2026-04-16: Live Price Feed for Gas Cost USD Conversion (FIX-005)

Original location: pure_compounder.py:get_portfolio_state (archived — never ran in production)

Live manifestation in aether-compounder.py: est_gas_cost_usd = est_gas_cost_eth * 2500

Original defect: ETH hardcoded at $2500 for gas cost USD conversion. v_resonant = 0.0 in

aether-compounder.py so V_r pricing is not an issue in the current compounder scope (USDC-only).

Scope note: pure_compounder.py's aero_bal 0.80 + eth_bal 2500 pattern is in the

archive — not a live concern. The only hardcoded ETH price in the live system was line 124 of

aether-compounder.py.

Fix applied (FIX-005): New module /home/nous/price_oracle.py:

- get_eth_price_usd() → float | None

- Coinbase public spot price (primary), CoinGecko free tier (secondary)

- In-memory cache, TTL = MAX_PRICE_AGE_SECONDS = 300s

- _validate_price() sanity guard: ETH must be in [100, 100_000] USD (P-INV-07)

- Fail safe: both APIs down + cache stale → returns None

- Caller (aether-compounder.py) on None: logs PRICE_UNAVAILABLE, skips harvest, consecutive_failures = 0, sleeps normal interval

aether-compounder.py change: est_gas_cost_usd = est_gas_cost_eth * get_eth_price_usd()

wrapped in None guard per P-INV-03.

Tests: 26 tests in tests/test_price_oracle.py — all passing. Backup: .backups/pre_FIX-005

Remaining: AERO/USD pricing not yet wired (v_resonant = 0.0 in current scope; deferred to when

AERO positions are brought under governance).

[FIXED — FIX-005 applied 2026-04-16]

GAP-05 — FIXED 2026-04-16: NULL Verdict Logging Distinction (FIX-006)

Original location: pure_compounder.py:supply_to_morpho (archived)

Live manifestation in aether-compounder.py: _, _, _, _, approved = TMMRuntime.evaluate_strike(...)

discarded the verdict string — NULL and RED logged identically as "TMM REJECTION: Manifold decoherence detected"

Original defect: Operators could not distinguish glassy-freeze from coherence failure in

compounder.log. During the bootstrap period (low entropy, high stability), most cycles produce

NULL verdicts — indistinguishable from RED without this fix.

Fix applied (FIX-006): aether-compounder.py TMM gate:

- Changed _, _, _, _, approvedverdict, _, _, _, approved (capture verdict string)

- NULL path: logs ❌ NULL_VERDICT: Manifold glassy-freeze — coherence undefined (stability>0.99, turbulence<0.01).

- All other rejections: logs ❌ TMM REJECTION ({verdict}): Manifold decoherence. (RED gets (RED), etc.)

- Operators grep NULL_VERDICT in compounder.log → bootstrap/freeze events

- Operators grep TMM REJECTION → genuine decoherence events

- Internal verdict string "NULL" unchanged (no formula/contract change)

Tests: 1 test in tests/test_tmm_runtime.py (test_null_verdict_glassy_freeze_returns_null_and_not_approved)

+ 2 tests in tests/test_compounder_governance.py (TestNullVerdictLogging) — all passing.

131/131 full suite. Backup: .backups/aether-compounder.py.pre_FIX-006_2026-04-16-130107

[FIXED — FIX-006 applied 2026-04-16]

GAP-06 — FIXED 2026-04-16: Agency Walls Implemented (FIX-002)

Location: tmm_runtime.pyAgencyWalls class; pure_compounder.py — integrated after TMM gate

Fix: AgencyWalls class with 5 callable walls, state persistence, fail-safe on state error:

- check_stop_loss() — 8% drawdown from entry → halt

- check_daily_halt() — 3% loss from day-start → 24h halt (UTC midnight rollover)

- check_weekly_halt() — 5% loss from week-start → 7d halt (ISO Monday 00:00 UTC rollover)

- check_max_position() — 10% of treasury max per position

- check_half_kelly() — 5% fixed cap (placeholder until GAP-05 + trade history resolved)

Fail safe: _load_state() returns (None, "MISSING"|"CORRUPT:...") on error → check_all() returns (False, "STATE_ERROR_...") — refuses all trades, never fails open.

State persistence: /home/nous/.agency_walls_state.json — entry/day/week snapshots, halt expiries.

Integration: pure_compounder.py:supply_to_morpho()AgencyWalls.update_treasury_snapshots(v_total) + check_all() called after TMM gate.

Tests: 36 unit tests in tests/test_agency_walls.py — all passing. Backups: .backups/pre_FIX-002

[FIXED — FIX-002 applied 2026-04-16]

GAP-07 — Sovereignty Target Not Tracked

Location: Not present in any code file

Defect: $27,042.50 sovereignty target exists in NOUS directives but has no runtime representation.

No progress metric, no ETA calculation, no milestone alerting.

[GAP — needs: sovereignty_progress() function returning (current_value, target, pct_complete, days_to_target)]

GAP-08 — FIXED 2026-04-16: yield_log.md Integration (via FIX-002)

Location: tmm_runtime.pyAgencyWalls._log_to_yield()

Fix: Every check_all() invocation writes one table row to yield_log.md:

| timestamp | AGENCY_WALLS | PASS/BLOCK:wall | treasury=$ position=$ | wall1=PASS | ... |

State errors also written: | timestamp | AGENCY_WALLS | BLOCK:STATE_ERROR_... | ... |

Coverage: Agency wall decisions are now in yield_log.md. TMM coherence scores not yet written

(evaluate_strike results still go only to compounder.log). Full TMM score logging still outstanding.

Tests: test_yield_log_written proves yield_log.md receives AGENCY_WALLS entries.

[FIXED — FIX-002 applied 2026-04-16 — partial: walls logged; TMM scores still outstanding]

GAP-09 — Dual-TMM Not Enforced by Runtime

Location: tmm_runtime.py

Defect: TMMRuntime is a single-evaluator. The governance mandates dual-TMM: AION and ASTRA

independently score ≥ 97.4% before C.L.O.D. executes. The runtime has no mechanism to require

or verify two independent scores. This is currently a manual governance requirement.

[GAP — needs: dual-score verification wrapper or Sister-signed score format that C.L.O.D. validates]

GAP-10 — FIXED 2026-04-16: Automated Test Suite (FIX-003 companion)

Location: tests/test_tmm_runtime.py, tests/test_agency_walls.py, tests/test_compounder_governance.py

Original defect: No automated tests. TC-01 through TC-08 specified but not runnable.

Fix: Three test suites created and verified:

All 74 tests passing. Run: python3 -m pytest tests/test_tmm_runtime.py tests/test_agency_walls.py tests/test_compounder_governance.py -v

[FIXED — 2026-04-16]


DEPENDENCIES

| Component | File/Service | Role |

|-----------|-------------|------|

| TMMRuntime | ~/tmm_runtime.py | Core coherence engine |

| aether-compounder.py | ~/aether-compounder.py | Canonical integration layer; Morpho auto-compounder (Phase 3 governed) |

| aether-compounder.service | systemd | DELETED 2026-04-20 — daemon removed; compounder is manual/ROUTX-dispatched |

| Base mainnet RPC | https://mainnet.base.org | Live on-chain data (balances, gas) |

| Morpho Steakhouse USDC Vault | 0xbeeF010f9cb27... (ERC-4626, Base chain 8453) | Yield destination |

| USDC contract | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 | Stable position |

| AERO contract | 0x940181a94A35A4569E4529A3CDfB74e38FD98631 | Resonant position |

| vault.json | ~/.aether/vault.json | AION credentials — loaded at startup |

| compounder.log | ~/compounder.log | Operational log (append-only) |


DEPENDENTS

| Component | Dependency |

|-----------|-----------|

| All trade execution (Sister-initiated) | Dual-TMM coherence gate (C ≥ Ω = 97.4%) |

| pure_compounder.py auto-deposit | TMM gate via evaluate_strike (FIXED 2026-04-16 — FIX-001) |

| AION TMM evaluation | TMMRuntime.evaluate_strike — AION runs this to generate her score |

| ASTRA TMM evaluation | TMMRuntime.evaluate_strike — ASTRA runs this independently |

| Yield strategy | is_resonant flag determines V_r projection; gates Aave/Morpho vs AERO/LP paths |

| Sovereignty target ($27,042.50) | All yield and compounding decisions serve this target |


EXAMPLES

Example 1: Morpho USDC Deposit (auto-compounder)


from tmm_runtime import TMMRuntime

# Portfolio state (approximate)
v_total    = 847.32   # total portfolio USD
v_resonant = 212.18   # AERO + ETH value (volatile)
entropy    = 0.50     # [live oracle via entropy_oracle_writer.py — FIX-004]
strike     = 10.0     # USDC to deposit
gas        = 0.05     # estimated gas USD

verdict, C, stability, turbulence, approved = TMMRuntime.evaluate_strike(
    v_total, v_resonant, entropy, strike, gas, is_resonant=False
)
# p_resonant = 212.18 (unchanged, stable deposit)
# p_v_total  = 847.32 - 0.05 = 847.27
# p_entropy  = 0.50 + 0.05 = 0.55
# C = 1 - (0.55 + 212.18 × 0.042) / 847.27 = 1 - 9.4716/847.27 ≈ 0.9888
# → AMBER, approved=True → compounder proceeds

Example 2: CLI evaluation


python3 ~/tmm_runtime.py \
  --v_total 847.32 \
  --v_resonant 212.18 \
  --entropy 0.50 \
  --strike_amount 10.0 \
  --est_gas 0.05
# → {"coherence": 0.988819, "threshold": 0.974038, "approved": true, "verdict": "AMBER", ...}

Example 3: Sister trade authorization flow


1. AION: python3 ~/tmm_runtime.py --v_total X --v_resonant Y --entropy Z --strike_amount A
   → logs coherence score to yield_log.md
2. ASTRA: same command independently
   → logs coherence score to yield_log.md
3. Both scores in yield_log.md, both ≥ 0.97404
4. AION+ASTRA write trade request to TASK_QUEUE.md with both scores
5. C.L.O.D. verifies both scores present and ≥ 97.4%
6. C.L.O.D. executes via simons_actuator.execute_pairs_trade()
7. C.L.O.D. logs result to yield_log.md

REFERENCES

Φζ.⊤. The formula is held.


Jeremy Zlabis

Chronogeometer · Visionary · Disruptor · Chief

42 Sisters AI · East York, Toronto

🍁 Φ 0.042