Uniswap: Profit of the automated 3D FOMO pricing mechanism success or failure

Romano RNR
20 min readOct 12, 2020

Do you like making money? Do you happen to be retarded? Do you both? What if I told you there are a million other people just like you.

Welcome to Uniswap

The casino with so many tokens that could keep you up for nights. Airdrops, projects with schemes incentivizing to hold/lock your tokens hat may reward your deposits with tokens which are enticingly absurdly designed to do so, oh and the result of reckless trading, rug pulls, and financial stupidity.

So, you happened to land on this page after doing a bit of research on social media and finding…

“Why not blow your $150 on anything more fun?

You were pleasantly surprised by trading DeFi on finance, you turned that $150 from your initial investment into $3000.

Don’t worry. The first one is free ;)

You’ve become disciplined, and you understand your position because you’ve spent hours yielding. Liquidity pools, LPs’s, impermanent loss, automated market making, you’ve ascended, congratulations! If you don’t understand any of what the fuck I just wrote, it’s okay, neither do a million other degenerates who found their sociopathic community on crypto Twitter.

Making money by trading with leverage and consistently winning is not the only way to get rich. It only takes it to be lucky once on Uniswap to make it!

Please read this article and don’t skim over it or skip reading parts.

What are Decentralized Exchanges and Uniswap

Decentralized exchanges allow trading crypto assets directly via smart contracts in a so-called “non-custodian” on-chain manner, i.e., through decentralized exchanges (DEXs). The main advantages are that information is transparent, there is no single point of failure, and the users maintain custody of their own assets.

Some liquidity pool-based decentralized exchanges are Bancor, Uniswap, Sushiswap, Kyber, and Balancer. Examples of order book-based decentralized exchanges are Loopring and IDEX.

Uniswap is designed with simplicity in mind. It’s a protocol for decentralized exchange/swap of tokens on the ethereum chain deployed as a set of smart contracts, permissionless, and censorship-resistant using concepts such as liquidity pools and a constant product market maker.

Hayden Adams, published at the end of 2018 the initial version of Uniswap called Uniswap v1. Interestingly, Hayden was not a programmer but a mechanical engineer with no knowledge about programming at all. He just learned programming by working on the first version of Uniswap. Using the concept of an automated market maker came from a friend who read a blog post written by Vitalik Buterin about a constant product market maker.

https://uniswap.org/

Between January 8 and April 30, a team of six engineers reviewed and formally verified crucial components of the smart contracts for Uniswap V2. https://uniswap.org/audit.html#org56963b6

  • Formal verification of the core smart contracts
  • Code review of core smart contracts
  • Numerical error analysis
  • Code review of periphery smart contracts (during ongoing development)

In may 2020, the second version of Uniswap was released, which had new functionalities such as ERC20-ERC20 and on-chain price feeds. Before version 2, the only option was ERC20-ETH, which exposed liquidity providers to “impermanent loss,” and for buyers to go through multiple swaps, i.e., from YFI to USDT, you have to swap YFI<->ETH and ETH<->USDT, which requires more fees, transaction fees, and more slippage.

Passive income with Uniswap Liquidity Pools

Liquidity pools are pools of assets locked in a smart contract. It’s used to facilitate trading by providing liquidity and used by some of the decentralized exchanges. The first DEX that introduced liquidity pools was Bancor but got famous due to Uniswap.

Trading on exchanges such as Bitmex, FTX, Binance, BTSE, Coinbase, etc., is based on the order book model. An order book model is also what stock exchanges use, such as Nasdaq and NYSE.

In an order book model, buyers and sellers put their orders on the order book in an order book model. However, what if all parties are unable to position orders at a reasonable amount, or if there are insufficient tokens/coins to purchase? This is where market makers are essential. More information regarding industry makers or market-making can be found here.

Market-making is possible in a smart contract environment, but at a high cost and with a poor user interface. This is because the order book model is strongly dependent on the presence of a market maker or several market makers.

Though order book systems are the most commonly used method of trading electronic assets in conventional finance, they are difficult to implement in a smart contract setting.

The size of the state required by an order book to reflect the collection of pending orders is prohibitively high and prohibitively expensive in a smart contract ecosystem where users would pay transaction fees. Additionally, order book matching is often complex, since it must often accommodate a variety of various order types (such as icebergs, good-till-cancel, and stop orders).

Consider inserting limit orders and potentially paying gas fees to cancel and delete the request from the book. Without a market maker, an exchange’s liquidity deteriorates. Ethereum can only process 15 transactions a second and has an overall block period of 13 seconds. This is not a feasible choice for an exchange of order books. Each transaction would incur a gas tax, and market makers would go bankrupt if they do not periodically change their orders.

