Skip to main content

Questions tagged [uniswapv3]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
37 views

Uniswap v3 QuoterV2 not returning amountOut

I have been trying to get a quote for two addresses using the Uniswap V3 QuoterV2 contract but I keep getting an error of: TypeError: Cannot read properties of undefined (reading '...
NotToDevy's user avatar
0 votes
0 answers
11 views

Uniswap router V3 exactOutputSingle failing without proper error

I need to make a swap with Javascript web3.js and uniswap V3 router (for testing I use BSC) Here my code import Web3 from 'web3'; import config from './components/config.js'; import BigNumber from '...
Skinsky Gnudy's user avatar
0 votes
0 answers
14 views

Uniswap v3 IQuoter / IQuoterV2 return nothing

I'm trying to get Uniswap v3 IQuoter.quoteExactInputSingle() or IQuoterV2.quoteExactInputSingle()in Arbitrum / Base networks in my solidity contract. In both cases Remix show me that decoded output is ...
Rodion Krat's user avatar
0 votes
1 answer
26 views

Having issues swapping brett on base with my web3.py script

Here is my current code (not including abi because its gonna be to long) #Addresses PERMIT_ADDRESS = '0x000000000022D473030F116dDEE9F6B43aC78BA3' BRETT_ADDRESS = '...
vectorizedaynon's user avatar
2 votes
2 answers
105 views

cannot estimate gas of route swap with Uniswap v3

I'm currently trying to process a swap with Uniswap v3 by forking the example of the documentation (https://docs.uniswap.org/sdk/v3/guides/swaps/routing). I'm swapping on Base Mainnet (chain id: 8453) ...
Corentin de Maupeou's user avatar
0 votes
0 answers
29 views

Order of tokens in Uniswap V3 pool price

I am trying to get a token price from the Uniswap V3 pool. The Uniswap V3 contract provides a slot0 field where the rate is written in two ways. (documentation) using sqrtPriceX96 and using tick Then ...
Yan's user avatar
  • 1
0 votes
0 answers
17 views

After implementing UniswapV3 swap logic in Web3.py, I get a lot of logic errors saying "execution reverted: SPL"

I tried to do a Swap on UniswapV3 with the following code in Web3.py. As a flow, output the value of amount_out_min in quoteExactInputSingle function -> get the pool impact after the swap in ...
y.y's user avatar
  • 1
0 votes
0 answers
29 views

Uniswap v3 Mainnet vs Sepolia EvmError: Revert

I'm struggling to solve EvmError: Revert, while calling createAndInitializePoolIfNecessary function on Uniswap v3 NonfungiblePositionManager contract. I have wrote function that contains this code: ...
Neftyr's user avatar
  • 3
1 vote
1 answer
104 views

Issue swapping with Universal Router smart contract on Base Chain

Here is my current code. In the past I have used ISwapRouter with v2 liqudity. In this case I am trying to execute a swap on base chain with v3 liqudity but base chain does not have a swap router ...
vectorizedaynon's user avatar
0 votes
0 answers
20 views

how to calculate the tick from price ? Uniswap v3

This is USDC/ETH pool with 0.05% poolfee. I am planning to get the price range from users (lower price and higher price ) but if the user provide lower price as 0.00025991932 and higher price is 0....
unni krishnan's user avatar
1 vote
0 answers
20 views

How to get uniswap v3 price tick?

I am planning to get the price range from users (lower price and higher price ) but if the user provide lower price as 0.00029991932 and higher price is 0.00033985099 then how can I get the lower tick ...
unni krishnan's user avatar
0 votes
0 answers
19 views

How to fetch the amount of tokens pooled into Uniswap V3 pool

I would like to fetch the amount of USDC.e (or any other token) pooled into the Uniswap v3 pool on Arbitrum using Node.js. I figured out how to fetch the current split when the price is in the range, ...
Timofey Kupriyanov's user avatar
0 votes
0 answers
10 views

Mint new position not working for all existing pairs

I am using uniswap v3 mintNewPosition to mint new liquidity position .So i called mintNewPosition() function mentioned in https://docs.uniswap.org/contracts/v3/guides/providing-liquidity/mint-a-...
unni krishnan's user avatar
0 votes
0 answers
29 views

Uniswap OLD revert after swap

I am initializing new pool, and have a contract that allows doing swap on it utilizing TWAP Oracle. I have tested the TWAP and in tests it needed 1 second delay to return correct quotes, until doing a ...
Jan Kwiatkowski's user avatar
0 votes
1 answer
31 views

How to abi.encodeWithSignature the function which contains structure as the parameter in solidity?

I want to call Uniswap's collect function which is in NonFungiblePositionManager contract using delegatecall. But the collect function takes the structure as the parameter. Here is the collect ...
Aviroxi's user avatar
0 votes
0 answers
42 views

Call Swap from Uniswap V3 pool contract instead of through router

I am trying to call swap method from UniswapV3Pool contract, Kindly guide me step by step to call this method. ETCSwap (Ethereum Classic DEX) is using this approach, they are directly interact with ...
Syed Mokarram's user avatar
0 votes
1 answer
154 views

how to call execute sell function in uniswap v3?

I have called function buy and sell with uniswap v3 and transaction is failed. How to call I use web3py and call to def sell_token(web3 : Web3 , chain, wallet_address, address_token, token_abi, ...
Frey's user avatar
  • 1
0 votes
1 answer
46 views

UniversalRouter execution reverteed BASE chain

I'm trying to use UniversalRouter to swap WETH to token, this is how i'm doing it: //from - WETH, to - test token const contract = new ethers.Contract( "...
Moltea_'s user avatar
0 votes
1 answer
172 views

Uniswap V2 Router, Factory on amoy Test Network

what is the address of uniswap router on amoy test network as currenty uniswap doesn't support amoy network.
sahil's user avatar
  • 5
1 vote
1 answer
25 views

How do I properly call the transferTokens() function?

This first contract creates a liqudity pool for the two tokens on sepolia test net // SPDX-License-Identifier: MIT pragma solidity 0.8.25; // Using npm package imports for a Hardhat or Truffle ...
vectorizedaynon's user avatar
1 vote
1 answer
243 views

Transaction got reverted Uniswap Universal Router

I want to programmatically swap using Uniswap Universal Router, but the transaction always gets reverted Here is my code: const ethers = require("ethers"); const { abi: V3SwapRouterABI } = ...
duyanhhz's user avatar
0 votes
1 answer
63 views

What is the difference (in terms of calculation) between tokens pricing while swapping vs while adding liquidity in Uniswap V3?

In Uniswap V3, getting different prices of 1 WETH to USDC while swapping and adding liquidity, potentially because of fees and other contributing factors. Swap Add Liquidity Programmatically, I'm ...
SYED ASAD KAZMI's user avatar
0 votes
1 answer
45 views

How to Compute Nearest Lower and Higher Initializable Ticks in Uniswap V3?

I am developing applications interacting with Uniswap V3 pools and need to calculate the nearest lower and higher ticks that are initializable given a specific tick and tick spacing. In Uniswap V3, ...
MShakeG's user avatar
  • 1,723
0 votes
1 answer
29 views

what is the best way to get the amount of token1 i can get for 1 token0 in a pool

async function getPoolData() { const provider = await new ethers.JsonRpcProvider("http://127.0.0.1:8545/"); const signers = await provider.getSigner(); console.log("Pass 1"); ...
unni krishnan's user avatar
0 votes
2 answers
41 views

how to find how much usdc should i want to add if i need to add 1 eth. How to calculate this?

when we want to add liqudity in uniswap you should need to add two tokens so if i need to add eth and usdc then i need to add eth and usdc curresponding to the eth which we add. so my doubt is how to ...
unni krishnan's user avatar
0 votes
1 answer
47 views

How can I get the correct pair price from Uniswap v3 pool?

Code showing me token price in wrong format. How to solve it? From the code I got: 1 WETH = -3.30628482e-9 USDC 1 USDC = -302454281.60057910558352924961 WETH But the real/expected values were: 1 ...
shakil khan's user avatar
0 votes
0 answers
23 views

Uniswap V3 transaction on Optimism reverted with "err32" error

I was attempting to interact with a Uniswap V3 pool contract on the Optimism network, but encountered a transaction failure with an 'err32' error. The transaction reverted with the warning: Warning! ...
Easting's user avatar
1 vote
0 answers
30 views

Observations in TWAP Uniswap

In Uniswap v3's TWAP oracle, how often are observations stored in the observations array of each pool (assuming the array's cardinality has been increased several times already)? Is it on every swap? ...
dNyrM's user avatar
  • 928
0 votes
0 answers
26 views

Why nextInitializedTickWithinOneWord() returns the same tick provided when there are other initialized ticks to the right

ticks intialized 85176,85177,85175 (...
vishwa 7dcap's user avatar
0 votes
0 answers
20 views

sender doesn't have enough funds to send tx

i am trying to create a uniswap pool but when i am testing my smart contract i am getting an error . import { expect } from "chai"; import { ethers, network } from "hardhat"; ...
unni krishnan's user avatar
0 votes
0 answers
18 views

Does removing liquidity from a staked pancakeswap lp unstake it?

If I remove all the liquidity from a PancakeSwap V3 LP, I know it also collect the fees earned. But if that LP is staked in a farm, will removing the liquidity automatically unstake it and harvest the ...
sharip's user avatar
  • 1
0 votes
0 answers
16 views

Uniswap V3 protocol tick price conversions

Right now, I'm delving into the mathematics and corresponding code of the Uniswap v3 protocol, and I've stumbled upon this function. Despite scouring numerous documents and forums, I haven't found any ...
Pintus20's user avatar
0 votes
0 answers
46 views

UniswapV3 Fork with updated POOL_INIT_CODE_HASH

I am trying to modify the the standard tests for UniswapV3 staker, which is deployed with different POOL_INIT_CODE_HASH, but so far the tests that are failing resulting the following Error: Error: VM ...
Mark's user avatar
  • 13
0 votes
1 answer
72 views

How to calculate sqrtPricex96 for uniswap pool creation?

Hello everyone I'm trying to create a pool for my erc20 token (SwapToken) / wETH on sepolia just to figure out how things are working on uniswap V3. I'm having a hard time calculating the sqrtPriceX96 ...
emtothed's user avatar
0 votes
0 answers
43 views

How to get the token prices from the uniswap v3 pools?

I have to write the solidity code to fetch the prices of token pairs from the uniswap v3 pools but I have no idea how to get the prices of the token pairs from the uniswap v3 pools to my smart ...
kumar's user avatar
  • 61
2 votes
0 answers
395 views

uniswap not working on sepolia network

I am trying to swap two ERC20 tokens using uniswap v3 and in hardhat test its working correctly but its not working on sepolia testnet. this is the smart contract : // SPDX-License-Identifier: GPL-2.0-...
unni krishnan's user avatar
0 votes
0 answers
51 views

Doubt in uniswap v3 swap

swap doesn't working . Is there any mistake in my code ? I am using Ethereum sepolia test net. // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.20; pragma abicoder v2; import "...
unni krishnan's user avatar
2 votes
1 answer
338 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
  • 21
1 vote
1 answer
115 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,723
1 vote
0 answers
22 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
36 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
45 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
80 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
  • 173
1 vote
0 answers
17 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
60 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
83 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
55 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
17 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
256 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
298 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

1
2 3 4 5