Questions tagged [uniswap]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
59 views

what is math for uniswap calculates the amountout and amountin why 997 and 1000

function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {//the amount of user,amount in pool,output token amount in pool require(amountIn > ...
1
vote
1answer
113 views

How my tx become a flashbots / private transaction?

I did swap on Uniswap today, and realized that my tx is frontrunned and it become a flashbots / private transaction. Here is the tx https://etherscan.io/tx/...
1
vote
1answer
82 views

How does flash loan lender know you are not able to pay it back?

Basically I am wondering how does it know when the loan is not paid back. I understand this is easy to check but how can it revert the transaction? For example let's say I borrow 1M USDT, and then I ...
1
vote
1answer
3k views

Scam input token cannot be transferred on Uniswap

I've been seeing this pop up quite a bit recently. Scammer creates a ERC token with the name of something popular - Shiba or Kishu. Adds alot of liquidity to the pool but once you buy the token you ...
1
vote
1answer
20 views

Can two addresses ever have the same sorting value?

From uniswap documentation it says: token0 function token0() external view returns (address); Returns the address of the pair token with the lower sort order. token1 function token1() external view ...
1
vote
1answer
594 views

ethers gasLimit gasPrice

I am a noob.. I am trying to set gasPrice and gasLimit since I am getting a gas estimation error. I just don't understand where/how to insert it into the transaction. This is on the BSC network. ...
1
vote
1answer
62 views

Errors when trying to purchase tokens

I'm trying to buy tokens and I'm getting an error and failed transaction. It's taking the gas fee and then failing. I've attached the contract and the errors from etherscan and error from terminal. ...
1
vote
2answers
247 views

How does Uniswap allow a user to specify which tokens the user wants to swap in this low level function?

I'm looking at the function swap that allows a user to swap token0 for token1 from Uniswaps UniswapV2Pair contract - https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2Pair.sol. ...
1
vote
1answer
365 views

How to add Uniswap liquidity fees for each transaction?

I know how to implement a tax/fee on each transaction. What I'd like to know is where to send the tokens? Is the liquidity pool simply an address I can redirect the taxes to? Do I have to use some ...
1
vote
1answer
7k views

Cannot estimate gas error on Uniswap / Sushiswap

I'm trying to swap at Ropsten network some tokens for testing purposes, but I'm getting the following error: Cannot estimate gas. It's curious because when I transfer from one wallet to another ...
1
vote
1answer
483 views

How to get token amounts in a Uniswap Liquidity pool?

I've searched and found a couple examples, but they don't seem to work anymore with the uniswap API. I'm looking to get the liquidity amounts of 2 tokens in a uniswap pool, and found through the ...
1
vote
1answer
153 views

Can someone please help me understand address(this) in Uniswap liquidity

So I'm learning Solidity in creating a new token. I successfully created a token and implemented custom tax and burn functionalities. Now I'm trying to understand the Uniswap liquidity features. The ...
1
vote
1answer
28 views

Uniswap, what is it used for?

I just came across uniswap recently. I know that it is a trade pool of two tokens that get their pricing from being put against each other with people buying one token with the other token as currency,...
1
vote
1answer
5k views

Uniswap/Pancakeswap SWAP swapExactTokensForTokens / swapExactETHForTokens FAILED (Sniping Bot)

I'm a beginner and for the past few days I have tried to recreate this tutorial: https://www.youtube.com/watch?v=a5at-FEyITQ At first I tried to implement it on PancakeSwap, but got a Transaction ...
1
vote
1answer
549 views

Uniswap 'PairCreated' Event Listener Temperamental

Can anyone deduce why this doesn't show me all the PairCreated on Uniswap? It seems odd as I have seen it work once or twice during the day and ouput a log for a 'PairCreated', but I know there are ...
1
vote
1answer
262 views

Fetch price data: on-chain oracle vs smart contract function

I want to get the latest and most accurate price data from Uniswap and found out that I can either call the getAmountsOut() function which gives me the amount of tokens I will get in return of a given ...
1
vote
1answer
470 views

If Uniswap's domain goes down, how can we remove our tokens from a Liquidity pool manually without a front end interface?

Let's assume Uniswap's domain and front end interface is taken down. How can I as a user manually remove my tokens from a liquidity pool? What do I need and todo?
1
vote
1answer
1k views

How did this address steal my Ethereum ERC-20 Tokens using Uniswap? 0x2b5b060d57b1333c9b2739e9c15b039726dd51ec

I was using my Trust wallet on my mobile and tried to do a swap from ETH to an ERC20 token but realized a day after that it got drained to this account: https://etherscan.io/address/...
1
vote
1answer
439 views

Was Uniswap a DAO even before it had it's governance token, the UNI?

A Decentralised Autonomous Organization is governed by a governance token. So democratically, everybody who owns the token could vote on proposals and submit proposals too for the whole DAO. Uniswap ...
1
vote
1answer
690 views

Can't use Uniswap contract function 'swapExactTokensForETH'

When using Uniswap function swapExactTokensForETH() I get the following error: 'TransferHelper: ETH_TRANSFER_FAILED' Contract code: pragma solidity 0.8.0; import "https://github.com/Uniswap/...
1
vote
1answer
130 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
3k views

Why isn't Polka Dot listed for trading on Uniswap?

Uniswap is the leading decentralized exchange for many ERC20 tokens. DOT is an example of such a token I'm guessing since it's a self-declared complementary extension of the Ethereum ecosystem, so why ...
1
vote
2answers
1k views

Always get `Dai/insufficient-allowance` error

Scroll for EDIT I'm using Solidity 0.7.5 and I'm trying to swap DAI to ETH from my account, through UniswapRouter02. Here's my environment REMIX IDE Metamask with KOVAN testnet I have about 2 ETH and ...
1
vote
2answers
4k views

How to use swapExactETHForTokens in smart contract?

I want to use use swapExactETHForTokens in my smart contract, always fails transaction with error which is "execution reverted: UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT". This is my code. ...
1
vote
1answer
77 views

Uniswap V1 Calculation of token_amount When Adding Liquidity

In the Exchange contract of Uniswap v1, the addLiquidity function involves calculating token_amount using the formula token_amount: uint256 = msg.value * token_reserve / eth_reserve + 1 Why is there ...
1
vote
1answer
5k views

How to calculate the number of tokens owned by the liquidity pool via bonding curve on Uniswap?

I know a little bit about the Uniswap, providing liquidity, bonding curves... But I'm still struggling to perform the actual math - what is the actual formula? Real-life example (easier to operate on ...
1
vote
1answer
378 views

Why transaction fees depend on DEX?

Since today ETH transaction fees become so high, I (and possibly many people) want to save money by reducing these fees. I notice that transaction fees are cheeper in some DEXs compared to those of ...
1
vote
1answer
546 views

Token addresses for DAI , USDC and WBTC for IUniswapV2Router02

I have searched a lot but maybe I am looking in the wrong places. Please how can I get the token addresses for USDC , WBTC and DAI that work with Uniswap Router02 on mainnet and kovan. Thanks
1
vote
0answers
22 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 ...
1
vote
0answers
16 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?
1
vote
1answer
35 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?...
1
vote
0answers
37 views

Uniswap V2 AmountIn Calculation Procedure

So, I was working on a project which heavily uses uniswap. I have to show the calculations and derivations of stuff that is happening inside uniswap. So, I was reading it's whitepaper, seeing it ...
1
vote
1answer
84 views

Which method will return the liquidity list provided by user?

I am new to the DEX development. Am using pancakeswap router contract https://testnet.bscscan.com/address/0xd99d1c33f9fc3444f8101754abc46c52416550d1 Using ethers.js to call contracts. addLiquidityETH ...
1
vote
1answer
25 views

Find LP token for a pair using UniswapV3

From Uniswap docs: function getPool( address tokenA, address tokenB, uint24 fee ) external view returns (address pool) What does the "fee" parameter means? and how do you ...
1
vote
1answer
88 views

UNISWAP/PANCAKESWAP get list of LP holders of a token

Is there a simple way to get a list of LP-holders for a particular Uniswap/Pancakeswap pair? I need to know the addresses of people who has provided liquidity for my token (which has been already ...
1
vote
0answers
96 views

@uniswap SDK — how do I figure out the best route for a SWAP? How do do multihop with SDK?

I'm calling UNISWAP SDK to price a trade on pair like USDC, PAX and getting significantly worse results than the UX: const sourceToken = new Token(ChainId.MAINNET, source_token_address, ...
1
vote
0answers
18 views

Required mods to make RFI compatibel with Uniswap V3

An RFI contract: deducts a transfer fee "reflects" fees to users (redistribution) efficiently. This has the effect of increasing user balances passively and (potentially) unexpectedly. ...
1
vote
0answers
15 views

what should golang abi.pack argument looks like compared to solidity function

The following code is a popular solidity ethereum function function: swapExactETHForTokens(uint256 amountOutMin, address[] path, address to, uint256 deadline) what should amountOutMin type look like ...
1
vote
1answer
42 views

Uniswap Liquidity Not Showing (please advise)

We created a meme token. Added it into the ERC20 blockchain and then went to add it to Uniswap. Can someone please advise as to why the coin was succesfull being added to Uniswap, but will not allow ...
1
vote
0answers
137 views

Where to find uniswap v3 ABI and swapExactTokensforTokens

With the new version of uniswap (V3) I cannot find the router03 ABI on this page https://uniswap.org/docs/v2/smart-contracts I am trying to find the equivalent of the function getAmountsOut in V3 abi. ...
1
vote
0answers
114 views

Abitrage with dydx flash loan always reverted

I have a smart contract that get flashLoan from dydx and arbitrage between Kyber and Uniswap. I have another javascript code that wait for a good opportunity between this tow dexes. If there is an ...
1
vote
0answers
13 views

How to get a price for Uniswap three legged trade

Hi i see that this question has been asked a few times but no direct answer is there anywhere. I want to get the path through which a swap can take place between any 2 tokens, even if the pool dosent ...
1
vote
0answers
103 views

How to understand the Uniswap V3 swap fee calculation

i read the whitepaper and the code about uniswapv3. but i am still confused about uni-v3 swap fee calculation. i can‘t understand 3 formula qustion1 cant understand Tick struct field ...
1
vote
1answer
61 views

Why we sort tokens in uniswap functions?

function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES'); (token0, token1)...
1
vote
0answers
38 views

Timestamp of when address received a token

Trying to find a way or documentation in obtaining the timestamp of when an address received the token in a smart contract. I have read many reflection based contracts that apply different levels of ...
1
vote
0answers
45 views

How are tokens priced when traded in quantities on Uniswap?

I’m new to cryptocurrency and have gone through the entire documentation for Uniswap, but unfortunately still can’t seem to find an answer to this question. I’ll describe my question in this ...
1
vote
1answer
164 views

Ethers js estimateGas() without needing ETH in account

I am trying to estimate the gas used for a uniswap transaction. I am able to perform this on the Kovan testnet however when I try and run the same script on the mainnet it raises an error, "Error:...
1
vote
1answer
97 views

Failing Token to Token Swap Contract Using Uniswap

So I've been struggling to get a working swap contract that swaps an exact token for a token via uniswap. I have multiple versions at this point, as I've tried several different approaches. After ...
1
vote
0answers
6 views

What's effective rate when one of the reserves is 0?

In this transaction, ECT/WBNB reserves were: reserve0: 0 reserve1: 316227766034 given that WBNB/ECT rate is calculated by dividing reserve1/reserve0, what does it make the spot price of the token?
1
vote
0answers
37 views

pros/cons for creating own custom contract router

I have seen some people (bots?) using custom routers/contracts for trading and tried to google this why someone wants to use custom router instead uniswap/pancakeswap. I wonder if someone here knows ...

1 2
3
4 5
9