Questions tagged [uniswap]
Uniswap is a decentralized finance protocol that is used to exchange cryptocurrencies.
998
questions
0
votes
0
answers
5
views
Problem with output token from Uniswap's function swapExactTokensForTokens
I built a bot (with solidity) that swaps on Uniswap and Sushiswap some WETH for another token and viceversa. In my scripts and in the Uniswap swap UI if i swapped 562 COMP i would get 10.43 WETH. I ...
0
votes
0
answers
6
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 ...
0
votes
0
answers
13
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 ...
0
votes
0
answers
12
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 ...
0
votes
1
answer
15
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....
0
votes
1
answer
24
views
ERROR: Stack too deep when compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack
I am trying to build a Uniswap Liquidity pool contract, I have written the Below code for it.
CODE:
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity =0.7.6;
pragma abicoder v2;
import '@...
0
votes
1
answer
21
views
Can I get the result of swap by logs?
In transaction https://etherscan.io/tx/0x500f3250bf814df9f34b29c0c3029bdb1543c2e067f231781f27d28824dbebf0,
actually trader get 1,044,000,000.000000002 SAITOKI.
Can I calculate the result (1,044,000,...
0
votes
1
answer
223
views
Uniswap V2 Router, Factory on Sepolia Test Network
Is it possible to use a Uniswap V2 router in Sepolia? what is the contract address of a router? What I got is only for the Goerli test network, and it is already an obsolete network, and you have to ...
0
votes
1
answer
14
views
How was this liquidity token locked? I can't find any references to the lockNFT function online?
See here https://etherscan.io/tx/0x0e19b17b75dccb9e088c8f00ce8b1d2f4e505e376ee859f9d1d902fb6f36d9bd
Function: lockNFT(uint256 tokenId)
MethodID: 0x2b7170d0
[0]: ...
0
votes
0
answers
16
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: ...
0
votes
1
answer
18
views
Understanding the getAmountsOut functrion, help please
I'm trying to understand the "getAmountsOut" function from Uniswap / Pancakeswap, line by line:
// performs chained getAmountOut calculations on any number of pairs
function getAmountsOut(...
0
votes
1
answer
47
views
Can't create UniswapV2Pair from constructor on Ethereum Mainnet
I want to create a Uniswap Pair in a constructor() block of my token smart-contract.
However, when I try to do this, I get "error":"execution reverted".
Perhaps these nuances will ...
0
votes
0
answers
13
views
How to set slippage tollerance in while integrating swap feature of router of uniswap
const amountOutMin = ethers.utils.parseUnits((box2Input * (1 - tolerance / 100)).toString(), decimals1);
When I am keeping the slippage low I am getting a gas estimation error and when keeping it very ...
-1
votes
0
answers
16
views
Issue Removing Liquidity in Uniswap v2 [closed]
can someone please help? I am having issues removing liquidity. The contract address is:
0x525e8caafb2dc7f4938acd73219da6e2a06cce8e
I forked this contract from a zero-tax crypto, but DEXTOOLS says I ...
0
votes
0
answers
22
views
Calculate amount of ETH and USDC after minting a position in uniswap v3
I would love help in this aspect as I am a novice:
Backdrop:
UNISWAP V3 ETH/USDC pool
Current tick of 202,690
Position upper tick of 203,000
Position lower tick of 202, 000
Position value in USDC of ...
1
vote
0
answers
38
views
SwapExactTokensForTokens not working properly
I'm building an arbitrage bot that swaps tokens from uniswap and sushiswap (or vice versa). To build it i used the swapExactTokensForTokens() function from uniswap and sushiswap, when i try to swap ...
1
vote
1
answer
77
views
How would I be able to set slippage for exactInputSingle on Uniswap v3 and Pancakeswap v3?
I'm able to do swap transactions using multicall and exactInputSingle functions on both Uniswap v3 and Pancakeswap v3. However, I have no idea how would I be able to set the slippage. The v2 routers ...
0
votes
0
answers
26
views
balanceOf call revert exception
I am doing the Uniswap tutorial on SimpleSwap contract.
I am stuck at making the tests. I am getting the exception at line:
const ercAbi = [
// Read-Only Functions
"function balanceOf(address ...
0
votes
1
answer
38
views
Sending balance to address
I have a very big contract that does some swaps and the profit of them is send to the contract's balance. I wanted to send the profit to my address with this function (I'm using Remix IDE to test it):
...
0
votes
0
answers
13
views
uniswap v2: flashloan fee
I know that there is a 0.3% fee in the flashloan of Uniswap v2, which is deducted from the transaction. When I use the swap () function for flashloans, in the end I should pay back the money. I need ...
0
votes
1
answer
60
views
How to wrap ETH into WETH via ethers.js or web3.js?
what function in a smart contract is responsible for this?
In the documentation of Uniswap I've found only one reference to what I might be looking -- https://docs.uniswap.org/contracts/universal-...
0
votes
0
answers
25
views
How to calculate "amountOutMin" on some DEX-es?
There's a function in a contract on HOT-protocol exchange
sendToL2( uint256 chainId, address recipient, uint256 amount, uint256 amountOutMin, uint256 deadline, address relayer, uint256 relayerFee )
...
0
votes
0
answers
11
views
Need Guidance on Handling a Paused Token pair in Uniswap : extract ETH from pair
I currently have a token pair (Token A and ETH) listed on Uniswap DEX. However, Token A's smart contract has been paused by its issuer, rendering this token immovable at the moment. Now, I'm aiming to ...
0
votes
0
answers
59
views
Uniswap V3 reverts execution on 'quoteExactInputSingle' function
I am working on goerli testnet with uniswap and trying to get token price with fee included. In order to accomplish I call uniswap.get_price_input python uniswap library function. It runs perfectly ...
0
votes
0
answers
16
views
80% of tax fees in uniswap
I PUT 27 euros to uniswap and they take 6 euros in fees for PUT it in the wallet and then I want to swap my Ethereum and it says that I only have 3 euros to swap in ethereum. It’s normal that they ...
0
votes
1
answer
15
views
Swap contract v Lightning network contract
I'm trying to understand the difference between why a swap on, say, Uniswap or some liquidity pool needs gas and must wait to be "included in the next block" and to be confirmed in a few ...
0
votes
0
answers
29
views
Multi token Arbitrage Bot for Dexes
I was thinking of making a program to find & execute arbitrage.
Say we have a 100 token A which we can swap back & forth with 4 other tokens to end up making a profit by combining it with ...
0
votes
1
answer
73
views
Sending transaction to Uniswap/Pancakeswap Router using Nethereum failing
I'm trying to send a transaction to the Uniswap or Pancakeswap V3 router using Nethereum for a token swap via "exactInputSingle", but first I'm performing a gas estimate for the transaction. ...
2
votes
1
answer
46
views
Issues verifying signed data for Permit2
I'm trying to develop an end-to-end system using Uniswap's Permit2 (AllowanceTransfer).
To achieve that, after the Permit2 allowance, I have to sign a message and verify its integrity contract side. ...
0
votes
2
answers
223
views
Ethereum test network for Uniswap
I need to test my contract with Uniswap and I'm facing difficulty in using test networks of Ethereum.
For example, the Goerli faucet wants us to buy actual Ethereum on the mainnet. Besides that, is ...
0
votes
1
answer
25
views
Transaction fails on Etherscan but succeeds on Tenderly, why is that?
So I have made a Uniswap V2 Fork and deployed it successfully, added liquidity etc everything successfully, all on Goerli.
But when I am working on my frontend for my main Swap Component(in ReactJS), ...
1
vote
1
answer
36
views
Does uniswap have ONE liquidity pool per pair?
I'm trying to understand whether Uniswap has one liquidity pool per pair, or multiple liquidity pools per pair, each with slightly differing ratios? Of course the ratios couldn't differ significantly, ...
0
votes
1
answer
106
views
How to create a uniswap pool on goerli with two custom created tokens, tokenA and tokenB?
I am trying to create a node script to create a pool and add liquidity to uniswap with two custom tokenA and tokenB by utilizing the goerli network.
I created the pool using,
const { ethers } = ...
0
votes
1
answer
26
views
How to know the exact AMM implementation for a liquidity pool?
Is every liquidity pool which uses Uniswap V2 using the exact same AMM implementation? i.e. for 2 different liquidity pools, if I know the amount of liquidity (ratio of tokenA and tokenB) in the pool ...
0
votes
0
answers
51
views
How to convert human readable price to sqrtPriceX96 to lowest decimal price in JS for uniswap?
Overview:
I'm trying to convert the sqrtPriceX96 to lowest decimal price and back. Lowest decimal meaning fixed point.
Use case:
The reason I'm doing this is to compute whether the sqrtPriceX96 has ...
1
vote
0
answers
17
views
Can you do a range order in uniswap when the ratio is 1:1?
Let's say we have token1 / token0 and the WETH-USDC pool on uniswap. Range orders may only be performed in the higher priced token above the price and the lower priced token before.
Said differently ...
0
votes
1
answer
38
views
Why does Uniswap use Q notation versus the uint256 ratio price?
Question:
Why does Uniswap use Q notation versus the uint256 ratio price? A price in uniswap is always in token1/token0. Which token is which depends on the hex value assigned by the contract address ...
0
votes
1
answer
39
views
How can i convert Ether from the PoW chain in to Ether on the PoS chain?
I am basically looking to convert the ETHW (proof of work Ether) to PoS ETH ( proof of stake ether )
and i understand that ETHW has no contract address, since it is NOT an ERC-20 token
instead it is a ...
1
vote
1
answer
80
views
Uniswap v3 LP Token Data
If you deposit liquidity into Uniswap v3, you define a min and max price and then send a specific token amount. You receive an ERC-721 token (and NFT) that has an address (eg, https://etherscan.io/...
0
votes
0
answers
18
views
In "simple-arbitrage" code, where does the abi.ts come from? Is this hand written or this is from uniswap provided info?
Where does this abi.ts come from?
I was comparing it with Uniswap code here:
but they don't look the same. Thanks
0
votes
0
answers
17
views
Cant make slippage work with custom linking in uniswap?
Im using this format as an example
https://app.uniswap.org/#/swap?exactField=slippage=500&outputCurrency=0x8686525d6627a25c68de82c228448f43c97999f2
Slippage wont be input automatically, does ...
0
votes
1
answer
153
views
Why can't I remove liquidity from my Uniswap v2 Pool?
Token contract: 0x8b11461af2f7bc36ac3bbaff273b08485abe3bba
Pair contract: 0x01007f8c2e88626932e30fed121e6090be7015a3
I tried to remove my added liquidity through uniswap however, MetaMask doesn't pop ...
0
votes
0
answers
20
views
Transaction is not cancelling on Uniswap
I have cancelled a transaction approval request for DAI stable coin on Metamask, but Uniswap is still waiting for the approval.
How should I cancel the transaction on Uniswap?
0
votes
1
answer
45
views
I can't add liquidity from the contract for testing with hardhat
I want to test some swap functions (swap my token for ETH). In order to do this, I want to test it using Hardhat. For swapping, it needs to have some liquidity so I have to provide liquidity and there ...
0
votes
1
answer
53
views
Need help in flash loan arbitrage project
I am creating a flash loan arbitrage project, where i am using uniswap v3 for first swap, do i need to add code for adding liquidity too? I wrote code just for swap. I know without liquidity we can't ...
0
votes
0
answers
29
views
Problem for claim reward and swap ETH
I want to create a token based on rewards. I am helped by the following contract which uses _rOwned and _tOwned (I put below the functions which are different from this contract and which are the ...
0
votes
1
answer
20
views
Added liquidity on Uniswap but haven't got the LP token
This is the first time I have added Liquidity to uniswap in Matic/DAI pair at 0.3% reward. But when I have added the liquidity uniswap doesn't provide me the LP token which represents that I have ...
1
vote
0
answers
84
views
Can I cut a fee using multicall on Uniswap V3?
I developed my own frontend for Uniswap V3, and I was asking myself if I could cut a small fee of the input token using multicall.
Basically, I would calculate what 2 percent of the input token would ...
0
votes
0
answers
380
views
Uniswap V3 Pool Token with Sell Taxes
Working on a new Token contract using a V3 Uniswap pool for Liquidity.
The ERC20 token has the traditional taxes (reflection, buy,sell etc.)
It seems that it's not possible to have a token with tax on ...
1
vote
1
answer
46
views
Can't understand what "First arguments makes this function a method of mapping(int16 => uint256)." means here
function nextInitializedTickWithinOneWord(
mapping(int16 => uint256) storage self,
int24 tick,
int24 tickSpacing,
bool lte
) internal view returns (int24 next, bool initialized) {
...