Skip to main content
Share Your Experience: Take the 2024 Developer Survey
7 votes

Why MINIMUM_LIQUIDITY is used in DEX like Uniswap?

Generally, a V2 pool stores tokens and issues shares to the liquidity provider - it's in a sense a vault. Vaults are vulnerable to the share inflation attack, described in detail here. Requiring that ...
kfx's user avatar
  • 1,630
6 votes
Accepted

Are Uniswap tokens LP tokens?

LP Token is just one name for the tokens you get, when you provide liquidity to a pool/pair, they may have other names, depending on where you read about them. Uniswap tokens are something different, ...
jjj's user avatar
  • 390
5 votes
Accepted

Why concentrated liquidity is capital efficient?

Concentrated liquidity is more capital efficient because with increased concentration, the same amount of tokens invested creates greater depth of liquidity. From Uniswap's blog: By concentrating ...
kfx's user avatar
  • 1,630
4 votes
Accepted

Incorrect Uniswap Liquidity Calculations. What could be wrong?

There is no bug. This address holds exactly 0 liquidity token for the wOxen-USDT pair. Accordingly, Uniswap info shows 0$ as liquidity provided. How come, you may ask, since $30K+ were provided as ...
Undead8's user avatar
  • 3,610
4 votes

Calculating price impact on Uniswap V3

It is not possible to have a single mathematical formula as a swap Uniswap v3 may cross tick range boundaries. Each tick range may have different liquidity and needs to be considered separately. The ...
kfx's user avatar
  • 1,630
4 votes

Why concentrated liquidity is capital efficient?

how come range is important. Because of price impact. As a market taker (trader) you want to get the most amount of tokens for the amount of your money you put in the trade (quote token, fiat). ...
Mikko Ohtamaa's user avatar
3 votes
Accepted

In DEFI does each token-pair produce its own LP token?

Uniswap is an automated liquidity protocol powered by a constant product formula and implemented in a system of non-upgradeable smart contracts on the Ethereum blockchain. [...] Each Uniswap smart ...
Diego Ferri's user avatar
3 votes
Accepted

An unlocked wallet is holding 100% of <PAIR> LP

