Questions tagged [uniswap]

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

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

Fork uniswap including interfcae

I am trying to fork uniswap. I have successfully deployed uniswap-core and uniswap-periphery on my local machine (ganache).For this, I could get many tutorials and articles. But could not find a ...
0
votes
1answer
15 views

Why did I get such a low swap return on Uniswap?

I used Uniswap router to swap ether for Unisocks, but when I check the transactions details 0xfcba19d84b4f578fcff1dc2378b673af1c5fa54e422555f27fd2ac6b46fc21ae, I'm getting much less $SOCK's than what ...
1
vote
2answers
65 views

Can anyone tell me the names of known uniswap v2 forks?

im compiling a list and i need to know the names of as many uniswap v2 forks. Only ones that exist on the ethereum mainnet. i know of sushiswap, sakeswap and defiswap
0
votes
0answers
9 views

Uniswap Fork: Able to add liquidity, but not able to swap

I am forking uniswap and deploying it on Rinkbey TestNet. I have successfully deployed factory, router, weth contracts. I have replaced the respective addresses in the uniswap interface code. I ...
0
votes
0answers
6 views

UniswapV2Router swapExactETHForTokens Fail with error 'EXPIRED' after deadline is reached

I am having a hard time creating a contract that uses the swapExactETHForTokens function. I intend to create a contract that receives ETH and then any user can swap those ETH for a specific token ...
0
votes
1answer
596 views

Transaction Failed when I try to swap BNB for CAKE using swapExactETHForTokensSupportingFeeOnTransferTokens

I'm trying to swap on Pancakeswap for BNB for CAKE, but I've been running into an error. The error reason says, "transaction failed" code: "CALL_EXCEPTION". Been at it for a ...
0
votes
0answers
13 views

Quickswap router function error when liquidity is added on WMATIC pair

i've been trying the functions from the router using the web3.py library. However am getting into troubles when calling the function with a WMATIC/Token liquidity pair and using USDC as currency to ...
0
votes
0answers
10 views

How to determine current(=pending) Uniswap V2 Pair's price?

Are there any ways to get the current/latest price of an Uniswap Pair (V2)? I've understood that getReserve and getAmountsOut calculates the the return values based on the latest mined block? But for ...
0
votes
1answer
9 views

Uniswap/PancakeSwap Fork Fees

I am currently working on a Uniswap V2 fork. However I am somewhat confused as to how to set the fees to my liking. I need help finding the contract and function in the contract to set the fees to my ...
0
votes
0answers
15 views

don't understand specific line of code in UniswapV2Pair.sol, swap function: “amount0In”

For those familiarized with the code in UniswapV2Pair.sol, I don't understand the following line: uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0 ...
1
vote
2answers
2k views

UniswapV2 addLiquidity revert ds-math-sub-underflow

