Skip to the plate
Atlas of Engrama mind in the poolPlate VIII
Plate VIII

Anatomy

The whole of ENGRAM, described as an atlas describes an organ: what it is, what it touches, what it does, what was measured, and where it fails.

Nothing here is a promise. It is a reading of five contracts that, once deployed, nobody can change.

I. Description

ENGRAM is a token and four contracts around one Uniswap v4 pool of native ETH against ENGRAM. The Hippocampus is the pool's hook. For every swap it perceives ten features of the trade, asks the living mind what the trade's markout will be, sets the trade's LP fee from the answer, and takes a fixed hook fee; a trade that puts 0.005 ETH or more through the pool it also writes into the trace, eight such trades later.

The Cortex is the arithmetic every mind runs: one copy, shared by the hook that prices with a mind and by the Dreams that grade it, so a mind is graded by exactly the function that will price trades with it. The Dreams are the daily rounds in which the mind is replaced. The Beacon checks drand's signatures. The Launcher made all of it in one transaction and keeps the launch liquidity.

A mind is 109 bytes: ten inputs, eight hidden units with a ReLU, one output, int8 weights, int16 biases and two shifts. It is kept as the code of a small data contract. The default mind is address zero and predicts nought for everything.

II. Relations

The living mind is a pointer in the hook, champion, that only the Dreams may move. The Dreams read the hook's checkpoints and pay winners out of the hook's pot. The Beacon answers the Dreams. The Launcher holds the launch position's NFT, and nothing in it can move that NFT.

OWNER, 0x9BD7651C7A3542F22B6E4f0B50BfF08bEe5e6494, receives two streams: the hook's 1.00% of every trade's ether, and the locked launch position's LP fees at the base 0.30%. Whatever the mind charges above the base is burned: the Launcher burns that ENGRAM and sends that ether to 0x...dEaD, so OWNER earns the same from the band whatever the mind charges, and gains nothing by steering the Dreams toward a mind that charges more. It can call nothing that anyone else cannot: no function in any of the contracts is reserved to OWNER or to any person. The only restricted calls are the hook's, which answer the PoolManager and the Dreams alone.

The pool was opened by the Launcher in the same transaction that made the hook, within 50 ticks of a price pinned into the hook, so nobody could open it first at another price, and nobody can open a second pool on this hook.

III. Function

  1. Perceive. Before each swap the hook builds ten int8 features: the trade's size against the pool's depth, its direction, the seconds since the last swap, the swaps already in the block, the decayed recent ether flow and tick movement, how far the price has run the trade's way, the signer's memory, whether the signer is fresh, and the run of same-direction trades.
  2. Predict. It runs the living mind on them. The prediction is the trade's expected markout, in basis points.
  3. Price. The LP fee is clamp(0.30% + prediction, 0.05%, 3.00%), one basis point of fee per basis point of predicted markout. A trade the mind expects the price to follow pays more; one it expects the price to undo pays less.
  4. Charge. The hook fee is fixed at 1.04% of the ether leg: 1.00% for OWNER, 0.04% for the trainers' pot.
  5. Remember. A trade that puts 0.005 ETH or more through the pool, counted after a fee taken before the swap, waits eight such trades. Then its markout is known; it is written as a trace into a keccak256 chain, a checkpoint closes every 512 traces, and the signer's memory moves toward the new label by the trade's weight: w sixty-fourths, with w from 1 to 48 sixteenths.
  6. Train. Anyone fits a mind on the trace, off chain or on Plate V, and seals it for the next window with a bond of 0.01 ETH: a commitment, and optionally the mind time-locked to the drand round at the window's close.
  7. Dream. After the window: reveal for 8 hours; seed with drand's signature, which draws up to four of the segments that began and ended inside the window; grade every candidate, the living mind and the default on the trades in them made after the window opened, until 18 hours after the window; then wake, in order.
  8. Wake. A living mind that was graded in the round and did worse than the default is retired. The best fully graded candidate, if its loss is under 97% of both the living mind's and the default's, becomes the living mind, and its trainer is credited a bounty paid by its improvement: 4 times what the pot took in while the drawable segments were written, times (bar minus loss) over bar, where the bar is the lower of the two losses; never more than the pot holds; plus bonds forfeited since the last win.