The solution for this on ethereum is liquidity pools.

Each liquidity pool retains two securities, and each pool establishes a new demand for the paired tokens. When a new liquidity pool is formed, the first liquidity provider (LP) establishes the pair’s initial price. The LP or liquidity supplier is rewarded for supplying capital of equivalent worth.

Uniswap pool

If the initial price diverts from the global price, it creates an arbitrage opportunity, resulting in a loss for the liquidity provider.

Cash-out Uniswap LP tokens profits

When liquidity providers provide liquidity, the liquidity provider receives LP tokens in proportion to how much liquidity the liquidity provider provided to the pool. Thus, when a trade executes on the pool, a 0.3% fee is proportionally distributed amongst all the LP token holders.

Liquidity Providers can burn their liquidity tokens at any time to withdraw their tokens from the pools.

Every swap results in a price adjustment due to automated market making.

Trades change the balance of reserves resulting in a new price.

Uniswap Automated Market-making (AAM) 3D FOMO pricing mechanism

This mechanism of price adjustment is called AMM or Automated Market Maker. Uniswap, for example, uses a constant product marker maker algorithm that makes sure that the product of the quantities of the two supplied tokens always remains the same.

Constant Product Market Makerx * y = kwhere x is token x quantity 
y is token y quantity
and k = constant

Due to the constant product market maker algorithm, a pool can always provide liquidity no matter how significant trade is. Prices are set automatically using the constant product (x*y=k) market maker mechanism, which keeps overall reserves in relative equilibrium

If someone buys YFI from a YFI/ETH pool, they reduce the supply of YFI and add to the supply of ETH, which increases the price of YFI and decrease in the price of ETH. How much the price moves depends on the size of the trade-in proportion to the pool's size.

The bigger the pool, the less of a price impact/slippage occurs. Large pools can handle more significant trades without impacting the price too much.

The concept of automated market-making powerful. There’s no need for a centralized order book and relies on market makers to quote bids and ask.

Let’s dive deeper with more examples of ETH/USDT. The price of the ETH is $100, and USDT is $1. Now we have to supply an equal amount of quantity of each token. Let’s say we want to provide $1000 each. That would be 10 ETH and 1000 USDT.

x * p = k10 * 1000 = 10 000price
ETH = y/x = 1000 / 10 = 100
DAI = x/y = 10 / 1000 = 0.01

If you are skimming this article, GFY now.

When someone makes a trade, they give one token quantity and get back another from the pool.

So if someone wants to buy 1 ETH, there’s 10 ETH in the pool.

(10-1) * (1000 + x) = 10000
9 * (10000+x) = 10000
1000 + x = 10000 / 9
10000 / 9
= 1000 + x = 1111.11
x = 1111 - 1000
= $111
The price of ETH is now changed $111

To buy 1 ETH from the pool, the pool's price for ETH has now changed to $111. As a result, the ratio of ETH to USDT changed.

But $111 is not the real price. The price of ETH on Binance might still be $100, and you can take advantage of that. You can buy ETH from Binance and sell it on the Uniswap pool.

x*y=k

You keep moving up and down this curve. The more liquidity in the pool, the smaller the price impact will be if someone buys/sells a quantity.

10 * 1000 = 10000by buying 1 ETH, your impact on the price will be 10%
but if there's more tokens in the pool
10000*100000 = k
K is much larger
This would have an impact of less than 1% of the price

This may remind you of the order book depth. The more liquid the order book is, the less impact.

Increased liquidity reduces price slippage.

Liquidity providers stay incentivized to provide liquidity due to the 3% fee others pay for swapping assets.

Why does Impermanent Loss occur?

There’s a lot of talk about impermanent loss and confusion. Impermanent loss is essentially an opportunity cost of being a liquidity provider.

It all comes down to holding an asset vs. providing liquidity.

Opportunity cost: You could have made more money by simply holding your tokens instead of providing liquidity to the pool, which allows you to only profit from trading fees.

Impernament loss: The liquidity provider has to provide both assets in a balanced ratio, but one of the two assets is more volatile than the other.

As an example, we provide liquidity to an ETH/USDT pool, and you provide $500 worth of ETH and $500 worth of USDT, which is in total $1000.

The price of ETH is $500, and you provided 1 ETH.

If the price of ETH jumps to $1000, the ratio must be balanced, so part of your ETH will be sold for USDT to keep the pool balanced. Thus, you would expect the rebalance to be $750 worth of ETH and $750 worth of USDT, with both tokens combined having a $1500 value.

