Questions tagged [uniswap]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
22 views

What is bsc testnet node address?

i am making a swap system. I do it on binance smart chain network. What are test nets? I examined it on the binance official page, but I could not reach a clear conclusion. What I got in the comment ...
0
votes
0answers
18 views

UniswapV2Router02.addLiquidity false Transaction mined but execution failed

The two tokens have been approve to the router contract, but they always fail when the addLiquidity method is called. "false Transaction mined but execution failed" is displayed in remix. ...
1
vote
1answer
43 views

How can I calculate the gas fee of a swap on Uniswap?

According to gas tracker on Etherscan the average gas price is 212 gwei and the average Uniswap swap estimate is $70.26 which implies that the gas fee is around 201101. To my knowledge swap gas fee is ...
1
vote
0answers
11 views

GraphQl Query to get Uniswap OHLC data through The Graph

I tried searching through whole doc of The Graph but couldn't get a way to get OHLC data of Uniswap pair swaps. Where can I find such a query. Is this even possible? Thanks
1
vote
1answer
26 views

Uniswap: Fail with error ‘Dai/insufficient-allowance’

I am trying to deposit kovan DAI to my smart contract by using transferFrom of the ERC20 function, but I get an Dai/insufficient-allowance. So I tried approving it explicitly and then trying to ...
1
vote
1answer
23 views

How does uniswap process so many transactions on the clogged ethereum network?

According to info.uniswap.org, the number of uniswap transactions in the last 24 hours was 136,383. This amounts to approximately 136383 / 24 / 60 / 4 = 24 transactions per block. It appears that with ...
0
votes
1answer
22 views

What decides about the position in the block? [duplicate]

All these transactions happened within the single block: Source: https://etherscan.io/defi?q=0x8a40c222996f9f3431f63bf80244c36822060f12#dextracker Right now it is still possible to get to the initial ...
0
votes
0answers
31 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 ...
-1
votes
1answer
39 views

Add liquidity to Uniswap pool with Web3

