How it pays

Eight short parts. One idea each.

1The rule

Selling costs 1%. Buyers receive it.

OctoSwap is a token on Uniswap v4, with one rule. When someone sells, 1% of the ETH they were due is set aside. That money is then paid to the buyers who come next.

Every buy receives 1% of its size, as long as there is money left to hand out.

The protocol only moves money, from sellers to buyers. Nothing comes from outside, and the protocol keeps nothing.

Someone sells 1% of the ETH due one of the eight arms holds the tax one eighth at each swap the reserve Someone buys 1% of the buy
What comes in through a sale goes out through a buy.

2What each side pays

Getting in costs less than getting out.

A seller pays 1.30% in all. 1.00% goes onto an arm. 0.30% is the ordinary pool fee, paid to liquidity providers.

A buyer pays the 0.30% pool fee and nothing else. When the reserve holds enough, the buyer also receives 1.00% of the buy.

The tax is always taken in ETH, never in tokens.

Selling costs 1.30% 1.00% onto an arm 0.30% to the pool Buying costs 0.30% up to 1.00% received 0.30% to the pool from the reserve
The width of each bar is its share of the swap.

3The eight arms

The last eight swaps, one on each arm.

The protocol remembers the last eight swaps. Each one sits on an arm.

  • An arm that holds a sale also holds its tax.
  • An arm that holds a buy holds nothing.
  • At every new swap, the oldest arm is taken back for the new one.
Arms 1, 4, 6 and 8 hold a sale. The four others hold a buy. A blue sucker is an eighth still on the arm.

4By eighths

An arm lets go one eighth at each swap.

The tax of a sale is not handed over in one go. At every swap, each arm lets one eighth of its tax go into the reserve.

An arm lasts eight swaps, so it is empty at the exact moment it is taken back. A sale of 10 ETH leaves 0.100 ETH on its arm: 0.0125 ETH goes at each of the next eight swaps.

Why not all at once? The whole tax would nearly always go to the fastest bot. Spread over eight swaps, one big sale pays several buyers in a row.

0.100 ETH on the arm nothing left sale12345678 the eight swaps that follow
One sale, then the eight swaps that follow it.

5The reserve

What the arms let go waits in the reserve.

The reserve is the money the arms have let go and that has not been paid out yet. It is the only amount the protocol holds.

It goes up at every swap, by what the arms let go. It goes down at every buy, by the bonus paid.

When many people sell and few buy, the reserve grows and waits for the buyers.

the reserve every swap what the arms let go every buy the bonus No other way in. No other way out.
The reserve can never go below zero: a bonus is never larger than what it holds.

6The bonus

1% of your buy, or what is there.

When you buy, you receive 1% of your buy, taken from the reserve. If the reserve holds less, you receive what it holds. If it is empty, you receive nothing.

The bonus arrives in the same swap. There is nothing to claim afterwards.

The bonus is never larger than the tax. Selling then buying back returns your own 1% at best, and costs the pool fee twice.

1% of the buy what the reserve pays 0.5 ETH bought, 0.0125 in the reserve1.00%2 ETH bought, 0.0200 in the reserve1.00%4 ETH bought, 0.0245 in the reserve0.61%1 ETH bought, nothing in the reservenothing
The third buy is the largest: the reserve did not hold enough.

7The moment

The fall pays the recovery.

When as many people buy as sell, each seller loses 1% and each buyer receives 1%. Nothing new has appeared: it is a transfer, not a creation.

What changes is the moment. In a fall, many sellers pay and few buyers collect, so the reserve fills. When the buyers come back, they are paid with the money of the fall.

Over the full cycle of the model, sellers paid 5.40 ETH, buyers received 5.28 ETH, and 0.12 ETH was still waiting.

paid by sellers received by buyers, in ETH 1.611.61rise1.250.34fall1.041.94recovery1.511.39calm
The dashed part is the same money. It waited through the fall and was paid in the recovery.

8The catch

What it does not do.

  • It is an exit tax. Selling always costs 1% more than buying, and you will pay it yourself when you sell.
  • The bonus depends on the reserve. In a strong rise almost nobody sells. In the model, buyers then received 0.42% on average, and 28% of buys received nothing.
  • It does not stop a fall. 1% stops nobody who wants to sell. If nobody wants to buy, the reserve grows and waits.
  • The first to buy collects. It will often be a bot, and someone can buy just before you. The amount shown before a buy is what is there now.
  • Another pool would drain it. If most sales went through a pool without the tax, the reserve would stop filling.
  • The settings are final. 1% and eight swaps. Nobody can change them, even if they prove too strong or too weak.
Average bonus received by buyers 1% strong rise0.42%rise0.64%calm0.99%fall1.00%strong fall1.00%
The model replayed 200,000 swaps for each market. A strong rise is a market with 30% of sales.

A few words

The tax
1% of the ETH a seller was due, set aside at the sale.
An arm
The memory of one of the last eight swaps. It holds the tax when that swap was a sale.
An eighth
What an arm lets go into the reserve at each swap.
The reserve
What the arms have let go and that has not been paid out yet.
The bonus
What a buy receives from the reserve: 1% of the buy at most.
The pool fee
0.30% on every swap, paid to liquidity providers. The protocol does not touch it.