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

Questions tagged [uniswap]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
26 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
1 vote
0 answers
12 views

How does Uniswap V3 Bug Bounty Works?

Uniswap V3 contracts aren't upgradable, so what happens if I find a vulnerability? How do they fix it? Do they redeploy?
Ryan Holanda's user avatar
0 votes
1 answer
13 views

Is it possible to recover non-reserve tokens accidentally sent to a Uniswap V2 Pair contract?

I'm trying to understand the operation and potential pitfalls of interacting with UniswapV2Pair contracts. I'm aware that if excess token0 or token1 are sent to a Pair contract, it may be possible to ...
opsec's user avatar
  • 1
0 votes
0 answers
19 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
17 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
16 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
1 answer
18 views

Projects you made

Which projects you made that get you to expert level in solidity? I'm trying to be a smart contract dev. with solidity and wanna see which ones you made so I could benefit from it.
seojunchian's user avatar
0 votes
0 answers
12 views

What are some reddit, discord, telegram communities that you join and build a good network and recommend to anyone about web3, solidity, dex, swap? [closed]

So I'm looking for communities to join and talk to people, build network, learn staff. What are those you would recommend that "That one has great people and I think anyone could benefit from it&...
seojunchian's user avatar
0 votes
1 answer
28 views

How to make my own wrapped token for native token like WETH, WMATIC?

I want to make my own WMATIC in amoy testnet for marketplace trade. In more details, I want to suggest with WMATIC in marketplace our team had made. I know how to deploy ERC20 name WMATIC, and I want ...
rrrrssss's user avatar
0 votes
0 answers
12 views

Typescript SWAP ETH -> USDC failing

I wrote a code in typescript to realize a ETH -> USDC swap, but i am having some problems when realizing. The code runs smooth, but when i check in etherscan, i see a failure in Uniswap V3 Router. ...
polonio's user avatar
  • 101
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
21 views

FlashLoanWithSwap

Question: I have tried to flashloan with Solidity using Aave code. The issue occurred when calling the _flashloan function with the token address and amount as arguments. Steps: Convert the pool ...
support's user avatar
0 votes
0 answers
15 views

Issues Adding Liquidity on Mainnet with a Custom ERC20 Token (It Works Using Hardhat!)

I've developed an ERC20 token using Solidity and have successfully tested its liquidity functions on Hardhat. The process completes successfully in the Hardhat environment, but when I attempt the same ...
Yazan Ali's user avatar
0 votes
0 answers
18 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
0 answers
18 views

Get token using uniswap V3

I deployed 3 tokens and created a liquidity pool with tokens 1 & 2 then tokens 2 & 3. Now i want to get the token 3 in token 1 using UniswapV3. // SPDX-License-Identifier: MIT // Compatible ...
user135270's user avatar
0 votes
1 answer
29 views

Liquidity property of an uniswap V3 pool is higher than the actual reserves - why?

As far as I understood, the liquidity property of an Uniswap V3 pool reflects the current in-range liquidity, and it is stored as the square root of x*y. So if we check the liquidity of this contract ...
flo's user avatar
  • 105
0 votes
0 answers
18 views

Cloning uniswap v3 GetQuote

I am cloning my own version of uniswap for a new chain. I have deployed my version of the v3 contracts and I am using the interface from the uniswap github. When entering a value in the swap form it ...
koukotsu's user avatar
  • 361
0 votes
0 answers
21 views

uniswap v3 Calculate entrance price of a liqidity pool

for example I have added a liquidity on a uniswap v3 pool with this data: pair: CAKE-ETH min price: 1,074.54 max price: 1,118.39 cake amount: 116.752 eth amount: 0.077786 tick spacing: 200 now how ...
Sa SO_PO's user avatar
0 votes
0 answers
17 views

Downscaling liquidity tax according to ETH reserves for fair distribution without presale

So I wanted to try and solve the problems that arise when releasing a token with very low liquidity. Presaling should absolutely be avoided since holders always dump at the start. Assume 50 to 100% of ...
Ashraile's user avatar
  • 125
0 votes
2 answers
15 views

reserve0/reserve1 price is different compared to boughtTokensAmount/requiredWeiAmount

I would start with a sample on exact UniswapV2 pair SHIB/WETH (SushiSwap). I use local hardhat node and there's no possibility of 3-rd party effect on LP. I have this toSwapTokensAmount = ...
dvcr's user avatar
  • 3
0 votes
1 answer
31 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
22 views

transaction reverted when calling swapExactETHForToken on uniswapRouter02

currently, I'm trying to swap eth for an erc20 token and the transaction gets reverted every time, not quite sure what I'm missing, i pre-approved some allowance for the router02 to spend on my behalf,...
yahdielo's user avatar
0 votes
1 answer
28 views

Difference between Liquidity in Uniswap V2 und V3 when deploying a contract

When I deploy a contract and add liquidity to my V2 pool on Uniswap, I usually add amount of TokenA and an amount of ETH which then determines the price (amount of tokens / amount of ETH). When people ...
SolidityNewbie's user avatar
0 votes
0 answers
23 views

Transaction revert in uniswap universal router

I want to sell token using universal router on Base network but transaction is getting reverted. Can anyone solve this? CODE require('dotenv').config(); const Web3 = require('web3'); const routerABI = ...
shakil khan's user avatar
0 votes
0 answers
48 views

SwapRouter02 calling exactInputSingle: execution reverted (base chain)

i'm trying to send a function via ethers.js to BASE chain: config.SWAP_ROUTER_ADDRESS = "0x2626664c2603336E57B271c5C0b26F421741e481"; const ABI = require("@uniswap/swap-router-contracts/...
Moltea_'s user avatar
0 votes
1 answer
201 views

Using Uniswap V3 to swap 2 ERC20 tokens on Amoy Testnet

