New answers tagged uniswap
0
votes
AttributeError: 'exactInputSingle' object has no attribute 'buildTransaction'
I get the answer form github:
'in v6, it's snaked cased as build_transaction()'
from:https://github.com/ethereum/web3.py/issues/1340
0
votes
ERROR: Stack too deep when compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack
This problem usually arises, when you use more than 16 variables in a function at once. To fix the stack too-deep error, you should delete your variables after you do not need them this way:
function ...
0
votes
Accepted
Can I get the result of swap by logs?
There is several transfers happening here, so simply looking at swap event log will not be sufficient.
What you should do is find a transfer event, where sender is the pair contract and the receiver ...
0
votes
How was this liquidity token locked? I can't find any references to the lockNFT function online?
the creator of the midwit token deployed their own nft/lp locker, i believe the original creator of the locker contract is "blurr" (RFD deployer), the contract is verified so you can check ...
0
votes
How to calculate sqrtPriceX96 in solidity?
This way:
const sqrtPriceToPrice = (sqrtPriceX96, token0Decimals, token1Decimals) => {
let mathPrice = Number(sqrtPriceX96) ** 2 / 2 ** 192;
const decimalAdjustment = 10 ** (token0Decimals -...
1
vote
Accepted
Understanding the getAmountsOut functrion, help please
Your understanding of the return signature is correct. In Solidity you can define the return variable in the signature. You can read more here.
TL;DR
getAmountsOut calculates dynamically the swap for ...
0
votes
Accepted
Can't create UniswapV2Pair from constructor on Ethereum Mainnet
The problem was solved when I changed the wallet to one with more ETH (at least twice the amount that needs to be paid for fees for the deployment)
0
votes
Uniswap Range Order Tick Range Question
Summary
If providing liquidity in token 0, tickLower/tickUpper must be above current tick range.
If providing in token 1, tickLower/tickUpper must be below the current tick range.
What are ticks
...
0
votes
Accepted
Issues verifying signed data for Permit2
The issue has been resolved and proved to be nothing but an integration bug caused by an unclear contract API.
The values used to rebuild the hash (e.g. amount, nonce, token address) have to match 1:1 ...
0
votes
How would I be able to set slippage for exactInputSingle on Uniswap v3 and Pancakeswap v3?
I somehow found a way to do this by using the sqrtPriceX96 in the token's pool address by querying slot0. The documentation for this is gone but I've searched and saw other people using this formula:
...
0
votes
What is Ticks on Uniswap?
in uniswap v3 we have concentrated liquidity. User has to decide in which price range s/he wants to have their liquidity gets traded. for this, uniswap has to find a way to decide the price ranges. ...
0
votes
How to calculate all-time global fees, earned by a Uniswap v3 pool?
you do not calculate, it is already in a global state and tracked by the uniswap v3. from the v3 whitepaper
The global state also tracks two numbers: feeGrowthGlobal0 (fg,0 ) and
feeGrowthGlobal1 (fg,...
0
votes
Trying to make sense of Uniswap v3 fees (feeGrowthInside0LastX128, feeGrowthGlobal0X128)
@Crypto_Rachel your code works only when we have defined min and max ticks. When we have position with whole range min tick on NFT image is -887220 but tickLower from positions returns value like ...
1
vote
Sending balance to address
What balance are you talking about ?
If that's your ETH balance, then that's normal. What the first snippet does is that it first sends the whole balance in ETH of your contract. Then you are checking ...
1
vote
Accepted
How to wrap ETH into WETH via ethers.js or web3.js?
Here's the deposit method:
https://etherscan.io/token/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2#writeContract#F5
After calling deposit method, the caller will received WETH equal to the ETH amount ...
0
votes
Sending transaction to Uniswap/Pancakeswap Router using Nethereum failing
It seems that the issue might be with the input parameters being passed to the exactInputSingle function. One thing you can try is to encode the nested array of input parameters manually using the ...
0
votes
Accepted
Swap contract v Lightning network contract
The reason why decentralized exchanges like Uniswap and Balancer require gas fees and confirmation time is because they are built on top of the Ethereum blockchain, which is a smart contract platform. ...
0
votes
Ethereum test network for Uniswap
The Uniswap Interface officially supports the following testnets:
Goerli
Optimism Goerli
Arbitrum Goerli
Celo Alfajores
Polygon Mumbai
Only Goerli is Ethereum test network as such, but the others ...
0
votes
Transaction fails on Etherscan but succeeds on Tenderly, why is that?
Goerli has been super unsteady un unreliable lately. Its gas prices have been through the roof.
Basically Goerli shouldn't be used anymore for testing dapps. Sepolia is the meant network for dapp ...
0
votes
Confused in understanding on tick range in uniswap
Tick index range is [-887272, 887272]. This covers the entire price ranges.
With the base 1.0001, powering it to the tick index i from -887272 to +887272 gives you a huge range:
>>> # python ...
0
votes
Tell me if i understood this line properly
In the context of your code snippet, it's checking for three cases:
a new liquidity has been initialized
the liquidity has been removed entirely
neither #1 or #2
If the case 1 or 2 happens, we are ...
0
votes
Liquidity Pool Addresses
You should consult with their documentations for the latest updates on deployment addresses should there be any change.
For example, you can find deployment addresses in Uniswap documentation.
2
votes
Ethereum test network for Uniswap
Sepolia is the testnet which should be used for testing dapps, including Uniswap. Unfortunately, it looks like Uniswap only supports Goerli (Ropsten and Rinkeby are already deprecated).
As I see it, ...
1
vote
Accepted
Why does Uniswap use Q notation versus the uint256 ratio price?
Uniswap utilizes a fixed-point number representation(Q-notation) to achieve a higher precision.
sqrtX96 means that the variable has been multiplied by 2**96 to guarantee 96 bits of precision during ...
2
votes
Does uniswap have ONE liquidity pool per pair?
It depends if you are referring to Uniswap V2, or Uniswap V3. In uniswap V2, there was one pair contract per erc20 pair. In uniswap V3, there can be multiple pools for each asset pair, defined at a ...
0
votes
How to create a uniswap pool on goerli with two custom created tokens, tokenA and tokenB?
The steps I would take to solve this problem:
Get the smart contracts.Basic ERC20 Tokens can be implemented with OpenZeppelins ERC20 wizard.For Uniswap, you need to interact with the UniswapFactory ...
Top 50 recent answers are included
Related Tags
uniswap × 995solidity × 326
uniswapv3 × 101
pancakeswap × 91
decentralized-exchange × 86
erc-20 × 85
liquidity-provider × 74
web3js × 69
ethers.js × 62
tokens × 60
swaps × 57
contract-development × 53
defi × 51
etherscan × 43
transactions × 41
remix × 41
javascript × 40
hardhat × 38
ether × 37
web3.py × 36
blockchain × 29
python × 23
sushiswap × 23
metamask × 22
truffle × 19