Pre-launch. RC4 code-frozen for external audit (rc4-audit-candidate, aca5fcd). Report pending. Status, updated 2026-10-08
GENESpecimen 001

Documentation · Learn

Immunity

The difference between IMMUNITY's expression, its pressure signal and an actual deployment, and what a deployment can place.

IMMUNITY is the fourth gene. It lets metabolize() place a small, capped ETH bid funded by net selling, after sustained stress. It adds depth and leaves the fee unchanged (GeneHook.sol:26-27).

IMMUNITY has three distinct facts. Its contract state is one of the four gene states (GeneHook.sol:65-70); pressure is a view and deployment is an event. Each has its own condition, its own evidence and its own meaning.

Fact What it is How to observe it What it means
Expression the gene reached EXPRESSED GeneTransition to EXPRESSED; GeneLens.geneStatus the capability exists, permanently
Pressure immunityActive() returns true a view call the deployment test passes now; nothing has been placed
Deployment ETH was placed as IMMUNITY Mass a mined MassAdded event with kind 2 an amount of ETH became Permanent Mass in that transaction

#Expression

IMMUNITY can express only after REGENERATION is expressed and from a minimum epoch (imm_min_epoch). It counts stressed epochs in a sliding window: an epoch is stressed when its revenue metric and its pathTicks both reach their thresholds. It expresses once the window holds enough stressed epochs (imm_required, imm_window) (GeneHook.sol:879-894, :919-934). Expression is final, and by itself places nothing.

#Pressure

immunityActive() is a read-only view. It returns true when three things hold at once (GeneHook.sol:802-805, :987-992):

  1. IMMUNITY is expressed;
  2. each of the most recently processed closed epochs, a fixed number of them (imm_confirm), met a stricter deployment-stress test: a higher revenue threshold (imm_deploy_revenue) and the pathTicks threshold;
  3. evolution is caught up with the current epoch.

The deployment-stress register shifts for every processed epoch, including epochs before IMMUNITY was expressed (GeneHook.sol:175-177, :883).

The source describes this view as a signal (GeneHook.sol:987-989). A deployment also needs something to place, so the view can read true while a call places zero: right after an epoch boundary before the first touch, when the epoch cap is spent, when the reserve is below the minimum, or when IMMUNITY's own budget is zero or used. The interface label for it is IMMUNE PRESSURE DETECTED.

#Deployment

A deployment happens only inside a metabolize() call, only when the pressure test passes in that call, and only if there is something to place (GeneHook.sol:465-466, :493-496). The amount is the smallest of:

  • ethReserve;
  • what is left of the IMMUNITY budget, which comes only from the previous epoch's newly funded net selling (GeneHook.sol:199-204, :828-832);
  • what is left of the per-epoch cap (immunity_cap_epoch);
  • the per-call cap (immunity_cap_call).

Below the minimum (min_deploy_eth) nothing is placed. The band starts one gap beyond the ATL, or beyond spot if spot is cheaper still (GeneHook.sol:497-501). See anchors and net-flow budgets.

Only a mined MassAdded event with kind 2 proves a deployment, and its amount is the ETH placed in that transaction (GeneHook.sol:138-141). Describe a deployment from that mined event; a view call, a simulation or a pending transaction shows only what could happen.

#What it can and cannot do

The budget comes only from net selling valued at the epoch's cheapest price, so IMMUNITY's response to a sell-off is small and placed away from spot: in the measured genuine sell-offs it placed 0.3 to 0.8 ETH by the study's S+7 checkpoint, none of it within 25% of spot. Manufactured stress buys nothing: in the tests, price-restoring round trips create no IMMUNITY budget. See limitations explained.

Sources (11)
  • src/Genome.sol:76-86
  • src/GeneHook.sol:138-141
  • src/GeneHook.sol:175-177
  • src/GeneHook.sol:199-204
  • src/GeneHook.sol:465-466
  • src/GeneHook.sol:493-507
  • src/GeneHook.sol:802-805
  • src/GeneHook.sol:828-832
  • src/GeneHook.sol:879-894
  • src/GeneHook.sol:919-934
  • src/GeneHook.sol:987-992

Paths are relative to the GENE repository at tag rc4-audit-candidate (aca5fcd).