Questions tagged [uniswapv3]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
26 views

How to buy with ethers js using Uniswap Universal router on Base? calling execute function

I want to buy new tokens launched on base using Uniswap Universal router on Base with node js and ether js libraries. Im calling execute function but I'm having many problems. Here is the code: //...
Oriok's user avatar
  • 11
1 vote
1 answer
28 views

Why Can't I Mint a Full-Range Uniswap V3 Position from MIN_TICK to MAX_TICK?

I've been experimenting with Uniswap V3 and aimed to mint a position covering the full price range possible within a pool, using the MIN_TICK (-887272) and MAX_TICK (887272) as my position's bounds. ...
MShakeG's user avatar
  • 1,593
0 votes
0 answers
13 views

How can Retrieving Pending Transaction Reserves (reserve0 and reserve1) in Uniswap V2?

How can I retrieve the reserve0 and reserve1 values from Uniswap V2, not from already mined blocks, but specifically from transactions that are still pending?
PandaKungFuu's user avatar
0 votes
1 answer
19 views

what am I doing wrong in getting price data from the liq pool?

import requests import json url_v3 = "https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3" pools_query_v3 = """ { pools(orderBy: txCount, orderDirection: desc) { ...
Fadai Mammadov's user avatar
0 votes
0 answers
15 views

How to Calculate Impermanent Loss in Uniswap v3 Pool Given Burn/Mint/Swap/Collect Data

I am trying to compute the total Impermanent Loss by liquidity provider in a given Uniswap v3 Pool given all the Burn/Mint/Collect/Swap events in the pool. Is there a way to do this?
pink341's user avatar
1 vote
0 answers
18 views

Can Position Information for a Burned Uniswap V3 NFT Still Be Retrieved?

Hello StackOverflow community, I'm currently working with Uniswap V3 NFTs and have a question regarding the retrieval of position information for NFTs that have been burned (i.e., sent to the null ...
Moon soon's user avatar
  • 163
1 vote
0 answers
15 views

When opening a Liquidity Position in UniV3, how my capital is distributed for each tick?

Let's say I am opening a liquidity position at ETH/USDC pool. Price is 1000 and let's say its tick is 1000 arbitrarily I am opening a liquidity position with range 950-980 and let's say its tick is ...
user3315463's user avatar
0 votes
0 answers
27 views

Put liquidity on liquidity pool using uniswap-python

I have a trouble at interacting with the uniswap liquidity pool using uniswap-python.this is my code: from web3 import Web3 from uniswap import Uniswap from web3.middleware import geth_poa_middleware ...
mohsen razavi's user avatar
0 votes
0 answers
38 views

How to calculate expected token amount out in a UniswapV3 swap

Accounting for slippage, is there a good way of reading data from a UniswapV3 pair and estimate how many tokens will be received when performing a swap (accounting for slippage)? I couldn't think of a ...
Rudi's user avatar
  • 1
0 votes
0 answers
30 views

Making meme coin on polygon network. Swap failure for no apparent reason

I'm working on developing a meme coin and I'm going through the testing phase to make sure everything works as intended. I am able to deploy the token and provide single sided liquidity to the pool ...
needhelpalways's user avatar
0 votes
1 answer
14 views

Execute functions of external contracts through chainlink automation contracts

I have two contracts. One is a contract that implements chainlink to obtain off-chain data. Part of its code is function requestConfig() public returns (bytes32 id) { Chainlink.Request memory ...
Leo's user avatar
  • 1
0 votes
0 answers
104 views

Setting initial price of token on Uniswap V3 single sided liquidity polygon token

I've been trying to set the initial price of my token for the past two days and I'm still confused. Please go easy on me as this is my first time messing with solidity and smart contracts. I have some ...
needhelpalways's user avatar
0 votes
1 answer
70 views

How to find amount of pooled tokens in Uniswap v3 pool

Given a Uniswap v3 pool: how can I find (using the Uniswap v3 pool contract) the amount of WETH and other coins that are in the pool? I know in Uniswap v2, you can just call the getReserves function. ...
01jayss's user avatar
  • 101
0 votes
1 answer
45 views

How to find Pairs within the uniswap V3 subgraph

I am trying to use the v3 subgraph to locate new pairs that were made and get their age but i cant seem to be able to figure out how to find the pairs. Essentially what i'm trying to do is when i run ...
Cheetohh's user avatar
0 votes
0 answers
8 views

Losing 1 unit of token when adding liquidity to Uniswapv3

Is it normal that 1 unit of token is lost when adding liquidity to Uniswap v3 ? For example, I have been adding USDC 10 to the MATIC/USDC pool on Uniswap v3 (Polygon), below the current price (I chose ...
quentinadam's user avatar
0 votes
2 answers
394 views

How to get Uniswap V3 price range by given tickUpper and tickLower?

For example, there is an add uniswap v3 pool operation The tickerUpper is -115000, the tickLower is -138000 What is the price range?
Moon soon's user avatar
  • 163
0 votes
1 answer
88 views

typeError: Cannot read properties of undefined (reading 'format')

I am getting this error whenever I run my hardhat deploy script for uniswap pool contract : TypeError: Cannot read properties of undefined (reading 'format') at Function.from (/home/abdulaleem/token/...
Abdul Aleem's user avatar
0 votes
0 answers
14 views

What are the fee used for? Who receives the fee for UniswapV3 ExactInputSingleParams

Why do we need the fee? Isn't it specified that Uniswap will charge 0.30%? Why do we need to specify a fee here and to who? Can we set the fee to 0? struct ExactInputSingleParams { address ...
anonauditor's user avatar
0 votes
0 answers
49 views

Uniswap V3 SwapMath.computeSwapStep doesn't give same results as quoterContract.callStatic.quoteExactInputSingle

When I use the @uniswap/v3-sdk SwapMath.computeSwapStep I get a different result from quoterContract.callStatic.quoteExactInputSingle.. it's also off from the result I get from the UI at https://app....
Julia Burlingham's user avatar
0 votes
1 answer
116 views

How to Calculate SqrtPriceX96 for a Specific Percentage Change in Uniswap v3?

I am working with Uniswap v3 and need to calculate the sqrtPriceX96 value that is exactly 5% (or any other percentage) above or below the current pool price. I understand that each tick in Uniswap v3 ...
MShakeG's user avatar
  • 1,593
0 votes
0 answers
77 views

Does anyone know what uniswapRouterAddress and uniswap abi is on Sepolia network?

I am working on react native project, using v6 of ethers.js and infuria as my node. I initiate the contract like this: const uniswapRouterAddress = '0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45'; ...
Scott's user avatar
  • 5
0 votes
1 answer
94 views

quoteExactInputSingle is returning error

I'm working on solidity code that uses pancakeswapV3 quoter contract to call quoteExactInputSingle. Here is the code snippet function AnalyseTnx(address tokenPath0,address tokenPath1,uint256 amtIn)...
Biruk Damte's user avatar
1 vote
0 answers
23 views

How is the new price calculated in the pool based on reserves?

Help me understand how the rate of the second token was known in advance? Pool End Token A: 1200 + 3 + 0.3% = 1203.009 Token B: 400 - ??? = 399.003 How to calculate the Token B ??? == 0.997 at the ...
Roman Skrypin's user avatar
0 votes
1 answer
86 views

getAmountIn equivalent of uniswapV3 or how to calculate it?

I was exploring uniswap V3 router, quoter and factory contracts, but it doesn't have getAmountIn function to calculate the minimum amount I must input to get the desired amount. On some thread, I ...
Biruk Damte's user avatar
0 votes
1 answer
20 views

what will happen when two people execute removeLiquidity in uniswap v2?

According to the code of uniswap-v2/v2-periphery/contracts/UniswapV2Router02.sol in function removeLiquidity(): // **** REMOVE LIQUIDITY **** function removeLiquidity( address tokenA, ...
sy liu's user avatar
  • 1
3 votes
1 answer
307 views

What is the difference between sqrtPriceLimitX96 and amountOutMinimum for uniswap?

The sqrtPriceLimitX96 is just a price limit which cannot be exceeded by the trade. At the same time, the amountOutMinimum appears to do the same thing in that you can achieve maximum price by taking: ...
Nat's user avatar
  • 279
1 vote
2 answers
78 views

How to know base token from the pool

here is quick question. From uniswap pool, which one is base token? token0 or token1?
Biruk Damte's user avatar
0 votes
0 answers
22 views

Uniswap V3 contract: how to detect source and destination coin

I am working to an information parser and stuck with Uniswap V3 smart contract behaviour. first case: Swap 2,093,700 WPLS For 0.1129 ETH https://etherscan.io/tx/...
Oleg Saushkin OcMaRUS's user avatar
1 vote
1 answer
98 views

Need Help Generating LP Contract Addresses using Uniswap V3 SDK

I'm in a bit of a coding jam, and could use some help understanding how to utilize the Uniswap V3 SDK to generate accurate Liquidity Pool Addresses. I have already gone through the uniswap ...
armitus's user avatar
  • 113
0 votes
0 answers
63 views

Swap token directly with UniswapV3 pool

I've researched previous questions, however it does not seems to work out for me, therefore I am asking. I want to swap WETH to USDT on UniswapV3 directly via the pool of both pairs, not through the ...
carlo711's user avatar
  • 101
1 vote
1 answer
334 views

Calculating the price of a token in a Uniswap V3 pool gives different results depending on the pool

Based on the formula on this page i wrote this Solidity contract with a function to get the price of a Token in term of USDC(6 digits) inside a Uniswap V3 pool: // SPDX-License-Identifier: MIT pragma ...
MattC's user avatar
  • 113
1 vote
1 answer
112 views

Uniswap Indexing Problem

I’ve scoured the internet on this issue, and have talked to a number of solidity engineers who have worked with Uniswap pairing code. I’ve put some thought into it myself, and presenting what I ...
Ian Moore's user avatar
0 votes
0 answers
14 views

Installing Uniswap v4 on hardhat

Folks, Anyone tried to install Uniswap v4 on Hardhat? If yes, can you please point to guidance? Thank-you
xnowledger's user avatar
1 vote
1 answer
1k views

How to Accurately Compute Tick Liquidity in Uniswap V3?

I am trying to compute tick liquidity for the ETH/USDC pair in Uniswap V3 within a range of +-10 tick spaces from the current tick. I'm querying pool and tick data using The Graph API. However, I've ...
Hurry's user avatar
  • 11
0 votes
1 answer
121 views

Tick range of negative tick - Uniswap v3

I am looking for a formula to calculate the tick range for a negative tick. Ex1: tick: -15 tickSpacing: 10 range: [-20, -10) Ex2: tick: -20 tickSpacing: 10 range: [-20, -10) I was ...
KunLun's user avatar
  • 197
0 votes
1 answer
304 views

UniswapV3 Quoter throws error: contract runner does not support sending transactions (operation="sendTransaction", code=UNSUPPORTED_OPERATION)

I am working with the Quoter from Uniswap V3, here is the part of the function that challenges me: ... // Reformat Amount In if (!isNaN(amtIn)) {amtIn = amtIn.toString()} let amountIn = ethers....
Christopherus's user avatar
0 votes
2 answers
251 views

Uniswap V3 Pool_Init_Hash calculations

I'm trying to do calculations for determining pool addresses. However my INIT HASH keeps being wrong. I found some code which calculates pool addresses in a different way export const ...
Ritzy Dev's user avatar
  • 271
2 votes
2 answers
110 views

Extract the amounts(t0, t1) for non-current tick from Uniswap v3 Pool

I want to get the amounts of the tokens for a tick range which is higher or lower than the current tick. For example I have current tick: -282986 with range [-282990, -282980], I want to get the ...
KunLun's user avatar
  • 197
0 votes
1 answer
166 views

Custom V3 router (Is it a Universal router)

I came accross a concept i have no idea about. The concept of custom router. As per my research may be Uniswap V3 is offering Universal router. Is it possible to deploy instance of universal router as ...
Malik Mehmood's user avatar
1 vote
2 answers
166 views

UniswapV2's equivalent of getPair and other functions

i see uniswapv3 quoter or factory or router contracts doesn't have getPair, getReserve and other similar ABI functions like UniswapV2. does UniswapV3 have Equivalent for this functions? or did they ...
Biruk Damte's user avatar
1 vote
0 answers
49 views

Convert UniSwap ID from Graph Query to position token id

I'm sure, the answer is very simple, still I can't figure it out. I know I can get a list of all active UniSwap positions (not closed) positions by querying the subgraph (I'm on Arbitrum): query ...
Kurt's user avatar
  • 31
1 vote
1 answer
232 views

Extract the amounts(t0, t1) per tick from Uniswap v3 Pool

I want to be extract the amounts of t0 and t1 from a Uniswap v3 Pool. I was trying with some method which I found on other post, but I think is not working, or I am doing something wrong. This is the ...
KunLun's user avatar
  • 197
1 vote
1 answer
212 views

Use the swapExactETHForTokensSupportingFeeOnTransferTokens method of uniswap routerV2 to purchase uniswap V3pair tokens

const buyToken = async (account: any, tokenContract: any, gasLimit: any, gasPrice: any) => { let amountOutMin = 0; const amountIn = ethers.utils.parseUnits(useBuy.value.toString(), 'ether'); ...
lawrence Alan's user avatar
2 votes
1 answer
297 views

How can I get all tokens listed on `Sushiswap`

How can I get all tokens listed on Sushiswap. For uniswap we can call factory.getTokenWithId(id) with the token id. But how can we do the same for Sushiswap ?
Saikat Karmakar's user avatar
0 votes
1 answer
148 views

What is the usual gas fee by deploying innicial liquidity to my eth token?

Wanted to know what gas fees I need to expect when adding initial liquidity to my eth token. I removed liquidity for about 11 dollar gas. Now I want to add a new tokenpair and set with it a new price ...
Hippie's user avatar
  • 1
1 vote
1 answer
275 views

When minting a new position why does one token is used up fully and the other is not?

i am using this code to create and initialize a pool and mint a new position on it. // 1 ETH (y) = 2000 USDC (x) pool = IUniswapV3Pool(factory.createPool(address(weth), address(usdc), 500)); pool....
Ren's user avatar
  • 27
0 votes
1 answer
359 views

How to call `quoteExactInputSingle` on quoter2 uniswap using python

I'm trying to call like this in ape def SushiswapV3quoteExactInputSingleV3( router, _from, tokenIn: str, tokenOut: str, fee: int, amountIn: int, sqrtPriceLimitX96: int = 0, ...
Saikat Karmakar's user avatar
1 vote
0 answers
70 views

How can we get the result of swap in curve.fi like `getAmountsOut` for uniswapV2

I'm trying to get the price for the swap WETH->DAI by calling get_dy but there is no direct pool in curve. I went to the UI & put in this swap & got this. tricypto: WETH -> USDT -> ...
Saikat Karmakar's user avatar
1 vote
2 answers
2k views

How a price of a token is being calculated on uniswap & other dexes?

I have just started learning about Uniswap. I have a question, How a price of a token is calculated? I know the x*y = k which defines the price of 2 assets from a pool but how the value of a single ...
Saikat Karmakar's user avatar
1 vote
1 answer
376 views

How to get correct liquidity amount on UniswapV3 for each token(pair) via web3.js?

I'm trying to create a bot that will send me new LPS notifications on Uniswap V3 and in the future more dexes. I want to contain in the message specific data like amount of token and ETH in the pool, ...
RasmonT's user avatar
  • 131

1
2 3 4 5