I am trying to add liquidity to Uniswap on the Ropsten network using Web3. My JavaScript code is as follows: (async () => { console.log("account: ", this.state.account); const ...
0
votes
1answer
11 views

how to correctly calculate amountTokenMin and amountETHMin for UniSwap removeliquidityeth?

https://uniswap.org/docs/v2/smart-contracts/router01/#removeliquidityeth How do i safely/correctly calculate the amountETHMin and amountTokenMin when calling this function from a contract? I could ...
0
votes
1answer
13 views

Uniswap: How do I distinguish between selling tokens and providing liquidity?

I want to implement different behavior in the transfer function of an ERC20 token if the transaction is swapping the token for ETH on Uniswap. The straight forward approach is, to check whether the ...
0
votes
1answer
15 views

Is uniswap supply and demand model opposite of other exchanges

Let's say we have an ETH/USD pair. Normally, I would expect that if more people are buying ETH than selling ETH, the price of the pair goes up. This is because there is more demand for ETH, but the ...
0
votes
0answers
15 views

Error: No “from” address specified in neither the given options, nor the default options. When tried swap token to ETH

I get the following error: "Error: No "from" address specified in neither the given options, nor the default options." when I try to use this function from Uniswap: ...
0
votes
0answers
13 views

Web3 + Truffle, is this the correct way to approve a spend?

I have created an ERC20 token using Web3, Openzeppelin and Truffle, and minted some tokens. const LToken1 = await ERC20.new('Test L Token 1', "TEST1", web3.utils.toWei('1000000')); I would ...
2
votes
1answer
62 views

Uniswap ETH to Tokens to ETH swap function

UniswapV2Router02.sol has 2 interesting functions which i'd love to combine swapExactETHForTokens and swapExactTokensForETH. Basic idea is arbitrage from ETH to tokens and back to ETH. As far I ...
1
vote
1answer
39 views

How to know the amount of ETH in the liquidity pool

I'm currently trying to find a way to know the amount of ETH inside the liquidity pool. That would be by using Uniswap V2. A pair would be ETH/Some other ERC20 token. My idea was about using ...
1
vote
0answers
18 views

Uniswap GUI on forked mainnet

I have created a forked mainnet in Ganache which is working well using the CLI. However I would like to have access to the UNISWAP GUI. If I open Uniswap and change my metamask settings to localhost, ...
0
votes
0answers
11 views

issue encounter when use swapExactTokensForETH

I try to "swapExactTokensForETH" I know that for this work you need to "approve to the router" so i when i call uniswap.approve(to, amountIn) it return Error: cannot estimate gas ...
0
votes
1answer
20 views

Sequential swaps on dexes

I wrote a smart contract in solidity to swap ERC20 tokens on different exchanges, however I'm still stuck on how to get my transaction to go from one dex to another without having to use my smart ...
0
votes
0answers
20 views

I lost 2 ETH! I successfully cancelled my transaction, but the 2 ETH was never returned

public address: 0x6ac5EF890224e2699a89810F0bd2DED90d74Ab37 first Hash tx: 0xfeb6c486a8f17a8b4216bbd2069429a285a1c5da8d15e98d3d66e6bf5488a866 I tried to swap for a coin on uniswap, but it took 7 hours ...
1
vote
1answer
36 views

How is Uniswap Liquidity added?

I bet this is a simple answer, but I'm just unable to fully understand. Uniswap has liquidity. It can be added. But what function does it uses? the Transfer() one from the contract ? I'm trying to ...
1
vote
1answer
55 views

Why is it so much cheaper to buy/sell/convert on CoinBase than Coinbase Wallet or Uniswap?

I just recently started using Coinbase Wallet (which I will from now on refer to as just Wallet) and connected it to Uniswap to be able to buy some Celsius. I have some various coins on Coinbase (not ...
1
vote
0answers
15 views

Uniswap: How to find volatility tokens for trade? [closed]

Is there any API calls to find volatility tokens for trade on Uniswap?
1
vote
1answer
26 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 ...
0
votes
0answers
17 views

swapped eth for utk on uniswap- etherscan shows completed but uniswap still pending and i utk doesn't show in wallet!

help anyone? i'm new to uniswap. i swapped out eth for utk and my transcation was "dropped and replaced" by transaction hash ...
1
vote
1answer
57 views

Adjust slippage tolerance in Uniswap programatically

I've been able to do swaps through Uniswap's peripheral smart contract Router 02 by calling any of the functions such as: function swapTokensForExactTokens( uint amountOut, uint amountInMax, ...
0
votes
0answers
19 views

Why output value of Uniswap-2 SDK for token prices is different than those on its site?

I use fetchPairData method from uniswap-v2 SDK to quote two tokens conversion rates: const uniswapPair: Pair = await Fetcher.fetchPairData( new Token(ChainId.MAINNET, baseToken.address, 18), ...
0
votes
0answers
55 views

Error: VM Exception while processing transaction: revert UniswapV2: LOCKED

I am using this repo to begin testing UniSwap flash swap contracts. I've installed all dependencies correctly and cleanly. The project uses ganache-cli, hardhat buidler, and yarn in the terminal and I ...
0
votes
0answers
241 views

Unable to swap scam token on uniswap

I think I have been scammed with a fake token on uniswap. Yesterday I bought a safepal token in exchange for ethereum. After I started to suspect I tried to swap back the safepal token to ethereum. ...
1
vote
1answer
46 views

I got “sandwich attacked” on my transaction

I see a new kind of arbitrage bot today. As per my research we call that "sandwich attack" ... Here how the user proceed : I buy for 7.8ETH of a token, and it look like a bot is buying ...
0
votes
1answer
23 views

How to get the price of a pair using only its symbol?

Is it possible to get the price of a pair using graphql for uniswap without knowing its id? I use this website to try things out: https://thegraph.com/explorer/subgraph/uniswap/uniswap-v2 For example, ...
2
votes
1answer
6k views

Why is it so expensive to trade on Uniswap with MetaMask? ($50 fee)

The best quote that the Uniswap fox found for swapping 1 ETH for UNI token right now has a $50+ estimated transaction fee (max $80) inclusive of a 0.875% MetaMask fee. Even if I change the swap to a ...
1
vote
1answer
52 views

What programming languages was Uniswap's open-source code written in?

Uniswap is a decentralized exchange that is actually a decentralized app where people can trade ERC-20 tokens without a middleman. Uniswap's code is open-source: https://github.com/Uniswap Was the ...
0
votes
1answer
221 views

Dropped and replaced transaction still showing pending on UNIswap

I checked some of the answers given to a similar question but none of them helped to solve my situation, hence I am writing it down. My transaction's status is now "Drop and Replaced" but it ...
0
votes
1answer
18 views

Are liquidity pools the decentralized exchange equivalent of storing assets on centralized exchanges?

We'd think that decentralized exchanges are just the same as centralized exchanges in terms of functional purposes which are trading storing crypto assets However, the second item is not readily ...
0
votes
0answers
41 views

Using Uniswap for trading ERC-721 or ERC-1155 Tokens

Is it feasible to use Uniswap for buying and selling NFT's (ERC-721) or Semi-NFT's (ERC-1155) tokens? It would seem to me that it could be an easy way to implement a DEX for unique digital assets with ...
0
votes
0answers
28 views

In uniswap v2 periphery, how does the contract fetch token pair address?

function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address(uint(...
1
vote
1answer
188 views

INSUFFICIENT_OUTPUT_AMOUNT error when attempting Uniswap swap from a contract

While I'm able to successfully swap ETH for DAI, I'm running into an INSUFFICIENT_OUTPUT_AMOUNT error when trying to swap DAI for ETH using swapExactTokensForETH, even with amountOutMin set to 0. I ...
1
vote
0answers
16 views

Is this diagram from Uniswap's documentation correct?

Denote respectively rA and rB the reserve of Token A and Token B. Let f = 1 - fee (i.e. 0.997) and x be the input amount. Then the price function of Uniswap v2 for a pair (A, B) is P(x) = (rB * x * f)/...
0
votes
0answers
36 views

How to use path (address[]) correctly when interacting with the Uniswap V2 Router

I'm trying to use Uniswap V2: Router 2 https://etherscan.io/address/0x7a250d5630b4cf539739df2c5dacb4c659f2488d#writeContract As a test example I am looking to swap 10 RFI (contract address: ...
0
votes
0answers
50 views

Uniswap SDK `new Percent` returns different object than JSBI

I have this snippet that gets the slippage of the input. The issue is the new Percent returns different object than the expected JSBI object const TOKEN = new UNISWAP.Token(UNISWAP.ChainId.MAINNET, &...
3
votes
1answer
348 views

How Do Sniper Bots Really Work?

If you ever traded in defi, you probably have seen coins getting sniped at the very second of their launch and drastically inflating the prices. I assume these bots are written in js, ad using web3 ...
0
votes
0answers
13 views

Uniswap V2 removeLiquidity

I am able to add liquidity and remove liquidity on uniswap, but I am having trouble calculating the min values for the token pairs. For removing liquidity I am trying to get the amount of each token ...
1
vote
0answers
39 views

'dropped and replaced' ETH still missing

I have an ETH transaction that is listed as 'dropped and replaced' on Etherscan: https://etherscan.io/tx/0x98640241cd77a4c1301c8522851ec07508ac783239c643a4a3c13b1dc55d9ea1 On Uniswap it shows as ...
1
vote
1answer
47 views

What is the sequence of events when a transaction is made on Uniswap?

I elect to swap 100 UNI for 700 USDC on UniSwap, but with a low gas fee. In 1 hour, the price of 1 UNI has dropped significantly. would the pending transaction still swap for 700 USDC (as long as ...
0
votes
0answers
18 views

Lost beween useWeb3ReactCore and getWeb3

I am learning Solidity and DAPPs. I have tried to create a project with truffle, with this command: $ truffle unbox react Here is what i see in generated code: import getWeb3 from "./getWeb3&...
0
votes
0answers
43 views

i need some help transfering funds back into my account from a smart contract i accidentally sent funds to

i was using uniswap and i thought i was easily transfering one token into another and somehow i put myself into a smart contract and cant get my funds back.... yesterday i had figured out with the ...
1
vote
1answer
81 views

Instantiating a smart contract in Uniswap using assembly and create2

I am studying Uniswap source code and there is something I do not understand in this file: https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2Factory.sol: This factory can ...
0
votes
0answers
36 views

How to get balance a wallet has in a Uniswap pair

I'm trying to get the balance of my wallet in a Uniswap pair. I have found how to get the initial balance when I first added liquidity using https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2 ...
0
votes
0answers
94 views

Always same INSUFFICIENT_OUTPUT_AMOUNT error

I've been trying to swap some DAI which I sent to the contract to WETH. However even after trying to change the contract a bit I always get the same error output: transact to GibIhmHart.runUniswap ...