IV. Measurements

transactiongaswhat it does
The launch (one transaction)6,644,350deploys ENGRAM, the hook, the Dreams; opens and fills the pool
Submit a sealed candidate104,618with its 277-byte time-lock
Reveal a candidate134,785deploys its 109 bytes as a data contract
Seed a round277,076checks the drand signature on chain
Grade one drawn segment8,857,796 to 8,926,151512 traces, three candidates and the default
Wake (finalize) a round182,007with a promotion and a bounty
Collect the locked position's fees169,687pays OWNER at the base fee, burns the rest

Measured on a Prague fork of mainnet with the contracts as built, every figure from engram/measured.json. Grading many candidates takes several transactions: Plate VI keeps each under 15,000,000 gas, inside the 16,777,216 one transaction may use.

V. Lesions

What ENGRAM cannot do, stated plainly.

  • The mind sees only what the hook sees on chain. It cannot know the future; it can be wrong, within bounds: the LP fee never leaves 0.05% to 3.00%, and the hook fee never changes.
  • Memory is kept per signer. An address that rotates is always fresh; a relayer or bundler shares one memory among everyone it carries.
  • Grading is by sample: up to four of the segments of 512 trades that began and ended inside the window, not every trade of it.
  • A trade that puts under 0.005 ETH through the pool pays both fees but is not remembered: it writes no trace, moves no memory and does not move the market state the mind reads. The ether counted is what went through the pool after a fee taken before the swap, so a 0.15 ETH exact-in buy weighs 47 sixteenths, not 48.
  • Rounds need keepers. A round nobody seeds, or whose drawn segments are never all graded for the default, wakes void: nothing changes and revealed candidates get their bonds back.
  • A window needs two completed segments, about 1,024 remembered trades, to be graded. A pool that completes fewer than two in a day cannot be graded that day, and keeps its mind.
  • A living mind is retired only when someone grades it in a round. Grading is open to anyone, but if nobody grades the living mind, it stays.
  • A candidate whose time-lock does not open can be revealed only by its trainer, who may withhold it at the price of its bond.
  • A candidate is graded only if someone pays the gas to grade it on every drawn segment before grading closes; one not fully graded forfeits its bond.
  • A swap that would end with no liquidity in range, or beyond tick 887,220 either way, is refused.
  • The Uniswap web app cannot route this pool; Plate VII builds the swap itself.
  • OWNER receives the hook's 1.00% and the locked position's LP fees at the base 0.30%, so it trades in this pool at almost no cost, and could fake an improvement more cheaply than anyone else.
  • The owner's share of the band's fees is exact while the band's share of the pool's liquidity stays the same between collects; when outside liquidity comes and goes, it is the volume-weighted average.
  • No owner, no admin, no pause, no upgrade. That also means no repair: what is deployed is what there is.

VI. The constitution

partfixed atplate
Supply1,000,000,000 ENGRAM, minted once; burnable, never mintableEngram
Hook fee1.04% of the ether leg: 1.00% to OWNER, 0.04% to the trainers' potHippocampus
LP feeclamp(0.30% + prediction, 0.05%, 3.00%)Hippocampus
Tick spacing60Hippocampus
Markout lag8 tradesHippocampus
Segment512 traces per checkpointHippocampus
Rememberedtrades that put 0.005 ETH or more through the pool, after a fee taken before the swap; smaller ones pay their fees and leave no traceHippocampus
Label clip+-200 bpsCortex
Trade weightone sixteenth per 0.003125 ETH, 16 at 0.05 ETH, at most 48 from 0.15 ETHCortex
A mind109 bytes: 10 inputs, 8 hidden units, 1 outputCortex
A window24 hours, from the Dreams' GENESISDreams
Revealfor 8 hours after the windowDreams
Scoreuntil 18 hours after the windowDreams
Bond0.01 ETH per candidateDreams
Drawup to 4 segments per round, of those that began and ended inside the window; a window needs two completed segmentsDreams
Margin3.00% below both the living mind and the defaultDreams
Bounty4 x the window's pot x the winner's improvement, (bar minus loss) over bar, never more than the pot holds; plus forfeited bondsDreams
Time-lock277 bytes, to the drand quicknet round at the window's closeDreams

