01The SushiSwap Issue
THE RECIPEx · y = kNEXT DOORa fork!

The kitchen next door, a little after midnight. The fork is doing a lot of work in this picture.

03 SUSHI STORIES
Chapter IThe Kitchen Next Door

Chapter One

The Kitchen Next Door

In which a new chef copies a famous recipe and adds one secret ingredient

Once upon a time, in a tiny kitchen next door to the busiest shop in town, there lived a Chef with a very tall hat and a very short attention span. Next door, Uni the unicorn ran a famous swap shop. People came from everywhere to trade one thing for another, and Uni never once had to set a price.

That was the magic. Uni’s recipe was pinned to the wall for anyone to read, because Uni believed recipes should be free. x · y = k, it said, and not much else.

The Chef read it twice. Then the Chef picked up a fork, which in this kitchen means copying something and changing it, and said to Maki, the little roll on the counter: “What if we use the same recipe, but the customers get a slice of the restaurant?”

The SushiSwap Issue 04
01The SushiSwap Issue
THE RECIPEx · y = kNEXT DOORa fork!

The kitchen next door, a little after midnight. The fork is doing a lot of work in this picture.

Chapter One

The Kitchen Next Door

In which a new chef copies a famous recipe and adds one secret ingredient

Once upon a time, in a tiny kitchen next door to the busiest shop in town, there lived a Chef with a very tall hat and a very short attention span. Next door, Uni the unicorn ran a famous swap shop. People came from everywhere to trade one thing for another, and Uni never once had to set a price.

That was the magic. Uni’s recipe was pinned to the wall for anyone to read, because Uni believed recipes should be free. x · y = k, it said, and not much else.

The Chef read it twice. Then the Chef picked up a fork, which in this kitchen means copying something and changing it, and said to Maki, the little roll on the counter: “What if we use the same recipe, but the customers get a slice of the restaurant?”

03–04

I · The Kitchen Next Door

Two Bowls and One Rule

TWO BOWLStuna (x)×rice (y)= always the same kTUNA IN THE POOL →RICE →
The recipe, explained badly with bowls. Tap the bowls, then the dot.

“Here’s how Uni’s shop works,” said the Chef, pulling out two bowls. “One bowl of tuna, one bowl of rice. That pair is a pool. If you want tuna, you put rice in and take tuna out.”

“But how much tuna?” asked Maki.

“Whatever keeps the rule true. Multiply the tuna by the rice and you must get the same number, k, as before.” The Chef scooped. “Take a little tuna and you pay a little rice. Take a lot and the tuna bowl gets nearly empty, so each extra piece costs more and more rice. That’s called price impact. The pool never runs out. It just gets very, very expensive.”

Maki thought about this for a long time, which for a roll is about four seconds. “So nobody sets the price. The bowls do.”

05–06

I · The Kitchen Next Door

Swap at the Counter

The first customer of the night was Wasabi, a small green blob with strong opinions. “I’d like some tuna,” said Wasabi, “and I want to see the maths.”

So the Chef put the bowls on the counter. You choose how much rice Wasabi pays. Watch how much tuna comes out, and watch what happens to the price when Wasabi gets greedy.

There’s a tiny tip, too: every swap leaves 0.3% of what you put in behind in the pool. Remember that. It’s going to matter a lot when the neighbours come over.

Try it · Swap at the counter

Tuna bowl

95.25 tuna

Rice bowl

10,500 rice

Tuna out
4.748
Price before
100 rice / tuna
Price Wasabi paid
105.3 rice / tuna
Price after
110.2 rice / tuna
Price impact
+5.3%

Bigger order, steeper curve. Each extra piece of tuna costs Wasabi more rice than the last.

The pool starts with 100 tuna and 10,000 rice, so k = 1,000,000. The 0.3% fee is taken from what Wasabi pays and stays in the pool.

07–08