This article is part 1 of my “Liquidity for All” series.
Imagine an alternate reality where Nintendo characters are small business owners in their respective games’ ecosystem. Mario & Luigi run a shop where they sell stars, mushrooms and fireballs using the Mushroom Kingdom’s native currency “Coin”. Similarly, Zelda & Link own a store that sells potions, arrows, and shields valued in Hyrule’s currency, the “Rupee”.
One day, all of these characters meet up (perhaps in Super Smash Bros) and start talking shop. Zelda starts to wonder why her associates don’t have access to invincibility stars and mega mushrooms, while Mario visualizes himself chugging potions and fighting Goombas with a bow and arrow. Suddenly, the issue becomes clear — there is no way to buy Stars with Rupees, or Potions with Coins. More fundamentally: there is no way to swap between Coins and Rupees!
With this newfound insight, Mario and Zelda team up to create the first “Nintendo Exchange (NEX)”, where characters can swap their Coins for Rupees and vice-versa. They realize it’s a completely different business model: at their stores, the goal is to sell all of their inventory for a set price, while for NEX they want to ensure neither currency is ever “sold out”, and that “swaps” are executed at the best possible price.
The team creates a 2-sided storefront with signs indicating: Coins to Rupees and Rupees to Coins. Mario and Zelda each contribute 5,000 of their respective currency. This creates an initial “Liquidity Pool” with a 1:1 ratio of equal-value Coins and Rupees.
They decided on 3 rules that govern the exchange:
1) Number of Coins x Number of Rupees = Constant
5,000 Coins x 5,000 Rupees = 25 Million constant. This is commonly known as “x * y = k”.
2) Price of Coin = Number of Rupees / Number of Coins
5,000 Coins / 5,000 Rupees = 1 Coin per Rupee
3) NEX collects 0.01% tax on transactions to support operating costs
Let’s see this in action!
Focus on the inverse proportionality here: if Shy Guy wants to buy a potion, he would need to swap his Coins to Rupees. To satisfy rule #1, he adds 500 Coins but removes only 455 Rupees from the NEX Liquidity Pool. This changes the balance of supply and demand within NEX: the Rupee became more scarce and thus increased in price per rule #2.
So when Young Link subsequently decides to buy mega mushrooms, his Rupee to Coin swap will be slightly favorable. He receives 292 Coins for 255 Rupees, and this transaction rebalances the liquidity pool. Now Diddy Kong, who was next in line, is disappointed that his Rupee to Coin exchange rate is less appealing; but decides to go ahead and swap his Rupees while they are more valuable than Coins. This restores equilibrium to the liquidity pool, which reverts back to a balanced 1:1 ratio.
After a successful pilot program, Mario and Zelda plan a huge launch party to promote NEX and drive widespread adoption. But on the day of the event, things go awry… It turns out Bowser and Ganondorf had been spying on our Nintendo heroes, and decided to open up their own “Villains Nintendo Exchange (V-NEX)” with 2,500 units of currency each, using the same liquidity pool structure and formulas.
As we might expect, the upstanding Nintendo citizens swapped their currency using NEX, while the villains preferred V-NEX. After a month of fierce competition, it became clear that Mario and Zelda’s NEX is more popular, with higher transaction count and trading volume than V-NEX. With this in mind, Bowser brought on Wario as a consultant to help identify the issues and scale up the business.
Wario’s assessment was that NEX’s larger liquidity pool (10,000 vs. V-NEX 5,000) means smaller price fluctuations and more efficient trades. A swap of 500 Coins has a larger impact on the price of assets in V-NEX than in NEX:
Wario also learned that Rosalina implemented a clever trading strategy: she buys temporarily-undervalued currency from V-NEX then immediately teleports to NEX and sells it at a better price, and vice-versa. This is called “arbitraging” which is crucial to maintaining price consistency across exchanges, so Wario was not overly concerned.
In an effort to size up their liquidity pool and grab market share, Wario suggested that V-NEX implement a crowd-funding program. Villains can “stake” their own currency, either Coins or Rupees, and receive share of the profits from the 0.1% tax on each swap. This seemed like a good plan: instead of investing their personal money or taking a loan from Nintendo, the V-NEX leadership could raise funds from willing investors, and hopefully overtake NEX.
But by allowing users to stake any amount of a single currency, Wario inadvertently violated rule #1 of liquidity pools: x * y = k. Ganondorf forgot to send out invitations to the launch party, despite numerous reminders, so no villains from Hyrule showed up. What do you think happened next?
Villains from the Mushroom Kingdom flocked to V-NEX with the intention of investing their idle Coins to earn rewards and support cross-ecosystem commerce. After the 2,500 crowd-funded Coins were deposited, however, the liquidity pool balance had drastically shifted: Coins flooded the V-NEX market which halved the price, while the Rupee suddenly doubled in scarcity and value. Despite their massive losses, V-NEX investors were too afraid of Bowser and Ganondorf to voice their outrage.
While Rosalina made a huge profit by pocketing the difference between the V-NEX and NEX prices; Mario and Zelda watched this fiasco unfold with keen interest. They realized that “1-sided liquidity” was a dangerous proposition, and devised a system where investors buy into the 2-sided liquidity pool itself.
The NEX crowd-funding program requires that investors contribute an equal number of Coins and Rupees. These assets are combined into singular “Coin-Rupee Liquidity Pool (LP) tokens” and deposited into NEX, ensuring any added funds are evenly spread between both assets. Investors are then rewarded based on their share of the pool: if Koopa Troopa deposits 500 of each token, he would account for ~9% of the pool and receive proportional rewards from transaction taxes. And to cement the NEX’s position as the premier Nintendo exchange, Mario partnered with his old foe Donkey Kong to provide free Bananas to early investors!
Sure enough, the “NEX Liquidity Mining Program” was a smashing success: the pool scaled up from 5,000 Coin-Rupee LP tokens to 50,000, and villains flocked over from the notoriously unpredictable V-NEX. With this large liquidity pool, the impact of individual swaps became negligible and the price stabilized between Coin and Rupee. The resulting higher volume of transactions also led to increased taxes and rewards for investors, or “liquidity providers”. All is well in the Nintendo world.
This facetious model is actually not far from the real-world implementation of Decentralized Exchanges (DEXs) and associated Liquidity Mining Programs. I have intentionally left out impermanent/divergent loss and other topics, which will be discussed in the part 2 “Liquidity for Teens: Rebalancing Pool Party” here.