VII. Questions

Who sets the fee I pay?
The living mind, for your trade alone, from what the hook can see of it and of you. It is a number between 0.05% and 3.00% for the LP fee, plus the fixed 1.04% hook fee. Plate I shows what a trade would pay now.
Who earns what?
Liquidity providers earn the LP fee. OWNER earns 1.00% of every trade's ether and the locked launch position's LP fees at the base 0.30%; whatever the mind charges above the base is burned. Trainers earn bounties from the 0.04% pot, and only by winning a round.
Can anyone change the rules, the fees, or the token?
No. There is no owner function, no setting, no pause and no upgrade in any of the contracts. The only thing that changes is which mind is living, and only the Dreams change it.
What if a bad mind wins?
It still cannot charge outside 0.05% to 3.00%. And any later round in which someone grades it measures it against the default: if it does worse, it is retired, whether or not anyone challenges it.
What if nobody keeps the Dreams?
Unkept rounds wake void, and the living mind stays. Any visitor can keep them from Plate VI; each step costs only gas.
Why can I not trade it on the Uniswap app?
Its hook returns deltas, which the app cannot route. Plate VII sends the same swap to Uniswap's own UniversalRouter with the pool's key spelled out.
Is my seal safe in this page?
The salt and the mind stay in your browser and in the file you download. The page sends only the commitment and the time-lock. Once the window opens no candidate can be changed, and none can be read by anyone but its own trainer until the window closes.

VIII. The contracts' own plates, 0 to VI

The contracts number their own plates from 0, the parts of Uniswap v4 they are built on, to VI, the Launcher. Here are their headers, word for word.

contract plate 0 the skeleton: parts of uniswap v4 it is built on

engram/V4Types.sol, its header, as built on 2026-10-05

Description. The bones the other plates hang from, cut down to what they use: the swap and liquidity structs, Currency, BalanceDelta and BeforeSwapDelta, PoolKey, the PoolManager and PositionManager interfaces, the hook permission check, slot0 and liquidity read straight out of the PoolManager's storage (pools live at slot 6), Uniswap's TickMath, and a 512-bit mulDiv. Never deployed on its own; compiled into the contracts that use it.

Relations. No periphery import, so nothing here drifts when a package moves.

contract plate I the body: the engram token

engram/Engram.sol, its header, as built on 2026-10-05

Description. 1,000,000,000 ENGRAM, minted once, in the constructor, to whoever deploys this contract: the Launcher (PLATE VI), which places them in the pool. No mint function exists.

Relations. None to the mind. The pool's hook (PLATE II) charges trades, never transfers; to this contract the hook, the pool and the trainers are ordinary holders.

Function. A plain ERC-20. burn and burnFrom may be called by any holder, so supply can only fall. EIP-2612 permit is supported.

Lesions. None to report, and none possible: no owner, no admin, no pause, no blacklist, no trading switch, no proxy, no upgrade. Not advice. ENGRAM can go to zero.

contract plate II the hippocampus: where every trade becomes a memory

engram/Hippocampus.sol, its header, as built on 2026-10-05

Description. The Uniswap v4 hook of the one ETH / ENGRAM pool (flags 0x20CC). It does three things to every swap and a fourth to every swap that moves at least 0.005 ETH (MIN_TRADE), and nothing else:

  • 1. It perceives the trade: ten features, read from the pool and from its own memory (PLATE III gives their encoding).
  • 2. It asks the living mind for the trade's expected markout and sets the trade's LP fee:
    lpFee = clamp(0.30% + prediction, 0.05%, 3.00%)
    A trade the mind expects to be informed pays more; one it expects to revert pays less.
  • 3. It takes the hook fee: 1.04% of the trade's ether leg. 1.00% belongs to the owner, 0.04% to the trainers' pot.
  • 4. It remembers. The trade waits eight remembered trades; then its markout is known (how far the price went on in the trade's direction, measured from the price the trade itself left, so that a trade's own impact never counts), it is written to the trace (a hash chain the Dreams grade minds against), and the trader's own memory is updated: an average of the markouts of that address's past trades, each moving it by the trade's weight. A trade's weight and the MIN_TRADE test use the ether that went through the pool (after a fee taken before the swap), so a 0.15 ETH exact-in buy weighs 47 sixteenths, not 48.