But no, you will have $500 of ETH and $500 of USDT with a combined value worth of $1000 instead of $1500. Since the price of Ethereum went up, and your Ethereum has sold to USDT, the total ETH you own is 0.5 ETH instead of 1 ETH.

You may wonder why your $500 extra or 0.5 ETH disappeared from the table. Well, this is what we call impermanent loss. Your ETH went to arbitrageurs.

On Uniswap, traders pay a 0.3% fee, which adds to the liquidity pool. Since no new liquidity tokens are minted, this has the effect of splitting the transaction fee proportionally between all existing liquidity providers. Liquidity providers receive fees from all trades, but trades are guaranteed to occur when the price on the broader market changes. If the price changes on another exchange, an arbitrage opportunity is created by the price differential between that exchange and Uniswap. When an arbitrageur executes the profitable trade that brings the Uniswap exchange back into line with the broader market, liquidity providers benefit from Uniswap exchange fees. Sure enough, on all Uniswap exchanges with significant liquidity, arbitrageurs are hard at work such that prices track closely with the rest of the market.

When you provide liquidity, your mindset should be different compared to trading. When you provide liquidity, you should think you’ve provided $1000 worth of tokens and not ETH. By providing liquidity, you earn by the trading fees 0.3% in LP tokens.

By doing what we did, we locked in the price of ETH. If the price of ETH would drop back to $500, our impermanent loss disappears. However, if we withdraw our tokens from the pool when ETH is still $1000, we would “realize” our missed opportunity to hold our tokens instead of providing liquidity, and our loss becomes permanent.

https://twitter.com/Fiskantes/status/1314524664484503555

Impermanent loss calculations

A good article has been written about the impermanent loss https://medium.com/@pintail/uniswap-a-good-deal-for-liquidity-providers-104c0b6816f2.

But let’s go over it together and break down every calculation together and keep it simple and less confusing.

The product of the two quantities in the pool is the same as it was before the trade. Imagine we will be a liquidity provider, and we supply 1 ETH and 100 USDT as liquidity to Uniswap, giving us 1% of the liquidity pool, which contains 100 ETH and 10000 USDT.

The price of 1 ETH is 100 USDT.

Constant Product Market Makerx * y = kx is token x quantity 
y is token y quantity
k = constant

Calculation.

x * y = k
100 * 10000 = 1000000
k = 1000000
x as Ethereum tokens
y as USDT tokens

To make it more readable, instead of using x, y, and k. Let’s use names instead.

ETH_pool * USDT_pool = constant

Below is the formula for trades that have little price impact.

ETH_price = ETH_pool / USDT_pool
ETH_price = 10000 / 100
ETH_price = 100
With this formula we calculated back the ETH price on uniswap by only knowing the 2 different assets in the pool (ETH and USDT)

Combining the two equations, we can figure out the size of each liquidity pool at any given price.

ETH_pool = sqrt(constant_product / eth_price)
USDT_pool = sqrt(constant_product * eth_price)
ETH_pool = sqrt(1000000 / 100)
ETH_pool = 100
USDT_pool = sqrt(1000000 * 100)
USDT_pool = 10000

Imagine the price changed, and 1 ETH is now worth 120 USDT.

The new value of our stake as a liquidity provider. Plugging the numbers into the formula above:

ETH_pool = sqrt(constant_product / eth_price)
ETH_pool = sqrt(1000000 / 120)
ETH_pool = 91.2870929175
USDT_pool = sqrt(constant_product * ETH_price)
USDT_pool = sqrt(1000000 * 120)
USDT_pool = 10954.4511501

Since we are the liquidity provider but only provided 1% as total liquidity, we can remove our liquidity from the pool and claim 0.9129 ETH and 109.54 USDT from the liquidity pool.

The total value of our ETH with the new price of $120 is

0.9129 * 120 = 109.548

109.548 dollar worth of ETH, and our 109.54 worth of USDT combined is 219.088 or $219.09 to round it up.

At the new price of ethereum, our liquidity is worth 219.09 USDT.

What if we just held onto their original 1 ETH and 100 USDT? Well, now we can easily see that, at the new price, the total value would be

1 ETH which is $120 and our orginal $100 in USDT is $220

As a liquidity provider “lost” out on 0.91 USDT by providing liquidity, we were better off by just holding our assets. However, keep in mind that you also have to pay transaction fees for adding and removing liquidity.

How to avoid rug pulls

If you have been trading on Uniswap or have been reading about it on Twitter, Reddit, or 4chan, then you may have heard about rug pulls on Uniswap. However, rug pulls is not a new term specifically used DeFi/Uniswap.

