Questions tagged [uniswap]

Uniswap is a decentralized finance protocol that is used to exchange cryptocurrencies.

1163 questions
8
votes
3 answers

How to get Uniswap liquidity pool addresses?

I need Uniswap liquidity pool addresses to develop my project. Can anyone tell me how to get the full list of these addresses?
notooth
  • 93
  • 1
  • 1
  • 4
7
votes
3 answers

Uniswap transaction fails with TransferHelper: TRANSFER_FROM_FAILED

I am trying to send a transaction using the Etherscan write contract tool at the following address: https://kovan.etherscan.io/address/0x7a250d5630b4cf539739df2c5dacb4c659f2488d#writeContract The method I wish to use is: swapExactTokensForToken And…
Timothée HENRY
  • 467
  • 2
  • 5
  • 11
7
votes
4 answers

Detect if destination is a Uniswap V3 Pool

Is there a way for a contract to check a destination address to see if it's a Uniswap V3 pool?
Rob Hitchens
  • 55,151
  • 11
  • 89
  • 145
6
votes
1 answer

How do I claim my earned Liquidity Provider fees?

I provided some tokens in a Liquidity Pool for some time, and now Uniswap says I accumulated about 130$ worth of ETH and PRQ on the provider fees. How do I claim these 0.113 WETH and 111 PRQ? There don't seem to be any corresponding button in…
Klesun
  • 218
  • 2
  • 10
6
votes
2 answers

Uniswap v2 whitepaper: how is formula for "total fees computed since last time fees were collected" derived?

This above screenshot come from uniswap v2 white paper page5 , how is this equation derived ? (To make the question more searchable, here is the quote in text form) The total collected fees can be computed by measuring the growth in square root of…
Jiaming Li
  • 522
  • 2
  • 10
5
votes
1 answer

@uniswap SDK -- how do I figure out the best route for a SWAP? How do do multihop with SDK?

I'm calling UNISWAP SDK to price a trade on pair like USDC, PAX and getting significantly worse results than the UX: const sourceToken = new Token(ChainId.MAINNET, source_token_address, source_token_decimals); const sourceAmount = new…
nxstock-trader
  • 271
  • 1
  • 3
  • 8
4
votes
1 answer

Why is my @uniswap/sdk DAI/USDT price impact at 100 and returning incorrect prices?

Following the documentation here: https://uniswap.org/docs/v2/javascript-SDK/pricing/ I have been able to replicate the results using WETH, and I have decided to have a go at getting a similar result with DAI and USDT. const { ChainId, Fetcher,…
Eric
  • 395
  • 3
  • 11
4
votes
2 answers

Calculation of swap amount needed for adding liquidity to Uniswap V2

I'm trying to create a helper in a contract that lets the user deposit a single token and have it internally swap to the other token and add it as liquidity. Lets say there is an LP with ETH and BTC and a user supplies only ETH, then how much of…
roelio
  • 141
  • 2
3
votes
0 answers

What is the deposit amount when creating liquidity pool?

I am trying to create a test liquidity pool using mock token on Uniswap. I've been trying to find out how is this deposit amount calculated and what does it exactly mean? Doesn't matter what is the starting price or price ranges, whatever I do this…
3
votes
1 answer

How is Uniswap Liquidity added?

I bet this is a simple answer, but I'm just unable to fully understand. Uniswap has liquidity. It can be added. But what function does it uses? the Transfer() one from the contract? I'm trying to find a way to track if someone adds liquidity to the…
Astr153
  • 51
  • 2
3
votes
0 answers

Is this diagram from Uniswap's documentation correct?

Denote respectively rA and rB the reserve of Token A and Token B. Let f = 1 - fee (i.e. 0.997) and x be the input amount. Then the price function of Uniswap v2 for a pair (A, B) is P(x) = (rB * x * f)/(rA + x * f) This answer explains well how the…
3
votes
1 answer

How to understand the Uniswap V3 swap fee calculation

i read the whitepaper and the code about uniswapv3. but i am still confused about uni-v3 swap fee calculation. i can‘t understand 3 formula qustion1 cant understand Tick struct field feeGrowthOutside(0/1)X128 struct Info { …
li kai
  • 31
  • 1
2
votes
1 answer

Question about the best Uniswap path

How the best path is calculated ? Is it a fonction in the smart contract or on the website ? Because I checked the function swapExactETHForTokens and the path need to be set by the function caller. function swapExactETHForTokens(uint amountOutMin,…
Kioup
  • 125
  • 3
  • 10
2
votes
0 answers

Uniswap v3 liquidity

Now that uniswap and pancakeswap are migrated to the new v3 core system, do I need to change my liquidity code somehow? Right now I have this code with the old v2 routers, factory and pair codes to add liquidity to pancakeswap. But if I'm correct…
2
votes
1 answer

How does uniswap process so many transactions on the clogged ethereum network?

According to info.uniswap.org, the number of uniswap transactions in the last 24 hours was 136,383. This amounts to approximately 136383 / 24 / 60 / 4 = 24 transactions per block. It appears that with basic ether transactions, you'd be able to…
David Callanan
  • 792
  • 6
  • 20
1
2 3 4 5