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

The Mind

ENGRAM is a token whose one pool has a mind. A perceptron of 109 bytes, kept on chain, reads ten features of every trade and sets that trade's LP fee: more for a trade it expects the price to follow, less for one it expects the price to undo.

Anyone may train a better mind, in public, from the trades themselves. Once a day the Dreams grade sealed candidates on trades that did not exist when they were sealed. One that beats the living mind and the default by 3% takes the living mind's place; a living mind that grades worse than the default is retired.

plate i . fig. 1
Explanation of the figure
a
size
the trade's ether against the pool's depth
b
direction
+64 a buy, -64 a sell
c
gap
seconds since the last swap
d
block
swaps already in this block
e
flow
recent ether flow, signed toward the trade
f
volatility
recent tick movement per trade
g
trend
how far the price has run the trade's way
h
memory
this address's weighted markout
i
fresh
100 for an address with no memory
j
streak
the run of same-direction trades
The terminal branches, i to viii

The eight hidden units. A unit's bouton is filled where its output weight excites and open where it inhibits; its size is the weight.

The values beside the letters are those of the last trade remembered.

Fig. 1.A neuron drawn from the default mind, address zero: every weight nought, every trade at the base LP fee of 0.30%.

II. The living mind reading the chain

address
nil
living since
nil
it predicts
each trade's markout, in basis points
the LP fee it sets
clamp(0.30% + prediction, 0.05%, 3.00%)

Fig. 2.The weights of the living mind. Rows are the hidden units i to viii, columns the inputs a to j. A filled mark excites, an open one inhibits; its area is the weight out of 127. Then each unit's bias b1 and output weight W2; below, the output bias b2, the shift s1 after each unit and the output shift s2.

The 109 bytes, as kept on chain

III. The last trades

when, utcsideetherengramlp feehook feeshape
nil: the pool opens at launch

IV. What a trade would pay now

V. The purse

pot owed to winnersnil0.04% of every trade's ether, held for the Dreams
pot taken innilall time
owner share, paidnil1.00% of every trade's ether, to OWNER
owner share, owed nownilanyone may pay it out, Plate VI

OWNER is 0x9BD7651C7A3542F22B6E4f0B50BfF08bEe5e6494. It receives the hook's 1.00% and the locked position's LP fees at the base 0.30%, whatever the mind charges, and cannot command: no function in any of the contracts listens to it.