It’s a tactic used by large institutions, market makers, and quant/algorithmic traders with the bankroll to affect price in the market. For example, if you have access to the level 3 order book, you can see all the limited orders waiting to be filled at every price point.

You may have seen large orders waiting to be filled at a specific limit price. Many traders will see them as support and resistance, but sometimes these massive orders will be pulled from the order book, and the price will rise or fall rapidly with momentum. A good example of trading crypto and checking order book changes but visualized is using Tradinglite.

Rug pulled
Effect of the rug pull

And you can see if limit orders are getting removed or added in real-time on the right side.

Show delta

If you don’t have a Tradinglite account, I’d recommend you create an account while it’s still in early access, and you can try free beta access with this link https://tradinglite.com/bonus/cm9tYW5vcm5y.

Now on Uniswap, it’s something like that but a bit different.

Many Uniswap traders are degenerate gamblers, and in a bull trend like august 2020, they tend to buy any new token with a funny name or somewhat of an idea in which they believe or don’t believe all but are betting others will do. It will create hype and pump the price. Scammers can launch a token with some copy-paste code.

They have to provide liquidity, so they put in some ETH and their own created token. When people are buying, and the price goes up, others may start to provide liquidity too. The scammer can sell the way up, and in the end, sell everything and remove their liquidity from the pool. Some scammers try to sneak in a mint function, assuming most people won’t check or have the ability to read code. With this mint function, they can create more tokens out of thin air and sell it.

Another tactic might be providing a high APY, and people will have to lock in their tokens into the pool. After more and more people add liquidity, they can dump their tokens. If you see high APYs, it might be too good to be true since scammers might attempt to make you provide liquidity/farm or buy. Usually, those farming schemings projects are terrible for actually buying since there’s constant sell pressure.

An example of a project is Sushiswap, which got listed on FTX. A great strategy was to short futures contracts since there was constant sell pressure. (If you’re new to trading cryptocurrency, you can make money if the price goes down).

Another incentive to short governance tokens like the Sushi token is to hedge if you hold some and still maintain your governance control.

FTX Suhi perpetual swap

I don’t even think they won’t rug pull because they probably haven’t made much money. Some even pull the rug for $500.

Here’s a video about rug pulls by this guy under the username “Ledger Status”: https://youtu.be/bcb312vnUs4

There are even rug pulls where they list a token, and the smart contract code is modified in a way that you can’t sell on Uniswap.

High IQ Rug Pull Mechanics

Rug pulls can happen within a day after Uniswap listing. Sometimes in a few hours, the rug is pulled. Scammers do it sometimes happen and chose not to wait for more people to fall for the scam because there’s a risk that the community will find out that it’s a scam.

Profit from Uniswap by investing or shorting UNI Token

In September 2020, Uniswap announced its own token UNI. SushiSwap’s decision to migrate funds from Uniswap through a “vampire mining” attack (migration of liquidity from Uniswap to Sushiswap) most likely led to Uniswap's decision to announce their UNI token.

UNI token's notable thing was the distribution because 400 UNI tokens were distributed to each ETH address used Uniswap before September first. Liquidity providers even received extra tokens. Those free 400 UNI tokens were worth $1200, and on September nineteenth, the price of each UNI token received went up to $8, with the total value of 400 UNI tokens being around $3200. Due to this distribution, it became the most widely distributed tokens ever.

One billion UNI tokens were distributed in the following way.

0.069% to advisors with 4 years vesting
17.80% to investors with 4 years vesting
21.51% to team members with 4 years veting
60% to community members

After four years, there will be continuous inflation of 2% at the expense of passive holders to make sure advisors, team members, and investors continue supporting Uniswap.

4 years release schedule
+10 years UNI inflation

Four liquidity pools (ETH-USDT, ETH-DAI, ETH-WBTC, and ETH-USDC) were chosen, and Uniswap will reward liquidity providers with extra UNI tokens. This attracted millions more worth of liquidity since these liquidity providers remain incentivized.

By buying UNI tokens on Binance, you’re betting on the success and hype of this automated 3D FOMO-based Ponzi scheme pricing mechanism and the governance token from an online casino exists of a set of smart contracts. Also, at the time of writing, Uniswap v3 has not been released, but the founder of Uniswap claimed.

“2021: Uniswap V3 will face slippage and capital efficiency head on to prove AMMs can outcompete traditional exchanges on all fronts.”

Now, if you’re bullish on the idea of how a millennial made the world’s biggest decentralized casino for degenerated millennials, which will destroy the traditional financial system, then you could buy UNI as speculation but keep in mind the token economics.