The features, each an int8:

f0 size    9 x log2(1 + the trade's ether in basis points of the pool's ether depth), max 127
f1 dir     +64 for a buy, -64 for a sell
f2 gap     8 x log2(1 + seconds since the last swap), max 127
f3 block   32 x min(swaps already in this block, 3)
f4 flow    the decayed recent ether flow, in basis points of depth, signed toward this trade
f5 vol     the decayed recent tick movement per trade, max 127
f6 trend   ticks the price has moved in this trade's direction against its decayed average
f7 memory  this address's weighted average markout, scaled by min(trades seen, 8) / 8
f8 fresh   100 if this address has no memory yet, else 0
f9 streak  25 x the run of consecutive same-direction trades, signed toward this trade, max 4

"Signed toward this trade" means positive when the quantity agrees with the trade's direction.

The fee on the four shapes of swap. 1.04% exactly on exact-in buys and exact-out sells, where the ether is named and the fee is taken from it before the swap; about 1.05% on exact-in sells and 1.03% on exact-out buys, where it is taken from the ether that moved, after the swap. Fees are minted to this contract as ERC-6909 claims on the PoolManager and paid out later: the owner's share to OWNER by anyone calling payOwner, the pot only to winners named by the Dreams. It also tallies every swap's input (ether on a buy, ENGRAM on a sell) times the base fee and times the LP fee it paid: the Launcher (PLATE VI) pays the owner the locked band's LP fees at the base rate, so no mind, however it was chosen, can earn the owner more by charging more.

Relations. The mind is a pointer, champion, that only the Dreams (PLATE IV) may move. The pool is pinned at deployment: native ETH / ENGRAM, dynamic fee, tick spacing 60, opened within 50 ticks of OPENING_TICK. Nobody can open it anywhere else, or open a second pool on this hook.

Measurements. See measured.json; every gas figure published for ENGRAM is generated from it.

Lesions.

  • Memory is kept per tx.origin, the externally owned account that signed the transaction. An address that rotates is always fresh; an address that behaves earns its own record. A relayer or bundler shares one memory for everyone it carries.
  • The mind sees only on-chain features. It cannot know the future; it can only be wrong in bounded ways: the LP fee never leaves 0.05% to 3.00%, and the hook fee never changes.
  • A swap that ends with no liquidity in range, or beyond tick +-887220, is refused.
  • No owner, no settings, no pause, no upgrade. OWNER can receive; it cannot command.
  • OWNER receives the 1% and the locked band's LP fees at the base rate, so it trades in this pool at almost no cost. It cannot profit from a mind that charges more, but it could fake an improvement in the Dreams more cheaply than anyone else; the most that can take is the trainers' pot. Everything it does is public on chain.

contract plate III the cortex: how a mind thinks

engram/Cortex.sol, its header, as built on 2026-10-05

Description. The arithmetic every mind runs, shared by the pool's hook (PLATE II), which asks the living mind for each trade's fee, and by the Dreams (PLATE IV), which grade candidate minds on recorded trades. One copy of the code, so a mind is graded by exactly the function that will later price trades with it.

Anatomy of a mind. 109 bytes, kept as the code of a small data contract behind one STOP:

  [0]        version, 1
  [1]        s1, the right shift after each hidden unit's ReLU, 0 to 24
  [2]        s2, the right shift of the output, 0 to 24
  [3..82]    W1, eight rows of ten int8 weights; row j feeds hidden unit j
  [83..98]   b1, eight int16 biases, big-endian
  [99..106]  W2, eight int8 output weights
  [107..108] b2, the int16 output bias, big-endian

A perceptron of ten inputs, eight hidden units and one output:

  h_j  = b1_j + sum_i W1_ji * f_i
  out  = b2 + sum_j W2_j * (max(h_j, 0) >> s1)
  pred = out >> s2                      (arithmetic shifts, rounding toward minus infinity)