I'm trying to use Uniswapv2Router with Truffle and Ganache, but haven't been able to identify what I'm doing wrong. I'm using addLiquidty method as follows: await uniswapV2Router02.addLiquidity(token0....
0
votes
0answers
15 views

Uniswap v2 running out of gas when deploying the Factory on ganache

I am trying to deploy the Uniswap v2 Factory contract on my ganache test network. I have compiled these contracts with my own compiler. But everything I attempt to deploy the Factory, I receive this ...
0
votes
1answer
30 views

Testing Token with Uniswap liquidity provisioning using hardhat

I'm attempting to fork Safemoon (or really NotSafeMoon), and use it as a vehicle to learn smart contract development. (I've got a substantial amount of what you might call "Web 2.0" dev ...
0
votes
1answer
182 views

Buying directly from smart contract at the the same block the liquidity is provided

I am trying out buying new listing from uniswap but bots always rally the price so high that it just doesn't make sense to enter until the market is fully cooled off. I have found and application ...
0
votes
0answers
51 views

bot sniping tokens on pancakeswap by watching the mempool

i seen a video on youtube of a sniper bot buying tokens as soon as the token launches on pancakeswap and gets in on the same block. i have tried to use another bot that buys the tokens when the pair ...
0
votes
1answer
110 views

Getting the balance of a token in wallet - decimal issue

Im trying to get the balance of a certain token from a wallet address in order to then swap out those tokens. The problem i have is that the code returns the tokens where the decimal point is out ...
1
vote
1answer
53 views

How can we fetch the current market price to our DEX?

We are fixing the price at the time of creating pair for our token with BNB by adding liquidity. If the Price of the BNB/BUSD. How can we fetch the current market price and update in our DEX? Is there ...
0
votes
0answers
17 views

Fee on transfer causing error “Uniswap invariant not satisfied”

I am working on building an ERC20 token with the help of the OpenZeppelin project. I wanted to add a burn fee on transfer, so I overrode my transfer function as follows: function transfer(address _to, ...
1
vote
0answers
21 views

Are all of these Dexes just frontend interface to coin swapping contracts? Uniswap, 1inch, balance defi-swap, shibaswap, etc

I'm still wrapping my head around all these swapping services like Uniswap, sushiswap, etc... Uniswap Sushiswap 1 Inch Balancer Defiswap Shibaswap Are all those above just front end interface to ...
0
votes
0answers
18 views

How to force uniswap to use swapExactTokensForEthSupportingFeeOnTransferTokens

Im coding an erc20 token for a client of mine and it uses dynamic taxes on buys and sells These values are calculated in memory with _tmpFee and then assigned to the value _fee in storage Then ...
0
votes
0answers
11 views

Getting fail reason for tokenswap transaction with ethers.js [duplicate]

i am trying to execute uniswap v2 tokenswap function from node.js using ethers.js How can i get the reason for transaction fail ? Listening to transaction being mined i get only the status (1 for ...
0
votes
1answer
47 views

QuickSwap transaction reverts on Polygon

I'm attempting to swap USDC for DAI using Web3JS and QuickSwap on Polygon, but the transaction always reverts and I have no idea why. I have tried different value amounts in the transaction without ...
4
votes
2answers
1k views

How can I fetch current pair prices through uniswap-v2 API?

I need to quote online prices of different token pairs through uniswap-v2 API. As the below picture shows, I tend to pass token pair (maybe with base token desired amount) to the API and get all price ...
3
votes
3answers
1k views

How can I get wrapped Ether on Rinkeby?

The rinkeby faucet only seems to have an option for ether. I'd like some weth so I can test Uniswap v2. Anyone know where I can get some? Thanks!
0
votes
1answer
20 views

What were the first DEX on Ethereum and what happen to it compared to how Uniswap is now?

I'm doing some history on the rise of DEXes and wanted to get an idea of what was the first DEX on Ethereum or some other blockchain. I know that Etherdelta was one of the first DEX back in the day, ...
0
votes
1answer
97 views

Pancake/Uniswap: tell inside contract if a transfer is a buy or sell

I have a token contract that will exclusively use Pancakeswap as trading platform. How can I tell in the contract if a transfer represents someone buying the token or someone selling it?
1
vote
0answers
15 views

How does Balancer work compared to Uniswap?

Uniswap is for trading tokens, but what is Balancer use case? And what other competing platforms are there that does what Balancer does?
0
votes
0answers
13 views

Uniswapv3 IQuoter revert

I'm trying to use uniswapv3 IQuoter to get a quote: IQuoter iQuoter = IQuoter(0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6); // quoter address address sellingAddress = ...
0
votes
1answer
57 views

Finding Uniswap v3 Token Reserves

In Uniswap V2, we can use SYNC event to monitor the reserve changes in a pool for token0 and token1. How can we do the same with Uniswap V3? If it can't be done through any event, what function can I ...
0
votes
1answer
27 views

Trying to understand Etherscan output for token swap via Uniswap

I am trying to understand a token swap transaction via Uniswap on Etherscan. Looking at the Uniswap V2: Router 2 contract for a transaction, I see the following; My question is regarding the second ...
0
votes
2answers
112 views

Why swapping some tokens require more gas fees than others?

I noticed that swapping some tokens in Uniswap to exactly the same amount of ETH, at the same time, has much higher gas fees than other tokens. Why is this? Aren't the swap transactions identical for ...
0
votes
1answer
101 views

Confusion around AmoutOutMin with swapExactETHForTokens call

I don't understand the paramater AmountOutMin for this function. From the docs, it seems that the call will fail, if the amount specified by this parameter, is not transferred to the user. However, in ...
1
vote
1answer
586 views

Uniswap fork: remove liquidity error

I am trying to fork uniswap. And I have a problem when liquidity is removed. Problem in UniswapERC20. I don't know what's wrong. Step by step (repeatedly for Rinkeby and Ropsten): Copy Uniswap ...
3
votes
2answers
3k views

How to select a different Metamask address when using Uniswap?

I want to use Uniswap with my hardware wallet. So I go into my Metamask wallet, connect to my hardware wallet, I see my coin balance, then I open Uniswap. The trouble is that Uniswap is showing an ...
0
votes
1answer
242 views

Uniswap Approve Succeeded But No ETH Returned in “Swap”

I attempted to swap some eMax (using the Uniswap Swap feature) for ETH and the Approve went through, in the end I received another token (old version of token before hard fork). It seems to be the ...
0
votes
1answer
268 views

Calculation of Uniswap Pair address

I want to know the address of an Uniswap pair contract with Solidity, even if the pair doesn't exist yet. I can't use the function getPair of the factory contract because it return 0 when the pair ...
0
votes
1answer
69 views

Uniswap web3 python

Hi everyone I am getting the error below when I try to write to a Uniswap function using web3 in python. I can call any function, but I cannot get python to write to uniswap except to add liquidity. ...
0
votes
1answer
36 views

Fail with error 'TransferHelper: TRANSFER_FROM_FAILED', all gas used up

I'm trying to buy some CHY with USDT on Uniswap main net, fails with error 'TransferHelper: TRANSFER_FROM_FAILED', This is my failed tx link. This is a successful tx link from someone else. I notice ...
2
votes
1answer
302 views

Uniswap Router deployment error: “UniswapV2Router02” — Cannot create instance of UniswapV2Router02; no code at address 0xxxxxxxxx

I am trying to fork Uniswap and deploy on Ropsten testnet for educational and testing purposes. From what I gathered, it seems that we need to first deploy the UniswapV2Factory contract, followed by ...
1
vote
2answers
100 views

Trying to make sense of Uniswap v3 fees (feeGrowthInside0LastX128, feeGrowthGlobal0X128)

I'm trying to figure out the uncollected fees for my Uniswap v3 position programmatically. If I interpret the v3 whitepaper correctly it should be liquidity multiplied by the difference of ...
0
votes
0answers
79 views

Function swapExactTokensForETH Not Work For me only since MY CONTRACT

I have a written contract in which I use functions like swapExactETHForTokens in a payable way. This one works for me. When I try to execute the non-payable function of swapExactTokensForETH from my ...
0
votes
0answers
17 views

Query first 30 swaps for given Uniswap pair using API

According to the Uniswap v2 Docs, the following query fetches the latest 30 swaps for all pairs in the array allPairs: query($allPairs: [String!]) { swaps(first: 30, where: { pair_in: $allPairs }, ...
0
votes
1answer
46 views

deadline expired long ago, but the transaction is still pending

I made a transaction on uniswap, with code like: const provider = ethers.getDefaultProvider('mainnet', { infura: INFURA_ID }) const signer = new ethers.Wallet(MY_WALLET_PRIVATE_KEY) const account ...
0
votes
1answer
29 views

Smart contract to exchange old bep20 tokens for new ones

I've created two Bep20 tokens (old/new) and I was wondering if I could write a smart contract that exchanges/swaps old tokens for new ones. Is there a simple way to exchange two Bep20 tokens using a ...
1
vote
1answer
1k views

How to find out if a token takes a fee on transfer?

I'm trying to find out if there is a way programmatically (using web3) to check if a token takes a fee on transfer, such as the ones that require the swapExactETHForTokensSupportingFeeOnTransferTokens ...
0
votes
0answers
84 views

How to calculate Uniswap v3 liquidity

How to calculate liquidity in uniswap v3 ? Please dont send me whitepaper, only explain mathematically. For example; ETH/USDC pool output (14/07/2021) is the following sqrtRatioX96: JSBI(4) [ -...
1
vote
1answer
33 views

How to predict profit from swapExactEthforTokens to swapExactTokensforEth?

I am using Python and web3.py. I have to swap eth to tokens using swapExactEthforTokens in Uniswap. And then I have to tokens to eth using swapExactTokensforEth in Uniswap. How do get calculate profit?...
0
votes
0answers
39 views

BigNumber.from overflow when swapExactETHForTokens

I'm trying to swap 0.1 Eth to buy LINK token, don't know how to write the parameter "amountIn", my code: const amountIn = 100000000000000000 // 0.1 * 10^18 == 0.1 Eth const trade = new ...
0
votes
1answer
43 views

How to get a token pair's entire uniswap trade history?

I'm trying to query the entire transaction history of a given pair (e.g. WETH/USDT). Hence, this question is similar to How to get a token pair's uniswap trade history? My approach is to use the ...
0
votes
0answers
20 views

How to OPTIMIZE input amount ETH and return TOKEN output amount to exchange in Uniswap

I am in the situation that I want to make a change from ETH -> DAI on the Uniswap platform. As is known, depending on the amount of token in this case ETH introduced will change the return of the ...

1
2 3 4 5
9