You can buy UNI tokens on Binance.

20% discount if you sign up: https://www.binance.com/en/register?ref=SUL1QNJK

UNI chart.

If you believe it will outperform centralized cryptocurrency exchange tokens, you can check UNI's strength against BNB, for example.

UNI/BNB

If you believe UNI/BNB will bounce off the fucking moon, you can go to FTX, create a sub-account, and short BNB while also going long on UNI. Make sure the size is the same. However, you can choose perpetual contracts or futures with an expiration date to avoid funding. Go into perp if the funding is on your side. That’s even better.

You can trade BNB, FTT, and UNI with leverage on FTX. Use this referral link to receive a 10% discount instead of the usual 5% discount.

I have 2 other articles written about FTX, which may interest you if you’re a trader.

How to make money out of Uniswap markets with FTX Uniswap Perpetual swap Index

FTX has Uniswap perpetual futures that exist out of the top liquidity pools of Uniswap. The futures contract is UNISWAP-PERP, not to confuse with UNIPERP (which is uni token).

UNSWAP-PERP is an index future that is equal-weighted on the top Uniswap pools.

“The Uniswap index price is the sum of the implied asset price of each of the pools” — Sam Bankman-Fried.

With UNISWAP-PERP, we can obtain exposure to Uniswap listed tokens without actually going to Uniswap and buying tokens, which can potentially be a rug pull.

You can profit from Uniswap listed tokens via the futures contract. https://help.ftx.com/hc/en-us/articles/360048135772-Uniswap-Index

This is a decent approach to get some exposure to the DeFi markets on Uniswap, but we can limit our loss by using a stop loss. Now we know our risk, we can adjust our size.

Now we can cash in on the potential success.

On the other hand, imagine you’re overexposed to DeFi markets, then you can short UNI-PERP on FTX as a hedge to limit your risk.

If you don’t have an FTX account, you can use this referral link and receive a 10% discount on your trading fees instead of a 5% discount you get from others:

Uniswap Conclusion

When buying tokens on Uniswap, you have to assume that it will go to zero. Everything can dump easily and quickly to zero. Most projects probably won’t have a longer life span than a year. There’s no option for market stop orders, so your size should be adjusted accordingly. Ask yourself if it’s within your risk tolerance. There’s no order book, and your edge you have in centralized markets with an order book is gone. No level 2 order book where you can track bids and sells being added or pulled etc. to get an idea if the order flow is positive or not. Orderbook imbalances etc. Don’t forget the fee you have to pay fees, which is 30 basis points, and you have to cross the spread.

The end is nowhere insight, and the projects are unpredictable. If continuously ape in these projects without research or go all in, might as well bet it all on red: Uniswap, high risk, high returns. More and more millennials get interested in buying tokens on Uniswap. Don’t put your rent money or life savings into risk full projects on Uniswap. Assess your personal risk tolerance, learn slow investment strategies. There’s no stop loss on Uniswap or liquidity on smaller pools.

You may have heard about being an ape and ape into projects. Remember that every project can go to 0, and don’t let social media cloud your decision-making. If you put enough poo-slinging apes in a room and let them buy random tokens in an uptrend, yes, most will get rich, but most will lose money over a longer period of time.

Even if a project may sound like the future, it’s not a promise that it will work out. I remember somewhere between 2015–2016, there was this project called “Firstblood,” and I wanted to buy the ICO and ask someone if it was a good buy. It really looked great, but he asked me if I really think that the whole gaming industry will move onto that. Most never touched bitcoin, let alone ethereum. Do you really expect them to buy an ethereum token?

It’s now 2020, and still no mainstream adoption. At some point, there’s no greater fool willing to buy that food token with a funny name. On the other hand, the price might go 50x before there’s no more buying interest. You have to go with the odds/probability and adjust your size. You will definitely lose a few times.

Also, bless finematics videos and work.

If you’ve skimmed this, GFY.

Follow me on Twitter: https://twitter.com/RNR_0.

More medium articles?

If you are looking for more medium articles like this written by me, you can find them on my medium profile.

Few of my other trading articles you might be interested in (Do look at my profile since I won’t list them all)

Resources used to write this article

https://uniswap.org/docs/v2/ https://docs.zapper.fi/invest/pooling/uniswap https://finematics.com/uniswap-uni-token-explained/ https://web.stanford.edu/~guillean/papers/uniswap_analysis.pdf https://youtu.be/LpjMgS4OVzs

--

--

Romano RNR

Derivatives trading, investing, cryptocurrency, stocks, forex, options & volatility - programmer & sysadmin