It means the owner can rug pull(remove liquidity, steal everyone's investment, and make the token valueless) any time. That is why that prompt exists. Locks are commonly done on DxSale and Poocoin ...
bru53001's user avatar
  • 721
3 votes
Accepted

Uniswap V3: Create LP (ETH-ERC20 pair) using solidity

I'm assuming you refer to the official Uniswap V3 example here : https://docs.uniswap.org/sdk/guides/liquidity/adding and that your pool is initialized Short answer: Uniswap handles the (un)wrapping. ...
DrGorilla.eth's user avatar
3 votes

Why MINIMUM_LIQUIDITY is used in DEX like Uniswap?

I am adding to the answer provided by @kfx with an example: In the absence of preset burning, an attacker initializes a pool with 10e-18 weth and 10e-18 dai. This would mint 1LP token which also ...
Maanas O T's user avatar
3 votes

Why concentrated liquidity is capital efficient?

The concentrated liquidity is capital efficient because it allows LPs to optimize their capital utilization by concentrating their liquidity within a specific price range. Earlier versions of AMMs ...
Naveed Ali's user avatar
3 votes

How to get the value of a position on Uniswap V3 NFT?

I wrote a function that perform a static call passing the maximum collectable value in other to see how much is pending to be collected. export const calculatePendingFees = async ( tokenId: number, ...
Rodrigo Burgos's user avatar
2 votes

Fees distributed to token holders at point of sale

An idea is to have an external balance and an internal one, at the beginning the relation will be 1:1. Burned fees will change the relationship increasing holders balance slightly. Lets's suppose the ...
Ismael's user avatar
  • 30.5k
2 votes
Accepted

How much UNI can I earn if I become a liquidity provider?

You can only addequal USD value pair to a pool, let's see 1000 USDC/2.6 ETh (Eth price 384), the daily return is about 1.8% at the moment, based on the pool size of 25m for this pool, with daily ...
Jeffrey Lee's user avatar
2 votes
Accepted

How Do Liquidity Pool Economics Work?

As explained in the r/1inch post here, in my example from Step 5 above, as the staked liquidity approaches $1.5B, the APY would decrease due to the increased supply, assuming the trade volume remains ...
AdamHurwitz's user avatar
2 votes

Solidity - Is this the correct way to add liquidity to uniswap with exact amount at current price?

Well i'm not super familiar with UniswapV2 contracts, so this is just my 2 cents but it seems that router02 calculates that price and checks if it matches what you entered (uint amountBOptimal = ...
Foxxxey's user avatar
  • 4,327
2 votes

"Price Impact Too High" swapping tokens back to ETH on basic contract with liquidity (Uniswap)

I contacted Uniswap support on Discord, and they said it's a known issue on testnets due to them using "fake dollar prices", and it can be worked around by enabling Expert Mode, which I did, ...
Neo's user avatar
  • 158
2 votes

Failing to add liquidity to pancakeswap on bsc testnet

Yes, I believe this problem is due to the deadline parameter of the addLiquidity method. In your tx you have submitted a deadline of 7741799 which corresponds (https://www.epochconverter.com/) to ...
lobis's user avatar
  • 145
2 votes

An unlocked wallet is holding 100% of <PAIR> LP

If it says: An unlocked wallet is holding 100% of the lp. This means that the owner of the token can at any time get his liquidity and devalue the token. Therefore, you need to block liquidity, for ...
Artem's user avatar
  • 41
2 votes

Trying to make sense of Uniswap v3 fees (feeGrowthInside0LastX128, feeGrowthGlobal0X128)

For those looking for a worked out example. Run this query on thegraph.com: { positions(where: {id:"YOURPOOLIDHERE"}) { liquidity token0 {symbol decimals} pool {...
user81317's user avatar
2 votes

Trying to make sense of Uniswap v3 fees (feeGrowthInside0LastX128, feeGrowthGlobal0X128)

There is a bunch of functions on the smart contract that explains how to use the liquidity field: In Uniswap V3 core repository, in Position.sol line 60: // calculate accumulated fees uint128 ...
Duduche's user avatar
  • 121
2 votes
Accepted

How to determine if some LP tokens related to my token or not?

When you provide liquidity to a pool you will receive LP tokens for that specific pool (with a contract address unique to that pair). You can check the contract address for your tokens LP token and ...
Bigbrotha's user avatar
  • 771
2 votes
Accepted

uniswap constant formula seems confusing

Yes, it's an issue of liquidity. You can say that 5 ETH is a good starting point, but it's relative: in your example you're swapping 2 ETH - which is almost half the pool. So there is significant ...
Kenzo Agada's user avatar
  • 1,226
2 votes

Liquidity locking and ETH loose

Locking up your liquidity tokens doesn't do anything except preventing you from exchanging your LP tokens back to the tokens from the pool. Whiteboard crypto on Youtube has a nice video about how ...
Helza's user avatar
  • 31
2 votes

Why MINIMUM_LIQUIDITY is used in DEX like Uniswap?

0x1. Problem When users decide to become a liquidity provider, they should deposit paired tokens in proportion to the exchange rate, that is: Imagining an attacker who holds large sums of money wants ...
Sayoko's user avatar
  • 29
2 votes

An unlocked wallet is holding 100% of the lp

To remove this inscription, you need to lock your liquidity of the token, for this you can use, for example, openlock.io (I blocked it myself), or another contract.
Artem's user avatar
  • 41
2 votes
Accepted

Uniswap v3: what determines the if a tick is initialized?

A tick is initialized (i.e. active) if it's an endpoint of a position deployed in the pool. Only ticks that are divisible by the pool's tick spacing can be initialized. For instance, the in 0.3% pool ...
kfx's user avatar
  • 1,630
2 votes
Accepted

Liquidity provisioning with yield-bearing tokens

There are at least two types of yield-bearing tokens: rebasing tokens - they increase in number over time, e.g. stETH reward-bearing tokens - they increase in value relative to the base asset over ...
kfx's user avatar
  • 1,630
1 vote
Accepted

calculating the daily rewards for liquidity provider in Uniswap

Is this regarding V3 or V2? In either, LP rewards do not accrue directly to a LP token holder. In V2 they are reinvested into the pool, and in V3 they are collected separately and must be redeemed by ...
Connor Martin's user avatar
1 vote

Way to tackle arbitrage bots

Ok, here's what's happening: I'm almost sure there exists another exchange with a lower price for the pair, otherwise the arbitrage opportunity wouldn't exist. The pair creation tx was enough to ...
Ahmed Ihsan Tawfeeq's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible