Questions tagged [uniswapv3]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
5 views

How to create order book from uniswap liquidity?

I previously understood that you pull the bitmap for the initialized tick ranges then iterate over the words. You take current liquidity and subtract net liquidity when you're below the current tick ...
Nat's user avatar
  • 247
1 vote
1 answer
82 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
17 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
28 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
1 answer
15 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
32 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
0 answers
22 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
32 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
12 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
90 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
36 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
173 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
13 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
79 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
55 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
21 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
108 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
54 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
0 votes
1 answer
52 views

AddLiquidity to pool: Uniswap V3 Pool Deployer and PoolAddress.computeAddress() make different pool addresses

I have deployed all UniswapV3 contracts locally in a Foundry test, then tried to mint a new position following https://docs.uniswap.org/contracts/v3/guides/providing-liquidity/mint-a-position I ...
Russo's user avatar
  • 1,762
0 votes
1 answer
75 views

Error: invalid signer or provider (argument="signerOrProvider", value={}, code=INVALID_ARGUMENT, version=contracts/5.7.0)

import { AlphaRouter } from "@uniswap/smart-order-router"; import { ethers, BigNumber } from "ethers"; // Import BigNumber from ethers import { Token, CurrencyAmount, TradeType, ...
Nilesh Nath's user avatar
0 votes
0 answers
25 views

Is there anyway to reduce gas fee for uniswap v3 ExactOutputSingleParams?

Question is simple. Is there anyway to reduce gas fee for ExactOutputSingleParams ? function swapExactOutputSingle(uint256 amountOut, uint256 amountInMaximum) external returns (uint256 amountIn) { ...
xlogic land's user avatar
0 votes
0 answers
20 views

Why a Uniswap/PancakeSwap emits same event multiple times

does someone know why Uniswap/PancakeSwap pairs occasionally emit the same Swap event multiple times? There is it an example on dexscreener on WBNB/USDT: I happen to also catch it in my script that I ...
Melardev's user avatar
  • 101
1 vote
0 answers
102 views

Uniswap v3: calculate tickLower and tickUpper

I want to create a pool on Uniswap V3 with a specific price. For example 1 Dev token eq 0.1 USDC, Dev token has 18 decimals and USDC has 6 decimals, code for create pool: const POOL_FEE = 500 const ...
Meldum's user avatar
  • 171
0 votes
0 answers
49 views

Error INSUFFICIENT_INPUT_AMOUNT when trading pancake

A newly created token contract is normally traded on the testnet, Published to the main network, this error occurs when selling coins INSUFFICIENT_INPUT_AMOUNT; https://pancakeswap.finance/swap?...
AdinZ's user avatar
  • 1
0 votes
0 answers
83 views

ProviderError: transaction would cause overdraft when using Uniswap V3 router on Goerli testnet

I tried to call a smart contract (UniswapV3Swap.sol) from another smart contract (UniswapV3Connector.sol). I want to call the swapExactInputSingleHop from UniswapV3Connector.sol, however, the ...
rasyidred's user avatar
0 votes
2 answers
336 views

Why gas fee on Uniswap is far far higher than normal gas fee

The transaction fee for swapping tokens on Uniswap is significantly higher than the normal Ethereum transaction fee. I wonder why? Note: You can obtain real-time gas fees from https://etherscan.io/...
user376830's user avatar
0 votes
0 answers
75 views

Got different prices from SqrtPriceX96 and from Tick on Uniswap

I trying to get price (ratio) from pool on Uniswap v3 by JS with ethers.js. But I got a slightly different prices from SqrtPriceX96 and from Tick, for some reason. SqrtPriceX96 and Tick took from '...
Yurii's user avatar
  • 1
0 votes
0 answers
131 views

Who can me give me detailed steps to fork Uniswap on v3?

There ! I m forking uniswap v3. Already downloaded v3-core, v3-periphery,interface repository, but I can't customize them. Especially in Interface, I can't find the way how can integrate smart ...
Marin Seremet's user avatar
0 votes
0 answers
28 views

Uniswap V3: how to get maximum NFT Position token Id?

I want to get the maximum NFT Position ID to make calculation on a Pool over all NFT Positions. How to do that ? Can I do that using the blockchain ?
Eli O.'s user avatar
  • 101
0 votes
0 answers
20 views

Determining the Percentage of Uniswap V3 Trading Volume from Arbitrageurs vs Regular Traders

I am trying to understand the trading dynamics on Uniswap V3. Specifically, I am interested in finding out what percentage of the trading volume on Uniswap V3 comes from arbitrageurs versus regular ...
MShakeG's user avatar
  • 1,074
0 votes
0 answers
5 views

Why is computedFee too small when using function?

I tried to calculate computedFee according to this page: https://www.metacrypt.org/tools/uniswap-v3-calculator-simulator/?network=ethereum&token0=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2&...
ethereum's user avatar
0 votes
0 answers
151 views

How can I find Smart contract address deployed in sepolia testnet?

I'm finding contract address of SwapRouter and Quoter which is the contract of uniswap version 3. Of course Goerli address is in uniswap doc. But I want to know the address in sepolia. If anybody know ...
AresColin's user avatar
0 votes
3 answers
205 views

I want to swap ETH to any other token using Uniswap V3 and Remix IDE. I am trying it on Goerli Testnet

I am trying to swap ETH to any other coin on Remix IDE and using Uniswap V3 on Goerli Testnet. I am able to deploy the contract but the moment I am trying the swap function, it says execution reverted....
Dhruva Parmar's user avatar
0 votes
0 answers
102 views

Uniswap V3 Pool initialization

As I was doing research on Uniswap V3 pool esp. about adding liquidity to such a pool, I found the initialization takes some non-trivial sqrtPriceX96 that is coming from nowhere. When a pool is ...
Maxareo's user avatar
  • 633
0 votes
0 answers
24 views

How to estimate input amount for sushiswap?

For estimation of input amount of tokens while calling quoteExactOutputSingle I use following for uni v2 const pair = await Fetcher.fetchPairData(tokenFrom, tokenTo, provider); const route = new ...
Serhii Nikitin's user avatar
0 votes
0 answers
124 views

Uniswap v3: How do I get the path bytes from solidity from array function parameters?

I am trying to write a smart contract that can facilitate multihop swaps. It is important that I am able to pass in 2 arrays into the swap function: an address[] of the tokens and uint256[] of the ...
Ethan's user avatar
  • 1
1 vote
1 answer
28 views

it’s possible that swap transaction get executed some blocks later

i want call X function, there are multiples external calls in this function.one of this external calls is a DEX trade. it’s possible this DEX trade transaction get executed in the some blocks later or ...
Saeed Alipoor's user avatar
0 votes
0 answers
99 views

Mint new position fails uniswap v3

I am using the code example of uniswap to mint a new position and add deposit: https://github.com/Uniswap/docs/blob/main/examples/smart-contracts/LiquidityExamples.sol Below is my code: /// @notice ...
Fariha Abbasi's user avatar
0 votes
1 answer
29 views

How come for some Univ3 swaps, the price of the pool after a buy is *lower* than the price paid for the swap? This should not be possible

First off, I'm fully aware of concentrated liquidity on Univ3. This is not a question about that. Regardless of concentrated liquidity or not, it is my understanding that the swap price a Buyer is ...
Geert-Jan's user avatar
  • 157
0 votes
0 answers
61 views

How to convert price to sqrtPriceX96 in solidity?

This question asks how to convert sqrtPriceX96 to price in solidity, but I can't find information on doing the inverse. How do you turn a price e.g. 55 ether into its sqrtPriceX96 with full precision? ...
Ryan Sea's user avatar
  • 598
0 votes
0 answers
5 views

V3 Position Sent to CA

We wanted to see if it is possible to collect fees from our UNIV3 position that we sent to our token contract?\ Thanks!
damien's user avatar
  • 1
0 votes
1 answer
55 views

Is there any significant advantage that UniswapV3 has over UniswapV2 in a Flashloan(or Flashswap) scenario?

I have been following the flash loan market for a while and I want to eventually experiment on it but i am having a hard time choosing between UniswapV2 and uniswapV3 for making my swaps. Is there any ...
Shigaba Shigaba's user avatar
0 votes
2 answers
1k views

UniswapV3 Swap Router Sepolia Address

Have been looking for UniswapV3's SwapRouter's deployed address on the Sepolia Test Network. For some reason the Unsiwap has't provided us with the Sepolia deployed addresses. Can someone help me here....
Harsh Gupta's user avatar
0 votes
0 answers
129 views

How to create a Multicall Swap Multihop in JAVA based on Uniswap V3?

Recently Uniswap And Pancakake swap launch thery v3 contracts, so the way of we do a swap changes now. Is there someone that know how to do that in Java or Kotlin? I'm asking for a Multihop, because ...
ronaldoguedess's user avatar
0 votes
0 answers
22 views

How to simulate and minimize the price impact by splitting a large purchase into smaller chunks and over a number of days?

Let's say a trading firm wants to buy $5 MIL worth of SYN (https://www.coingecko.com/en/coins/synapse) in Uniswap V3 pools. SYN currently has a market cap of $135 MIL. I know how to calculate the ...
KubiK888's user avatar
  • 103
0 votes
0 answers
58 views

Uniswap v3 offline price calculation

Is there an off-chain way to calculate amountOut for a pool, for any number of tokens in? I know I can do a RPC call, but I want to try a large amount of prices and that is inefficient. I would rather ...
DottyPhone's user avatar
0 votes
0 answers
79 views

Calculate uniswap v3 fees for position from swap events

I need to calculate uncollected fees for uniswapV3 position let's say from yesterday. I scanned for all swap events in the liquidity pool and saved them to my DB. Also I have in the database all ...
Denis's user avatar
  • 1
0 votes
1 answer
121 views

AttributeError: 'exactInputSingle' object has no attribute 'buildTransaction'

I want to swap tokenA to tokenB. Thequestion heppened: File "E:\Code\pythonProject\infura_API_test\3_swap_by_web3_py.py", line 76, in <module> tx_swap = router.functions....
Zysman's user avatar
  • 1
0 votes
0 answers
86 views

Trying Uniswap V3 Swap Example - Error: Transaction reverted: function call to a non-contract address

Have been getting bellow error message: SwapExamples swapExactInputSingle: Error: Transaction reverted: function call to a non-contract account at SwapExamples.swapExactInputSingle (contracts/...
EMintela's user avatar
0 votes
0 answers
31 views

In a UniswapV3 pool, where do fees live?

I'm trying to understand fees on UniswapV3. Not how to compute them (this has been well-covered and is not difficult to understand) but how they actually work in the code itself. The main question is: ...
notthatintodefi's user avatar