knowing how uniswap v2 and v3 pools work is mega useful and not gonna lie if youre in crypto playing onchain and cant explain them yourself — wtf — keep reading
im writing this explanation for my buddy who sorta knows crypto but doesnt know enough. i tried finding a guide online but these guys writing those articles have a hard time breaking it down to the juicy stuff. theyll yap about tick pricing or mathematics but nobody gives a shit; people just wanna trade better. hopefully this super beginner friendly and you can send it normies so they ape our coins
im currently sitting on a plane without internet so this is off the dome but ive known this long enough i could teach it to a newborn. you might wanna fact check any numbers but the logic will all be there
quick order of what ill discuss: traditional orderbooks, AMMs, v3, v2
traditional orderbooks:
so you know when you buy a stock, or you buy bitcoin, who is selling it to you? is there someone else sitting at their computer at the exact same time as you? well, not exactly. maybe there is someone who placed an order 5 seconds just before you. or maybe even 1 minute before. typically its closer to 100ms. anyways, to make this exchange happen instantly for both people, we have a special type of middleman, a “market maker”. they more or less take your buy order and find someone who is also willing to sell. and obviously they sell for a little more than they buy, so this is how they profit
of course, this “market making” isnt manual, they have complex scripts running to “market make” super fast. in fact, “market making” is a whole industry. Jane Street, a trading company that “market makes”, did $8b in PROFITS in 2021. dont get any big ideas though — you dont have the IQ to participate, so keep reading and learn to shitcoin with the rest of us
AMMs:
AMMs are a crypto thing, only found onchain (not found on any central exchanges). they basically remove the role of the middleman, the “market maker”. in fact AMM stands for Automated Market Maker
instead of having another person hold funds as the middle man, it is a smart contract. thats the core of it. theres heaps of advantages (and disadvantages) to having it this way. one big advantage is that because there is no middle man, its online 24/7, and you can trade things that no middleman would ever dream of trading because the thing is named something dumb like $StarlinkCockGPTInuJohnCena888
Uniswap runs on the premise of AMMs. v2 and v3 are both models of AMMs — they vary in how they work but they are both AMMs. v3 was made as an improved version of v2. v1 exists too but no one uses it. v4 also exists but idk if its live yet
now for these AMMs to work as an automatic middleman, they need to hold some funds, because if you wanted to sell $StarlinkCockGPTInuJohnCena888, you want to receive money in return at the exact time you sell. so someone has to put money in. these people are called “Liquidity Providers”, and they take a small fee for each trade that happens
to clarify on what i mean by “it is the smart contract that holds funds”, this is what i mean. the smart contract is called the “pool”. people swap one token for another in the pool. so the pool holds two types of tokens. for example, it could hold StarlinkCockGPTInuJohnCena888 and WETH. this pool would be referred to as StarlinkCockGPTInuJohnCena888/WETH
v3:
the difference between v2 and v3 lies in the way that the Liquidity Providers add their funds. this is the essence of this whole explanation so pay attention NOW, i can feel your zoomer brain getting distracted already
this is how v3 works: if you want to add funds, you can do so in a price range. lets say you wanted to liquidity provide for StarlinkCockGPTInuJohnCena888/WETH, but you only wanted to provide funds for prices between $5 and $10. you can do that.
sidenote: if by now you still didnt get what StarlinkCockGPTInuJohnCena888/WETH is, it means that if you want to buy StarlinkCockGPTInuJohnCena888 you need to buy with WETH and if you sell StarlinkCockGPTInuJohnCena888 you receive WETH
this makes more sense when you consider pools like USDC/USDT, which in theory should always be at $1, so youd liquidity provide betwen $0.99 and $1.01. if it falls outside of 0.99–1.01, then you dont receive fees for people trading. moreover, your capital is bunched up more in a smaller range, so your contribution to the pool is more, so you receive more fees $$
you can provide in multiple ranges too. with weird ranges, you can create weird trading behaviour. if people only liquidity provided in ranges $5–6 and $9–10 for StarlinkCockGPTInuJohnCena888, then the price could only exist in those ranges. itd jump straight from $6 to $9, no inbetween, it wouldnt go higher than $10 and wouldnt go less than $5
v2:
v2 is far inferior because you *cant* liquidity provide in ranges. you just have to throw money in the whole entire range, from $0 to $infinity.
this greatly reduces capital efficiency. for a StarlinkCockGPTInuJohnCena888/WETH pool, you would have to provide WETH and StarlinkCockGPTInuJohnCena888 for ALL prices
another point is that with v3 there is a quirk — you can choose to provide only one of StarlinkCockGPTInuJohnCena888 and WETH in the StarlinkCockGPTInuJohnCena888/WETH pool. for example, if the price of StarlinkCockGPTInuJohnCena888 is $5, but you only want to provide in the $9–10 range, you would only need to provide StarlinkCockGPTInuJohnCena888. because well uh i cbf to explain just think about it please
v3 examples
here is how funds would in practice be spread for the USDC/USDT pool. “amount” is the amount of funds put in by the liquidity providers
here is how the provided funds the for StarlinkCockGPTInuJohnCena888 $5–6/$9–10 example would be spread
trading
so how do you trade this? well firstly, in the hypothetical StarlinkCockGPTInuJohnCena888 scenario, you buying at $5.99 will jump the price to $9, so maybe buying there isnt a bad idea
a more practical scenario is paying attention to how shitcoin teams setup their pools. for example, in the picture below, price will move faster when it is in the range to the right, because there is not so much liquidity. so keep this in mind
a more broader application is: a good indication of the capabilities of a team is how they manage pools. if people are complaining about pool structure and whatnot, its probably an inexperienced team
nb: being a liquidity provider isnt free money, in fact, historically, it is a losing trade. look into “impermanent loss”. maybe ill write an easy explainer on that too. most explanations fail to not overcomplicate their explanations
so anyways thats pre much it, lmk if you had any questions, i dumbed it down a shit ton
but yeah,
retardio.