pred is the expected markout of the trade, in basis points: how far the price will keep going in the trade's own direction over the next eight trades, from the price the trade leaves. The default mind, address zero, predicts 0 for everything.

Anatomy of a trace. One uint256 per trade, written by the hook once the trade is eight trades old and its markout is known:

  bits   0..79   the ten features, int8 each, feature i at bits 8i..8i+7
  bits  80..95   the label: the realised markout in basis points, int16, clipped to +-200
  bits  96..103  the weight in sixteenths of a unit: ether / 0.003125, at most 48 (from 0.15 ETH)
  bits 104..135  the trade's timestamp

Function. loss = sum over traces of weight * (label - clip(pred))^2, with pred clipped to the same +-200 as the label, over the traces of trades made at or after a given moment (the Dreams pass the moment submissions closed). Lower is better. The default mind's loss is the sum of weight * label^2.

Lesions. A mind sees only what the hook can see on chain. Nothing here learns: learning happens off chain, in public, and arrives as a candidate in the Dreams.

contract plate IV the dreams: how the mind is replaced while it sleeps

engram/Dreams.sol, its header, as built on 2026-10-05

Description. Every day is a window of trading. Before a window opens, anyone may submit a candidate mind for it, sealed: a commitment, a bond of 0.01 ETH, and optionally the mind itself time-locked to the drand quicknet round published the moment the window closes, so that anyone can open it then. Once the window opens no candidate can be changed, and none can be read by anyone but its own trainer until the window closes. Candidates are graded only on trades made after submissions closed: trades that did not exist when they were sealed.

When the window closes the mind sleeps, and dreams:

  • 1. Reveal (8 hours). Each candidate is opened against its commitment and kept as a data contract of 109 bytes (PLATE III).
  • 2. Seed. The window's drand signature is checked on chain by the Beacon (PLATE V). Its hash draws up to four of the segments of 512 traces that both began and ended during the window (the first segment completed in a window began before it, and is never drawn). The range of segments is named by the caller and checked against the hook's checkpoint times at both ends, so it cannot leave out, or invent, a segment.
  • 3. Score (18 hours from the close). Anyone may hand in a drawn segment's 512 traces; they are checked against the hook's hash chain, and each named candidate, the living mind and the default mind are graded by the Cortex's loss on those of them that record trades made at or after the window opened.
  • 4. Wake. A candidate graded on every drawn segment takes over only if its loss is below both the living mind's and the default's by 3%. A living mind that grades worse than the default is retired to the default even when nobody challenges it.

The bounty. The winner is paid out of the trainers' pot (0.04% of every trade's ether) by the improvement it showed: 4 x what the pot took in while the drawable segments were written x (bar - loss) / bar, where the bar is the lower of the living and default minds' losses, and never more than the pot holds; plus the bonds forfeited since the last win. A bond comes back when its candidate is graded on every drawn segment; one never revealed, or never fully graded, is forfeited. Winnings and refunds are pulled, never pushed. Any number of candidates may enter a round.

Why these numbers. econ_mind.js, with the contract's own fees, weights and memory floor: a promotion margin of 3% against both the living mind and the default promoted 12 minds, 2 of which then graded worse than the default and were retired at the next round. Pools too quiet to complete two segments in a window cannot be graded at all. Faking improvement (a trainer with no skill planting trades only its own weights can predict, back to back so that they push each other's labels) costs a fixed amount per unit of improvement; this bounty pays at most half of it, so faking loses at every size, in every pool shape tested (the tightest, a busy pool: faking costs 2.09 times what it pays).

Lesions.

  • A sealed mind whose time-lock blob does not open can only be revealed by its submitter. It may then be withheld, at the price of its bond.
  • Rounds settle in order. Each needs someone to seed, score and finalize it; all are open to anyone. A round that is not seeded, or whose drawn segments are not all graded for the default mind, is void: nothing changes and revealed candidates get their bonds back.
  • A window needs at least two completed segments (about 1,024 remembered trades) to be graded. A quieter pool keeps its mind.
  • Grading is by sample: up to four segments of 512 trades, not every trade.
  • A living mind is retired only when someone grades it in a round. Grading is open to anyone, but if nobody grades the living mind, it stays.
  • The owner receives the hook's 1% and the locked band's LP fees at the base rate, so it trades in this pool at almost no cost. It could therefore fake an improvement more cheaply than anyone else; the most that wins is the pot. A mind that charges more earns it nothing: the Launcher (PLATE VI) pays it the base rate and destroys the rest.
  • No owner, no settings, no pause, no upgrade.

