Questions tagged [uniswap]

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

Filter by
Sorted by
Tagged with
14
votes
3answers
9k views

How to infer token price from ethereum blockchain UniSwap data?

I would like (if possible) to infer a token price from the blockchain using UniSwap data. After reading the following article, I understood that it is feasible: https://blocklytics.org/blog/uniswap-...
5
votes
1answer
10k views

How do fronrunning and sniper bots 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 ...
3
votes
1answer
2k views

What token address do I use if I want to sell an ERC20 token on a different exchange? Its original address or its address on the other exchange

I really need help with this one to avoid logic errors. I am on the Kovan testnet. I bought 4 units of DAI token on Uniswap exchange(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D) for 0.111 Ether and ...
3
votes
1answer
228 views

Double Flash Loan

Looking into Flash Loans, is it possible to take out TWO at once (aave/dydx/uniswap)? How would you go about doing this? Here is what I'm thinking of, but it seems too complicated: Contract 1 takes a ...
3
votes
4answers
2k views

Uniswap addLiquidity function transaction revert

I try addLiquidity function but I result get transaction revert. I set deadline = block.timestamp and I use remix. Why transaction is revert? I found the problem line and specified it in code. I think ...
4
votes
2answers
16k views

Swap tokens back to ether on Uniswap V2 Router 02 (Sell tokens)

I am trying to do the reverse action of what I did in this question: Basically sell/swap some arbitrary token and receive ether on Uniswap V2 using IUniswapV2Router02. Here is what I have done: ...
1
vote
2answers
3k 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
43 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. ...
0
votes
1answer
63 views

What's the relationship between LP reserves and Swap rate?

This transaction transaction describes Swap event: amount0_in=14067900000000 amount1_out=393017164305296368 This means that the effective trade rate is: trade_rate=round(amount1_out/amount0_in)=27,...
3
votes
1answer
40 views

How is uniswap/sushiswap distributing their fees?

As i know, Sushiswap is collecting a 0.3% fee that is then divided into two parts 0.25% goes to LP providers 0.05% goes to treasury for burn note, 0.5% isn't indicated but I suppose that's the case ...
1
vote
0answers
108 views

Removing LP from Uniswap/Pancake using seth and removeLiquidityWithPermit(). How is the correct hash for the permission signing calculated?

I'm trying to figure out how I can remove LPs from Uniswap/Pancakeswap using the function removeLiquidityWithPermit(address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 ...
0
votes
1answer
382 views

Why does Uniswap computes amountOut of a token this way?

It seems[1] they do: (0.997 * amountIn * reserveOut) / (reserveIn + 0.997 * amountIn) From my understanding it should be amountIn * price, which with fee becomes ((1 - fee) * amountIn) * price. Now, ...