My Authors
Read all threads
Team's thoughts on Uniswap V2.

Summary: V2 is a very different product to V1, and will likely continue to co-exist as liquidity pool protocols. V1 is a hedge to some of V2's concessions. V2 fixes some of V1's issues.

Whitepaper:
uniswap.org/whitepaper.pdf
Firstly the team are massive fans of V1. Governance-minimal, no platform fees, well-executed launch and growth.

The team were at DevCon 4 in Croatia Oct/Nov 2018 when it was unveiled and were Day 0 Uniswap liquidity providers.
The team had been working on the CLP algorithm months prior (inspired by Bancor's reserve formula) and were pleasantly surprised to see how similar the two ideas were.

(CLP does not have an explicit invariant "k" value, instead it re-arranges to have output == input.)
On to Uniswap V2.
Pairs: V2 has no notion of a "settlement asset", instead letting users choose how to pair tokens. This may dilute liquidity and bifurcate the topology but routing "can be handled at a higher layer (either off-chain or through an on-chain router or aggregator)"
Likely USDC or USDT will emerge to become the main "hub" as pools establish a linked graph. Whether this creates systemic issues for V2 is not yet known.

USDC has already shown DeFi dominance, but V2 can now handle USDT, so USDT may be given a shot at the title.
Price Manipulation:

V1 is easy to "sandwich attack" or price-manipulate (due to fixed-rate fees and price being the spot price).

V2 adds a clever "time-weighted price average" mechanism that inserts a rolling sum of price*time. Price can be extracted by dividing out time.
Uniswap team brilliantly optimised to prevent chain bloat by changing price from a uint256 to a uint224, in order to store a 112.112 floating point number. The spare 32 bits (256-224) is then used to store the accumulated time value.

Note: This time will overflow on 02/07/2106
V1 could not handle deflationary tokens (hence @defswap ) so the contract's balance to slowly decouple from reality over time.

V2 now comes with a skim() function that anyone can call to re-calibrate balances. So V2 = Uniswap V1 + DefSwap in this regard.
V1 enforced that liquidity providers honour the existing price when providing liquidity. This means the contract had an opinion on price.

V2 now lets providers "asymmetrically stake", similar to THORChain, by instead calculating the geometric mean of both inputs.
V1 used Ether as the base asset.

V2 *has no support for native ether* instead requiring users to deposit wrapped-Ether.

This may or not be a big deal. If it is, it is the single biggest difference from V1 to V2 and may see V1 continue to be used for this reason.
V1 created a new exchange for each token on the fly. Users queried the registry first to find the exchange.

V2 uses CREATE2 to deterministically create exchanges so all token exchange addresses can now be determined without needing to query a registry.
V1 used Vyper (after Vitalik asked Hayden to consider it). It is a flagship vyper product.

V2 goes back to solidity in order to pull off some of the features explained above.
V1 logically centralises all exchange architecture in a single contract. It cannot be updraged.

V2 separates exchange logic with reserve logic and uses a router to forward funds. This enables the exchange logic to be "upgraded" over time, but adds questionable centralisation.
On to Flash Swaps. Flash Swaps is like giving every toddler at a kids party an AK47 and waiting to see who is the last one alive.

Flash Swaps were added to ostensibly allow defi'ers to arbitrage faster, but historically have only been used to cause chaos.
Allowing someone access to as much capital as they want breaks a lot of security models used in other protocols where it is assumed "capital has a cost". Every protocol has a non-zero amount of bugs and vulnerabilities.

Flash swaps allow brute forcing of these bugs.
Whether it will make DeFi safer over time, or will it cause more black swans is to be seen.

Allowing Uniswap pooled liquidity to be used for flash swaps could be brilliant. Right now it seems dumb. Liquidity Providers provide liquidity, not enabling defi'ers to wreck havoc.
Lastly, the protocol fee. It is hard to understand that V2 could ever be sticky enough to let LPs stomach a 17% fee. Anyone can fork V2 to remove the fee and DEX aggregators would add these new pools regardless. To be seen.
That's V1 v V2.
It's not an "upgrade". It's step ahead, but in a different direction.
V1 will not only co-exist, but will be a hedge against V2 ever being co-opted, threatened by a "hub" token being censored (USDC), centralisation of management, or rejection of the fee. /end
Missing some Tweet in this thread? You can try to force a refresh.

Enjoying this thread?

Keep Current with THORChain ⚡️(ᚱ)

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!