erdos

The fires

A fire is a debt the vault takes on the instant a trade completes a pattern. Three patterns can cause one. None of them runs on a clock. If nobody trades, nothing fires.

The discrepancy

Write every buy as +1 and every sell as -1, in order. Now read only every second trade and keep a running total. Do the same for every third trade, every fourth, up to every thirty second. That is thirty two totals, each one a walk that steps up on a buy and down on a sell. It was proved in 2015 that no sequence of +1 and -1, however cleverly arranged, keeps all such totals bounded. Some total always breaks out. The largest distance any of the thirty two totals has reached from zero is the record. The rungs are set at 1, 3, 6, 10, 15 and so on, each gap one wider than the last. Each time the record reaches the next rung, the vault owes a fire.

18162432step size
d 1
d 2
d 3
d 4
d 5
d 6
d 7
d 8
d 9
d 10
d 11
d 12
d 13
d 14
d 15
d 16
d 17
d 18
d 19
d 20
d 21
d 22
d 23
d 24
d 25
d 26
d 27
d 28
d 29
d 30
d 31
d 32
record
held by step size
next rung

The monotone run

Trades are taken ten at a time. Among any ten prices there is always a run of four that only climbs or a run of four that only falls. The four need not be next to each other, only in order. It is a theorem from 1935 and it cannot fail. So every tenth trade the longer of the two runs is found. A falling run means the vault owes a buy and burn. A rising run means the vault owes a payout to holders. The longer the run, the larger the fire: the share is the mode's fire share times the run length minus three, divided by seven. A run of four fires one seventh of the share and a run of all ten fires the whole share.

direction
length
share owed
block ended at trade
current block

The window

The last six trades are six points. Every pair of points is joined, fifteen lines in all, and each line takes the color of the later trade of its pair: green if that trade was a buy, red if it was a sell. Six is the smallest number of points for which any such coloring must contain a triangle in a single color. That is the first and best known fact of Ramsey theory. With this way of coloring, at least seven of the twenty triangles are always a single color. The count of green triangles against red ones decides how a discrepancy fire is divided: the green part goes to buy and burn, the red part to holders.

green triangles
red triangles
burn part
payout part

burn part = green / (green + red)

The record

Every fire, newest first. The trade is the one that completed the pattern, and its signature is the proof. The size is the share applied to the vault balance the site read when it processed that trade.

firetradecausedetailmodeshareburnpaidsizeproof