Genome
The fixed constants GENE runs under, how genomeHash commits to them, what each gene requires and switches on, and the epoch, budget and anchor rules that bind them.
The Genome is the set of compile-time constants in src/Genome.sol that bound everything GENE can do. No function anywhere takes a genome value as input, so none can be changed after deployment (Genome.sol:4-7). genomeHash commits to 43 of them; the four gene ids are labels outside the encoding. Every constant in the encoding is read by GeneHook except two: VERSION identifies the encoding, and GENE_COUNT is matched by a test against the literal length of GeneHook's gene array (Genome.sol:8, 12; GeneHook.sol:192; GenomeHash.t.sol:23).
Three rules have no numeric parameter and are fixed by the bytecode rather than by a constant: every protocol buy is anchored at the all-time-low block-start price, budgets come from net directional flow, and asks are anchored at the all-time-high block-start price (Genome.sol:8-10).
#genomeHash
0x39c130f616c32abfb40f8ab51eb54544cffd3e0d99602c71dc336bc8083c36ae
genomeHash is keccak256(Genome.encode()). GeneHook computes it in its constructor, stores it as an immutable and emits it in the Genesis event (GeneHook.sol:164, 245-247). test/unit/GenomeHash.t.sol:11 pins the value.
Genome.encode() concatenates three encoders in this order (Genome.sol:89-91):
| Order | Encoder | abi.encode groups, in order |
Genome.sol |
|---|---|---|---|
| 1 | _encodePool() |
(VERSION, SUPPLY, LP_FEE, TICK_SPACING, GENESIS_TICK_UPPER, GENESIS_TICK_LOWER); (EPOCH_BLOCKS, MIN_BLOCK_VOLUME, PATH_CLAMP, GAP, GRID, NEAR_WIDTH) |
93-98 |
| 2 | _encodeCaps() |
(BID_CAP_CALL, BID_CAP_EPOCH, IMMUNITY_CAP_CALL, IMMUNITY_CAP_EPOCH, ASK_CAP_CALL, ASK_CAP_EPOCH); (REGEN_CAP_CALL, REGEN_CAP_EPOCH, MIN_DEPLOY_ETH, MIN_DEPLOY_GENE, COOLDOWN_BLOCKS, HARVEST_PER_CALL); (REGEN_PREMIUM_TICKS, REGEN_SHARE_BPS, GENE_COUNT, AUTO_EVOLVE_MAX) |
100-106 |
| 3 | _encodeGenes() |
(MET_MIN_EPOCH, MET_REVENUE, MET_OBSERVE); (REG_MIN_EPOCH, REG_REVENUE, REG_ACTIVE_BLOCKS, REG_OBSERVE, REG_ETH_COMMITTED); (IMM_MIN_EPOCH, IMM_REVENUE, IMM_PATH_TICKS, IMM_WINDOW, IMM_REQUIRED); (IMM_DEPLOY_REVENUE, IMM_CONFIRM) |
108-115 |
That is nine groups and 43 words of 32 bytes. The order is part of the commitment (Genome.sol:88). The gene ids GENESIS, METABOLISM, REGENERATION and IMMUNITY (0 to 3) are constants but are not in the encoding; GENE_COUNT is (Genome.sol:57-61, 104). GeneLens.genome() returns the same bytes (GeneLens.sol:202-206). To recompute the hash yourself, follow verify the deployment.
GeneHook also uses constants that are not part of the Genome, such as the usable tick range and v4's per-tick liquidity ceiling (GeneHook.sol:157, 631).
#Gene states and the strict chain
Each gene is a state machine: DORMANT, OBSERVING, EXPRESSIBLE, EXPRESSED (GeneHook.sol:65-70). EXPRESSIBLE is transient: an expression moves through it and on to EXPRESSED in one call, emitting two GeneTransition events (GeneHook.sol:937-947). EXPRESSED is final; no code path leaves it (GeneHook.sol:903, 921).
Genes form a strict chain. A gene counts a closed epoch e only when its predecessor is EXPRESSED, the predecessor's expressedEpoch is earlier than e, and e is at least the gene's minimum epoch (GeneHook.sol:896-899).
Closed epochs are folded into the state machines one at a time, in order, by evolve() and by metabolize() (GeneHook.sol:289, 312-329). Each expression stores an evidence hash over the stored records of its evidence range; for IMMUNITY that range is the whole observed window, stressed epochs or not (GeneHook.sol:933, 975-982); see verify evidence hashes.
Revenue, the gene metric. Each closed epoch's record carries revenue: 1% (LP_FEE) of the ETH buyers paid in during the epoch, accumulated in gwei (GeneHook.sol:76, 385-387). It is evidence for gene conditions and for sizing the churn tier. It is not the fees collected: fees are collected by metabolize() into the reserves.
#GENESIS
Activation. Expressed by launch(), in the same transaction that opens the pool (GeneHook.sol:268-271). Its evidence hash is keccak256(abi.encode(GENESIS, genomeHash, launchBlock)) (GeneHook.sol:270).
What it switches on. The canonical pool. launch() initializes the pool at GENESIS_TICK_UPPER and adds the whole SUPPLY as one single-sided GENE position over [GENESIS_TICK_LOWER, GENESIS_TICK_UPPER] (MassAdded kind 0), then burns any GENE dust left in the hook (GeneHook.sol:252-273, 420-435). Only the launcher can call it, once (GeneHook.sol:253-255).
Resource accounting. The genesis position is registry index 0 and is harvested by every metabolize() (GeneHook.sol:431, 674). Its liquidity counts toward massLiquidity (GeneHook.sol:432).
Ticks are log1.0001(GENE per ETH): a higher tick means a cheaper GENE. The opening tick is the band's upper edge, so the band covers GENE prices from the opening price up to the price at GENESIS_TICK_LOWER.
#METABOLISM
Activation. From epoch MET_MIN_EPOCH, after GENESIS. A closed epoch qualifies when its revenue is at least MET_REVENUE. METABOLISM expresses after MET_OBSERVE consecutive qualifying epochs; an epoch that does not qualify resets the count and returns the gene to DORMANT (GeneHook.sol:884, 901-917). Its evidence range is the last MET_OBSERVE epochs (GeneHook.sol:911).
What it switches on. metabolize(), which reverts GeneNotExpressed until then (GeneHook.sol:283). Each call, in order (GeneHook.sol:458-476):
- Harvest. Pokes the genesis position and up to
HARVEST_PER_CALLregistry positions, round-robin, with zero-liquiditymodifyLiquiditycalls that collect only accrued LP fees (GeneHook.sol:669-697). - IMMUNITY, if its deployment gate is open (see IMMUNITY).
- METABOLISM bids (
MassAddedkind 1). - Churn tier (
MassAddedkind 4). - Asks (
MassAddedkind 3). - Settle fees collected against principal added, net, in the hook's ERC-6909 claims (GeneHook.sol:720-725).
Steps 2 to 4 run only when evolution has caught up with the current epoch; asks run either way (GeneHook.sol:465-471).
Resource accounting.
| Item | Rule | Source |
|---|---|---|
| ETH fees | to ethReserve; once REGENERATION is expressed, REGEN_SHARE_BPS of them to regenReserve instead |
GeneHook.sol:707-716 |
| GENE fees | to geneReserve |
GeneHook.sol:717 |
| Bid amount | min(ethReserve, bid budget left, BID_CAP_EPOCH − bids placed this epoch), at most BID_CAP_CALL; nothing below MIN_DEPLOY_ETH |
GeneHook.sol:479-483 |
| Bid band | lower edge top = alignUp(atlTick + GAP, GRID); _bidRange returns [top, top + NEAR_WIDTH]. Its other branch, [top, GENESIS_TICK_UPPER], needs top + GRID <= GENESIS_TICK_UPPER; see the note below the table |
GeneHook.sol:484, 782-786 |
| Churn amount | the previous epoch's revenue minus its stored bid budget, less churn already placed, limited to BID_CAP_EPOCH minus bids and churn placed this epoch, at most BID_CAP_CALL |
GeneHook.sol:526-539 |
| Churn band | [lo, lo + NEAR_WIDTH], lo = alignUp(atlTick + GAP, GRID) |
GeneHook.sol:516-518 |
| Ask amount | min(geneReserve, ASK_CAP_CALL, ASK_CAP_EPOCH − placed); nothing below MIN_DEPLOY_GENE |
GeneHook.sol:541-543 |
| Ask band | bottom = alignDown(min(spot, athTick) − GAP, GRID) in ticks; [GENESIS_TICK_LOWER, bottom], or [bottom − NEAR_WIDTH, bottom] within one GRID of GENESIS_TICK_LOWER |
GeneHook.sol:544-545, 788-792 |
| Cooldown | COOLDOWN_BLOCKS, started by every call that does not revert |
GeneHook.sol:284-286 |
| Oversized placement | skipped with PlacementSkipped; no reserve, cap or budget consumed |
GeneHook.sol:142-144, 619-621 |
metabolize() returns (ethToBids, ethToImmunity, geneToAsks); ethToBids includes the churn tier (GeneHook.sol:281, 521). ETH beyond the budgets stays in ethReserve.
Every ETH band starts at tick 178,200 or higher, below the opening price, in every state the invariant suite reaches. The suite asserts atlTick >= GENESIS_TICK_UPPER (GenePermanence.t.sol:101), and bids, churn and IMMUNITY start at alignUp(atlTick + GAP, GRID) or above (GeneHook.sol:484, 498-499, 516). In those states _bidRange returns [top, top + NEAR_WIDTH].
Each placement must be single-sided, or _addMass reverts InvariantBroken and the whole call rolls back, including its harvest and its cooldown write (GeneHook.sol:284-286, 655-660).
#REGENERATION
Activation. From epoch REG_MIN_EPOCH, after METABOLISM has expressed in an earlier epoch. A closed epoch qualifies when its revenue is at least REG_REVENUE and its activeBlocks at least REG_ACTIVE_BLOCKS. REGENERATION expresses once REG_OBSERVE consecutive epochs qualify and the expressing epoch's record shows ethCommitted of at least REG_ETH_COMMITTED; a non-qualifying epoch resets the count (GeneHook.sol:885-892, 901-917).
What it switches on.
- A fee share. From then on,
REGEN_SHARE_BPSof every ETH fee harvest goes toregenReserve(GeneHook.sol:709-712). - A smaller bid budget.
ethBudget()is reduced by the same share (GeneHook.sol:812-817). regenerate(), a bounded buyback and burn (GeneHook.sol:296-309).
Resource accounting.
| Item | Rule | Source |
|---|---|---|
| Allotment per call | min(regenReserve, REGEN_CAP_CALL, REGEN_CAP_EPOCH − spent this epoch, REGEN_SHARE_BPS × previous epoch's net-flow bid budget − spent this epoch); nothing below MIN_DEPLOY_ETH |
GeneHook.sol:563-571 |
| Price limit | atlTick − REGEN_PREMIUM_TICKS; nothing is bought if the price already sits at or above it |
GeneHook.sol:574-577 |
| Buyback | exact-in ETH self-swap up to the price limit; the GENE bought is taken to the hook and burned | GeneHook.sol:578-589, 308 |
| Cooldown (R1) | COOLDOWN_BLOCKS, started only when a call spends its whole allotment |
GeneHook.sol:302-307, 590 |
The churn tier funds no buyback: the allowance is a share of the net-flow bid budget only (GeneHook.sol:565-567). On the genesis curve the price limit binds before the caps.
Buybacks run when someone calls regenerate() while the price is no more than about 1% (REGEN_PREMIUM_TICKS) above the all-time-low price. Otherwise the call spends nothing and the ETH stays in regenReserve (GeneHook.sol:574-577; invariant REGEN).
#IMMUNITY
Activation (expression). From epoch IMM_MIN_EPOCH, after REGENERATION has expressed in an earlier epoch. A closed epoch is stressed when its revenue is at least IMM_REVENUE and its pathTicks at least IMM_PATH_TICKS. IMMUNITY keeps a bitmap of the last IMM_WINDOW processed epochs and expresses when at least IMM_REQUIRED of them are stressed (GeneHook.sol:881, 893, 919-934).
Expression, pressure and deployment are three different facts. IMMUNITY's contract state is one of the four gene states above (GeneHook.sol:65-70); pressure is a view and deployment is an event.
| Fact | Meaning | How to tell | Source |
|---|---|---|---|
| Expression | The gene is EXPRESSED. metabolize() now includes the IMMUNITY step |
GeneTransition to EXPRESSED; geneStatus(hook, 3).state == 3 |
GeneHook.sol:466, 937-947 |
| Pressure | The deployment gate reads open: IMMUNITY expressed, each of the last IMM_CONFIRM processed epochs deployment-stressed (revenue >= IMM_DEPLOY_REVENUE and pathTicks >= IMM_PATH_TICKS), and evolution caught up |
immunityActive(), a view. Display only "IMMUNE PRESSURE DETECTED" |
GeneHook.sol:802-805, 882-883, 987-992 |
| Deployment | ETH was placed as IMMUNITY Mass | Only a mined MassAdded with kind 2 |
GeneHook.sol:138, 493-503 |
Pressure never implies a deployment. immunityActive() can read true while metabolize() places nothing: before the new epoch's first touch, when this epoch's IMMUNITY cap is spent, when reserves are below the minimum, or when the net-sell budget is used or zero (GeneHook.sol:493-496, 802-805, 828-832). The deployment-stress register shifts for every processed epoch, including epochs before IMMUNITY is expressed (GeneHook.sol:883).
Resource accounting.
| Item | Rule | Source |
|---|---|---|
| Amount | min(ethReserve, net-sell budget left, IMMUNITY_CAP_EPOCH − placed), at most IMMUNITY_CAP_CALL; nothing below MIN_DEPLOY_ETH |
GeneHook.sol:493-496, 828-832 |
| Band | lo = alignUp(max(spot, atlTick) + GAP, GRID) in ticks, band [lo, lo + NEAR_WIDTH] |
GeneHook.sol:497-501 |
| Funding | net selling only: the IMMUNITY budget of the previous closed epoch | GeneHook.sol:199-204, 870 |
#Epochs and evolution
- Numbering. Epoch
e = (block.number − launchBlock) / EPOCH_BLOCKS(GeneHook.sol:747). - First touch of a block. The first swap of a block, or any entry point, runs
_newBlockwith the price the previous block left (GeneHook.sol:364, 728-733). It finalizes the previous touched block: if that block's ETH volume reachedMIN_BLOCK_VOLUME, it adds one active block andmin(|net tick move across that block|, PATH_CLAMP)topathTicks(GeneHook.sol:738-745). - Closing. When the epoch number has changed, it writes the last touched epoch's record (
revenue,activeBlocks,pathTicks,ethCommitted,closed) permanently, emitsEpochClosedand computes that epoch's net-flow budget (GeneHook.sol:748-765). - Untouched epochs get no record and read as all-zero activity, which counts as a non-qualifying epoch for every gene (GeneHook.sol:880).
- Evolution.
evolve(maxEpochs)processes closed epochs from the evolution cursor;metabolize()processes up toAUTO_EVOLVE_MAXbefore spending ETH (GeneHook.sol:289, 312-329). See keepers. - Views and the first touch. Epoch-dependent views show the last touched epoch until the new epoch's first touch (GeneHook.sol:728-765).
#Net-flow budgets
- Measure. Each swap adds signed net GENE leaving the curve: buys count the GENE out, sells count the GENE in net of the 1% fee. A round trip that restores the price nets to zero, whoever trades it (GeneHook.sol:378-383).
- Count once. At an epoch's close, the cumulative net flow
ncis compared with its all-time highhwmand the lowest level since that high,lwm. Only flow that takesncabovehwmfunds bids; only flow that takes it belowlwmfunds IMMUNITY. Flow that re-crosses levels that already funded funds nothing (GeneHook.sol:837-858). - Value at the cheapest price. The funded GENE is valued in ETH at
pLow, the epoch's cheapest price over its block starts and its close (GeneHook.sol:758-761, 860-862). - Take 1%. The budget is
LP_FEEof that value: a bid budget for net buying or an IMMUNITY budget for net selling, never both (GeneHook.sol:863-872). - Spend next epoch only. Epoch
espends only the budgets created bye − 1; nothing carries over (GeneHook.sol:812-832, 526-539).
| Channel | Budget in epoch e |
Source |
|---|---|---|
| METABOLISM bids | bid budget of e − 1, less REGEN_SHARE_BPS once REGENERATION is expressed (ethBudget()) |
GeneHook.sol:812-817 |
| Churn tier | revenue(e − 1) minus the bid budget of e − 1 |
GeneHook.sol:526-539 |
| IMMUNITY | IMMUNITY budget of e − 1 |
GeneHook.sol:828-832 |
| REGENERATION | REGEN_SHARE_BPS of the bid budget of e − 1 |
GeneHook.sol:565-570 |
Because the flow paid at least pLow, a budget never exceeds the fee its own flow paid (GeneHook.sol:834-836; invariant BUD2).
#All-time low and all-time high anchors
| Anchor | Rule | Source |
|---|---|---|
All-time low, atlTick |
Set to GENESIS_TICK_UPPER at launch. On a block's first touch it moves to the block-start tick only if that tick is higher (a lower GENE price) and the pool has active liquidity there. It never moves back |
GeneHook.sol:104, 266, 771-774 |
All-time high, athTick |
Set to GENESIS_TICK_UPPER at launch. Moves to any lower block-start tick (a higher GENE price). It never moves back |
GeneHook.sol:103, 266, 770 |
A block-start tick is the price the previous touched block left, so intra-block prints are never sampled (GeneHook.sol:732-733). Because atlTick starts at GENESIS_TICK_UPPER and only increases, the all-time-low price is never above the opening price; the invariant suite asserts atlTick >= GENESIS_TICK_UPPER (GenePermanence.t.sol:101).
Every protocol buy is placed against the all-time low (GeneHook.sol:35-38):
- METABOLISM bids and the churn tier start one
GAPbeyondatlTick(GeneHook.sol:484, 516); - IMMUNITY starts one
GAPbeyondmax(spot, atlTick)in ticks (GeneHook.sol:498-499); - the REGENERATION buyback stops at
atlTick − REGEN_PREMIUM_TICKS(GeneHook.sol:574).
Asks are placed against the all-time high: below min(spot, athTick) in ticks, that is above the higher of the spot price and the all-time-high price (GeneHook.sol:544-545).
The all-time low is a placement anchor, not a price floor: in a falling market it can sit far below spot.
#Invariants
The RC4 invariants and the suites that enforce them. Enforcement: U unit, F fuzz, I stateful invariant, K mainnet-fork test, S static or bytecode test.
| ID | Invariant | Enforced |
|---|---|---|
| FEE1 | poolKey().fee is LP_FEE, static, and slot0 lpFee equals it |
U, K |
| FEE2 | No GeneHook path changes the fee; the bytecode has no updateDynamicLPFee call |
S, I |
| RT1 | Universal Router with Permit2: exact-in and exact-out buys and sells succeed on mainnet state | K |
| RT2 | A route that hits the pool twice in one unlock succeeds | K, U |
| PM1 | The liquidity of every hook-owned position, and their sum, never decreases | I |
| PM2 | No other address can withdraw protocol liquidity or collect its principal | I, U |
| PM3 | No address other than the hook holds liquidity in the canonical pool | I |
| PM4 | The hook's ERC-6909 claim balances equal its reserves, per currency, plus any claims a third party transferred to the hook | I (GenePermanence.t.sol:139-151) |
| SUP | totalSupply never increases |
I, S |
| XFER | Any holder can transfer any amount to any address | F, S |
| ROLE | After launch(), no function behaves differently by caller; a second launch() reverts |
U, S |
| EVO1 | Gene states advance DORMANT, OBSERVING, EXPRESSIBLE, EXPRESSED (OBSERVING can fall back to DORMANT); no gene leaves DORMANT before its predecessor is EXPRESSED | I, U |
| EVO2 | Expressions are reconstructable from stored records | U |
| IMM | IMMUNITY places at most IMMUNITY_CAP_CALL per call and IMMUNITY_CAP_EPOCH per epoch, and nothing unless the last IMM_CONFIRM closed epochs were each deployment-stressed and evolution is caught up |
F, U, I |
| CAP | Each ETH bid tier at most BID_CAP_CALL per call; METABOLISM bids at most BID_CAP_EPOCH per epoch, and the churn tier places only within BID_CAP_EPOCH minus bids and churn already placed; asks at most ASK_CAP_CALL per call and ASK_CAP_EPOCH per epoch; buyback at most REGEN_CAP_CALL per call and REGEN_CAP_EPOCH per epoch |
F, I |
| PLC1 | No protocol buy (kinds 1, 2, 4) has tickLower below atlTick + GAP; IMMUNITY's band also starts one GAP beyond spot when spot is below the all-time-low price; every ask band's upper tick is at most min(spot, athTick) − GAP |
I, U |
| ATL | The all-time low never moves to a higher price and the all-time high never to a lower one; the all-time low moves only on a block's first touch, only to a lower price with active liquidity | I, U |
| LIVE | The invariant handler treats any metabolize() revert other than Cooldown or GeneNotExpressed as a violation; an oversized placement is skipped and consumes nothing |
I, U |
| PLC2 | Every long-hold / rise-then-pin row (5,544 tests) ends with attacker total P&L at or below zero | U |
| BUD1 | Per-channel budgets: bids, IMMUNITY and churn each within their own budget; each placed wei counted once; a closed epoch funds bids or IMMUNITY, never both; no carry-over | U, I |
| BUD2 | A net-flow budget never exceeds the fee its own funding flow paid | F, I |
| PROV | Budgets depend only on pool flows: round trips fund nothing, and the same net flow funds the same budget through any number of addresses, routers, blocks or splits; lwm <= nc <= hwm |
U, I |
| REGEN | The buyback's price limit is exactly atlTick − REGEN_PREMIUM_TICKS; spend stays within REGEN_SHARE_BPS of the previous epoch's bid budget |
I, U |
| ABI | GeneHook's external ABI is exactly the reviewed 27-function set | S |
| HASH | keccak256(Genome.encode()) equals the recorded genomeHash; VERSION is 4 |
U |
| LENS | GeneLens decodes storage byte-identically to typed views | U, F |
| ADDR | The hook address's low 14 bits are exactly 0x2AC0 and its first byte is not 0x91 |
U, K |
| SELL | From every state the invariant runs reach, an exact-in sell of a small and of a very large GENE balance succeeds | I (GenePermanence.t.sol:167-185) |
| CALL | The hook calls only the PoolManager and GeneToken, never GeneLens | S, U |
Release rule: zero skipped tests; the fork suite fails when its RPC variable is unset. The full regression on the RC4 code ran 5,920 tests with 0 failed and 0 skipped.
Each entry above is asserted by the suites in its last column, for every state those suites reach.
#Parameters
Pool and placement _encodePool
| Constant | Value | Meaning | Source |
|---|---|---|---|
VERSION | 4 | Genome encoding version (4 = V6g-D all-time-low rule + R1 REGENERATION cooldown) | Genome.sol:12 |
SUPPLY | 1,000,000,000 GENE | Fixed supply, minted once to the hook and seeded into the pool at launch | Genome.sol:15 |
LP_FEE | 10,000 pips (1%) | Static 1.00% LP fee in the PoolKey | Genome.sol:16 |
TICK_SPACING | 60 ticks | Pool tick spacing | Genome.sol:17 |
GENESIS_TICK_UPPER | 178,080 ticks | Opening price: the top of the genesis band | Genome.sol:18 |
GENESIS_TICK_LOWER | 85,920 ticks | 10,000x the opening price: the far edge of the genesis band (a design bound) | Genome.sol:19 |
EPOCH_BLOCKS | 7,200 blocks | Epoch length, about 24 hours | Genome.sol:22 |
MIN_BLOCK_VOLUME | 0.05 ETH | ETH swap volume that makes a block count as active | Genome.sol:23 |
PATH_CLAMP | 200 ticks | Most ticks one block can add to an epoch's path | Genome.sol:24 |
GAP | 60 ticks | Minimum distance of a placement from its reference price | Genome.sol:27 |
GRID | 600 ticks | Placement band edges snap to this grid | Genome.sol:28 |
NEAR_WIDTH | 1,200 ticks | Width of the ETH bands placed at the all-time low | Genome.sol:29 |
Caps and timing _encodeCaps
| Constant | Value | Meaning | Source |
|---|---|---|---|
BID_CAP_CALL | 3 ETH | METABOLISM bids, most ETH per metabolize() call | Genome.sol:34 |
BID_CAP_EPOCH | 10 ETH | METABOLISM bids and churn tier, most ETH per epoch | Genome.sol:35 |
IMMUNITY_CAP_CALL | 1 ETH | IMMUNITY, most ETH per call | Genome.sol:36 |
IMMUNITY_CAP_EPOCH | 1.5 ETH | IMMUNITY, most ETH per epoch | Genome.sol:37 |
ASK_CAP_CALL | 10,000,000 GENE | Ask Mass, most GENE per call | Genome.sol:38 |
ASK_CAP_EPOCH | 30,000,000 GENE | Ask Mass, most GENE per epoch | Genome.sol:39 |
REGEN_CAP_CALL | 0.5 ETH | REGENERATION buyback, most ETH per call | Genome.sol:40 |
REGEN_CAP_EPOCH | 1 ETH | REGENERATION buyback, most ETH per epoch | Genome.sol:41 |
MIN_DEPLOY_ETH | 0.001 ETH | Smallest ETH placement | Genome.sol:42 |
MIN_DEPLOY_GENE | 1,000 GENE | Smallest GENE placement | Genome.sol:43 |
COOLDOWN_BLOCKS | 300 blocks | Blocks between metabolize() calls (and after a full-allotment regenerate()) | Genome.sol:44 |
HARVEST_PER_CALL | 8 | Registry positions poked per metabolize(), plus genesis | Genome.sol:45 |
REGEN_PREMIUM_TICKS | 100 ticks | A buyback never pays more than about 1% over the all-time-low price | Genome.sol:46 |
REGEN_SHARE_BPS | 2,000 bps (20%) | REGENERATION's share of the net-flow bid budget once expressed | Genome.sol:49 |
GENE_COUNT | 4 | Number of genes | Genome.sol:61 |
AUTO_EVOLVE_MAX | 8 | Pending epochs one metabolize() folds before spending | Genome.sol:54 |
Gene conditions _encodeGenes
| Constant | Value | Meaning | Source |
|---|---|---|---|
MET_MIN_EPOCH | 1 epochs | METABOLISM can express from epoch 1 | Genome.sol:64 |
MET_REVENUE | 0.25 ETH | METABOLISM pressure: epoch revenue at least 0.25 ETH | Genome.sol:65 |
MET_OBSERVE | 2 epochs | METABOLISM: 2 consecutive pressure epochs | Genome.sol:66 |
REG_MIN_EPOCH | 14 epochs | REGENERATION can express from epoch 14 | Genome.sol:70 |
REG_REVENUE | 0.25 ETH | REGENERATION pressure: revenue at least 0.25 ETH | Genome.sol:71 |
REG_ACTIVE_BLOCKS | 300 blocks | REGENERATION pressure: at least 300 active blocks | Genome.sol:72 |
REG_OBSERVE | 7 epochs | REGENERATION: 7 consecutive pressure epochs | Genome.sol:73 |
REG_ETH_COMMITTED | 10 ETH | REGENERATION: at least 10 ETH committed to Mass | Genome.sol:74 |
IMM_MIN_EPOCH | 14 epochs | IMMUNITY can express from epoch 14 | Genome.sol:77 |
IMM_REVENUE | 0.1 ETH | IMMUNITY pressure: revenue at least 0.1 ETH | Genome.sol:78 |
IMM_PATH_TICKS | 3,000 ticks | IMMUNITY pressure: price path at least 3,000 ticks | Genome.sol:79 |
IMM_WINDOW | 7 epochs | IMMUNITY: window of the last 7 epochs | Genome.sol:80 |
IMM_REQUIRED | 5 epochs | IMMUNITY: 5 pressure epochs in the window | Genome.sol:81 |
IMM_DEPLOY_REVENUE | 0.5 ETH | IMMUNITY deployment: each confirming epoch earns at least 0.5 ETH | Genome.sol:85 |
IMM_CONFIRM | 2 epochs | IMMUNITY deployment: the last 2 processed epochs both deploy-stressed | Genome.sol:86 |
Sources (23)
- src/Genome.sol:4-116
- src/GeneHook.sol:25-45
- src/GeneHook.sol:65-90
- src/GeneHook.sol:97-117
- src/GeneHook.sol:157
- src/GeneHook.sol:164
- src/GeneHook.sol:172-221
- src/GeneHook.sol:245-273
- src/GeneHook.sol:276-329
- src/GeneHook.sol:368-390
- src/GeneHook.sol:420-435
- src/GeneHook.sol:451-591
- src/GeneHook.sol:610-627
- src/GeneHook.sol:669-725
- src/GeneHook.sol:728-873
- src/GeneHook.sol:879-947
- src/GeneHook.sol:975-992
- src/GeneLens.sol:202-206
- test/invariant/GenePermanence.t.sol:96-102
- test/invariant/GenePermanence.t.sol:139-151
- test/invariant/GenePermanence.t.sol:167-185
- test/unit/GenomeHash.t.sol:11
- test/unit/GenomeHash.t.sol:23
Paths are relative to the GENE repository at tag rc4-audit-candidate (aca5fcd).