I'm quite new to blockchain and uniswap in general, I have deployed 2 erc20 tokens on Amoy testnet. TokenA and TokenB I would like to be able to swap between TokenA and TokenB by using uniswap v3. ...
Pax's user avatar
  • 1
0 votes
1 answer
15 views

Transaction execution reverted on swapExactTokensForETH

I hope somebody can help I am trying to sell a token via Uniswap V2 Router02 (Token CA: 0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed) (This token is a legit one, there is no scam here), I have ...
duyanhhz's user avatar
1 vote
1 answer
79 views

Insufficient Liquidity after adding liquidity on Sepolia Uniswap V2

I created a token "TestMe" with 2 million tokens (18dec), minting the deployer address the whole stack. I used the "addLiquidityETH" function provided by uniswap router to add 500k ...
SolidityNewbie's user avatar
0 votes
1 answer
32 views

Is there a better way to identify token swaps than through receipt.logs?

I am trying to identify token swaps from Uniswap (from WETH, USDT or USDC) through transaction hashes. Right now I use it like: infura_url = 'https://mainnet.infura.io/v3/xxx' web3 = Web3(Web3....
ftmbl's user avatar
  • 1
0 votes
1 answer
131 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
24 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
0 votes
0 answers
51 views

How to fix revert problem in universal router?

I want to sell token using universal router in base network but transaction revert is coming every time. Can anyone solve this? CODE const { BigNumber } = require('bignumber.js'); const routerAbi = ...
shakil khan's user avatar
1 vote
1 answer
142 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
24 views

I swapped a token using uniswap bot, I have unrealised profits but I no longer have the position [duplicate]

I swapped a token using uniswap bot, I have unrealised profits but I no longer have the position. it shows me as if I have zero balance in my account. here is my transaction on etherscan: https://...
alabri7's user avatar
1 vote
0 answers
162 views

Issue Deploying liquidity on Sepolia Testnet

I have deployed my contract to sepolia test net successfull but when I go to uniswap to try and provide some testnet liquidity whenever I try to select one of the tokens for the pair sepoliaEth ...
vectorizedaynon's user avatar
0 votes
1 answer
46 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
35 views

How to compare liquidity between different DEX pools?

I'm interested in comparing how liquid DEX pools are, for example in order to find the pool that would have the least price impact when swapping from ETH to stablecoins. Looking at the token balances ...
kfx's user avatar
  • 1,630
0 votes
1 answer
30 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,703
1 vote
2 answers
30 views

Do I have to pay twice for network fee?

I'm very new in crypto world and right now I'm trying to swap this coin but as you can see in the screenshot the ETH gas fee (Uniswap) is only $15 but once I tried to confirm transaction at my wallet ...
andrel58's user avatar
0 votes
0 answers
26 views

addLiquidityETH reverts even after token approval

I am trying to deploy liquidity on a testnet using this code. However, it reverts with no explanation given other than that error. According to the UniswapV2 docs, I am using the correct router (...
Bobby Bee's user avatar
0 votes
0 answers
14 views

Ethers giving Error: missing revert data in call exception for some pairs

I'm trying to get quote prices for pairs. Most of them end up being successful, but some number of them raise an error in code Error: missing revert data in call exception; What can be done about it? ...
Tester Tester's user avatar
0 votes
2 answers
38 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
81 views

Is the code in the link a scam? It's for "Uniswap ETH Arbitrage Bot" [duplicate]

There is a video on youtube with over 30k views, and I'm sus it's a scam...is it the video: https://www.youtube.com/watch?v=4eLJZpGSHqk&t=20s&ab_channel=CryptoChemist%F0%9F%A6%87 the code: ...
Mephistopheles's user avatar
0 votes
2 answers
43 views

Is it possible to manipulate V2 getAmountOut() or V3 sqrtPriceX96 using Uniswap flash swaps or any kind of flash loan

I use this calls: IUniswapV2Router(uniswapV2Router).getAmountOut(tokenAmount, reserve1, reserve0) // Uniswap V2 token price (uint160 sqrtPriceX96, , , , , , ) = uniswapV3Pool.slot0(); // Uniswap V3 ...
blockson's user avatar
0 votes
0 answers
20 views

How to calculate the graph edge weights when doing arbitrage on Uniswap using Bellman-Ford?

I am trying to create an arbitrage bot on Uniswap by using graph data structure. On this graph tokens represent nodes and the exchange rate between tokens represent edge weights. By applying -log ...
Ahmet Yazıcı's user avatar
0 votes
0 answers
20 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
0 votes
1 answer
34 views

Can't remove the liquidity from uniswap

I deployed a contract on the blockchain that had no buy and sell function (mistake). This contract is verified by Etherscan, and I've added 0.8 ETH of liquidity that I can't withdraw because the ...
Pedro's user avatar
  • 1
1 vote
1 answer
125 views

Error when calling quoteExactInputSingle from Uniswap Quoter

I am simply trying to call a method in Uniswap QuoterV2 and keep getting errors that the arguments aren't correct. This is my relevant code: import QuoterABI from '@uniswap/v3-periphery/artifacts/...
Marat Arguinbaev's user avatar
0 votes
0 answers
25 views

Ideal cross chain swaps

What will be the ideal scenario for swapping assets in different chains? It's not possible to transfer any asset to a different chain. What if we make a separate token for the swap? Mint a token ...
Saikat Karmakar's user avatar
0 votes
1 answer
239 views

Layer2: Revert Execution Error when Calling exactInputSingle in Uniswap V3

Hello Stack Overflow Community, I am working on swapping tokens in a base layer2 network using Uniswap V3 and ethers.js. I have successfully approved the transaction using the approve function, but ...
Ghassane Aboughazaouat's user avatar

1
2 3 4 5
24