contract plate V the beacon: the clock the dreams sleep by

engram/Beacon.sol, its header, as built on 2026-10-05

Description. Every three seconds the drand League of Entropy publishes a BLS signature over the round number. Nobody can know it before it is published and nobody can choose it: a BLS signature is unique, so there is one valid value per round. Its SHA-256 is the round's randomness. This contract checks such a signature against the League's public key with the BLS12-381 precompiles of EIP-2537 and does nothing else.

Relations. The Dreams (PLATE IV) use the round published when a window closes twice: as the time-lock that seals candidate minds until then, and as the seed that draws which segments of the window grade them. Reference: drand quicknet, api.drand.sh/v2/beacons/quicknet/info.

Function. The public key is set once, in the constructor, as eight immutables, and on mainnet MUST be quicknet's; the deploy check reads all eight back and refuses anything else. It is a parameter only so that the fork simulation can sign rounds drand has not reached yet.

Lesions. Carried over unchanged from ISOBAR's Beacon, itself the TICKERWARS core, proven against real quicknet rounds on a Prague fork. Every precompile return size is checked: on a chain without EIP-2537 it reverts PrecompileFailed rather than rejecting every round.

contract plate VI the launcher: birth, and the skull that keeps the liquidity

engram/Launcher.sol, its header, as built on 2026-10-05

Description. Deploying this contract is the launch. The Beacon (PLATE V) is pure and is deployed first; its address is passed in. Then, in this constructor, in order, or not at all:

  • 1. ENGRAM is deployed (PLATE I): 1,000,000,000 minted to this contract (its CREATE nonce 1).
  • 2. The Hippocampus (PLATE II) is deployed with CREATE2 at a salt that lands it on an address carrying exactly the flags 0x20CC (nonce 2), told in advance where the Dreams will be.
  • 3. The Dreams (PLATE IV) are deployed (nonce 3) and MUST be exactly there.
  • 4. The ETH / ENGRAM pool is initialized one unit of price inside the opening tick, a multiple of 60, with the dynamic-fee flag: the hook sets every trade's LP fee.
  • 5. One band of ENGRAM and no ether is added through Uniswap's PositionManager, from the opening price up (ticks -887220 to the opening tick). The opening price is set by a virtual amount of ether chosen at launch; none is there, and every buyer's ether is real. Opening one unit inside the band leaves the position owing one wei; that wei is the only ether sent.

Relations. The position NFT is minted to this contract and stays here for ever. Nothing in it can transfer, approve, decrease or burn the position: the launch liquidity is locked. The LP fee it earns is not: collect, which anyone may call, takes the position's accrued fees, in ether and in ENGRAM, and pays OWNER what the base 0.30% fee would have earned on the same trades. The rest, whatever the living mind charged above the base, is destroyed: the ENGRAM is burned and the ether is sent to DEAD. So the owner earns the same from the band whatever the mind does, and gains nothing by steering the Dreams toward a mind that charges more. Every ENGRAM not placed in the band also goes to OWNER.

The arithmetic. Between two collects the hook (PLATE II) tallies, for buys and for sells apart, every swap's input times the base fee (B) and times the LP fee it paid (C). The owner is paid fees x B / C in each currency, or all of them when C <= B (a mind that charges less than the base earns the owner less, never more). This is exact while the band's share of the pool's liquidity stays the same between collects; when outside LPs come and go it is the volume-weighted average. A donation to the pool is counted as fees.

Lesions. A launch planned for a different nonce fails a check and reverts whole. The locked position is the opening band only; anyone else may add or remove their own liquidity freely. If OWNER ever refuses ether, collect reverts and the fees wait in the position.