Measurement and response
This page describes how the two live quantities are produced and how the resistance is applied. It is written so that the numbers on the sheet can be recomputed by anyone who wants to check them rather than believed because they are on a website.
:: Interception
The material is issued under the 2022 standard, which allows a mint to be created with extensions attached permanently at the moment of creation. Extensions are not configuration. They are fixed to the mint and cannot be added, removed, or altered afterwards.
Two are used here. The first is the transfer hook, which requires that every transfer of this supply invoke a specified program before the transfer is permitted to settle. That requirement is enforced by the program that holds the balances, not by convention and not by anything this project controls. There is no wallet path, no exchange path, and no direct instruction that bypasses the call. Every movement of this supply passes through the measurement, including movements nobody wants measured.
The second is the permanent delegate, which grants a fixed authority the ability to burn from any account holding the material. That authority is a program derived address owned by this program. It is not a keypair, it has no private key, and no person can sign for it. The only code that can act with it is the code published on the program page, which contains exactly one operation that uses it and no other.
:: The hook
When a transfer is submitted, the balance program invokes this program before the balances change. Inside that invocation the program performs five operations in a fixed order.
It reads the current slot from the clock.
It ages the trailing record, discarding every observation that has fallen outside the window.
It computes the shear from what remains, against current supply.
It computes the resistance from that shear, and burns that fraction of the amount being moved.
It records the present transfer into the window and updates the permanent marks.
The order is not incidental. A transfer is priced against the state that existed before it rather than the state it creates, so a single large movement is charged the resistance produced by everything that came before it and raises the cost for everything that comes after. Nothing can price itself, and no transfer can arrange to be measured favourably by being large.
:: The window
The window is 1,800 slots. Slot times vary, so it is specified in slots rather than in minutes and runs to approximately twelve minutes in practice. It is a constant compiled into the program.
The record is not a list of transfers. Storing one would grow without bound and would eventually cost more to read than the transfer is worth. Instead the window is divided into sixty buckets of thirty slots each, arranged as a ring. Each bucket holds the total amount observed during its thirty slots and nothing else. The shear is the sum of all sixty.
Ageing is performed by advancing a cursor around the ring and zeroing every bucket the cursor passes. If four hundred slots have elapsed since the last transfer, thirteen buckets are cleared. If more than 1,800 slots have elapsed the entire ring is cleared and the material is at rest. The cost of this is bounded at sixty writes in the worst case, and the worst case only occurs after a period of complete stillness, when nothing else is competing for the block.
This is why nothing needs to be scheduled. The record is not maintained continuously. It is brought up to date at the moment it is next read, which is the moment of the next transfer, and until then it costs nothing to hold and nobody has to remember to do anything.
Fig. 5. The window as sixty buckets of thirty slots. The cursor advances with elapsed time and zeroes what it passes.
:: The shear
The shear is the sum of the ring expressed as a fraction of total supply, in basis points. Expressing it against supply rather than in absolute units matters, because supply falls permanently as the resistance takes from it. A fixed absolute threshold would slowly become harder to reach as the supply shrank, and the material would stiffen over time for no reason connected to how it is being used. As a fraction it stays comparable to itself across its entire life.
Fig. 3. The shear over the trailing window. The dashed line marks the set, which is the highest value ever recorded.
:: The yield
The yield is the resistance produced by the present shear, in basis points, applied to the amount being moved.
yield = base + (ceiling - base) * min(1, shear / reference) ^ n base 30 bps ceiling 900 bps n 2 reference the set, floored at 25 bps
The exponent is what makes the response non linear and it is the whole of the behaviour. At an exponent of one, resistance would rise in direct proportion to the shear, which describes an ordinary fluid that thickens evenly and is not interesting. At two, resistance rises with the square of the applied rate, so doubling the rate of movement roughly quadruples the resistance. That is what produces the long flat run and the steep hook in Fig. 1.
The ceiling exists because an unbounded function is not a material property, it is a wall. At 900 basis points the resistance stops rising. Movement remains possible at any shear whatsoever. It is never blocked, only priced, and the maximum price is fixed at deployment and published here.
The floor exists for the opposite reason. At an empty window the resistance is 30 basis points rather than nothing, so the material has a viscosity at rest. A fluid with no resistance at rest is not a fluid.
All of this is integer arithmetic. There are no floating point operations anywhere in the program. Intermediate products are computed at 128 bits and reduced, ratios are carried in basis points, and the squaring is performed on the ratio rather than on the amount so that nothing overflows at any supply the material can reach. Rounding is toward zero at every step, which means the resistance charged is never more than the resistance computed.
Fig. 4. Distribution of resistance paid across all transfers to date. Most movement occurs in the flat range.
:: The set
The set is the highest shear ever recorded. It never decreases. It is written into program state rather than derived, cached, or recomputed from history, which means it survives independently of any indexer and can be read directly from the account by anyone at any time.
It has one use beyond the record, and it is the piece of this design that is not obvious. The set is the reference point in the resistance function. The curve is scaled against the hardest this material has ever been pushed rather than against a threshold chosen in advance by somebody guessing.
The consequence is that the material calibrates to its own worst moment. Early in its life the set is small, so ordinary movement produces meaningful resistance and the material is sensitive. As it survives larger events the set rises, the reference moves out with it, and the same volume that once produced the ceiling now produces very little. The material becomes progressively harder to alarm, permanently, and only ever in one direction. It does not learn. It only remembers the largest thing that ever happened to it.
The floor of 25 basis points on the reference exists so that the function is defined before the first transfer, when the set is zero.
:: Worked example
At an empty window the resistance is the base of 30 basis points, which is thirty parts in ten thousand of the amount moved.
At a shear of half the set, the ratio is one half, the square of it is one quarter, and the resistance is 30 plus 870 times one quarter, which is approximately 248 basis points.
At a shear of three quarters of the set, the square is nine sixteenths and the resistance is approximately 519 basis points.
At a shear equal to or above the set, the resistance is at the ceiling of 900 basis points, which is nine percent of the amount moved. This is the maximum. It cannot be exceeded under any conditions.
With no further movement the ring empties over 1,800 slots and the resistance returns to 30 basis points. Nobody has to do anything for this to happen and there is nothing to call.