Uniswap is a decentralized finance protocol that is used to exchange cryptocurrencies. Questions should relate to programming. General questions about Uniswap should be asked on https://ethereum.stackexchange.com
Questions tagged [uniswap]
255 questions
1
vote
1 answer
Reading the price of multiple Uniswap tokens using Python
I'm quite a beginner and I'm doing a Python bot which is comparing prices on exchanges, it is easy and obvious to do it with REST API for CEXs but it's not obvious at all how to fetch prices for Uniswap. Could anybody please tell me what is the most…

xx1
- 13
- 3
1
vote
0 answers
Issues while selling to a liquidity pool created for my own smart contract
i've been lately trying to create an ERC20 Token with Some Fees implemented on the transfer functions and an AntiSnipe system which is supposed to block the addresses trying to make a transfer in a certain range of time. As per Uniswap…
user18541404
1
vote
1 answer
Swap trade in Uniswap fails using uniswap-python standard functions
I am trying to do a simple trade using uniswap-python and it doesn't work.
Sample code:
from uniswap import Uniswap
provider = "https://polygon-mainnet.infura.io/v3/"+INFURA_API_KEY
uniswap = Uniswap(address, private_key, version = 3,…

The Dare Guy
- 487
- 1
- 3
- 12
1
vote
0 answers
getAmountIn Uniswap/Sushiswap
Im trying to get the price in WETH of 300 COMPOUND and i'm doing it using the getAmountIn uniswap's router function but its giving me a different amout than that from the UI. The expected output for 310 COMPOUND on uniswap its currently 10.4 WETH or…

Shadq
- 25
- 5
1
vote
0 answers
How to decode data from uniswap transaction in python
I am getting stuck decoding data transaction from a swap using uniswap protocol (Uniswap V3: Router 2 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45). In other words, I'd like to know if it exists a function that given a smart contract address and the…

evan
- 11
- 2
1
vote
1 answer
in web3py, any function to call static?
I want to use Uniswap V3 Quoter function, but it's a write function. I have to call static to avoid gas cost.
I don't see any static call in web3py documentation. Any suggestion? Thanks ahead!

tinyhodler
- 11
- 1
1
vote
0 answers
Uniswap Quoter Contract Returns Constant Value
I use the following call to the Uniswap Quoter Contract defined as
const QUOTER_CONTRACT = new ethers.Contract(V3_QUOTER_ADDRESS, QuoterABI, PROVIDER)
to retrieve the price of the token. All inputs to it were checked manually in a debugger and…
user8239044
1
vote
0 answers
Creating a Python Wrapper from a JavaScript code
Problem Statement
I wrote a JavaScript code to pull data from Uniswap V3 SDK (https://www.npmjs.com/package/@uniswap/v3-sdk) and I would like to open-source this code on GitHub because currently this isn't possible (for specific use cases). I am not…

beeeZeee
- 51
- 1
- 2
- 10
1
vote
1 answer
How can I get pool with ETH in Uniswap v3?
I want to get pool with ETH (ETH/UNI, ETH/USDC, ...).
I tried to call getPool() function of uniswap factory contract with 0x0000000000000000000000000000000000000000, but it returns 0x0, which means there is no pool.

Lazaro Nascimento
- 11
- 4
1
vote
1 answer
Uniswap pair = address(uint(keccak256(abi.encodePacked() Error
I don't understand why i get this error when i try to compile my contract to swap tokens on different dex.
Here the Code:
//SPDX-License-Identifier: MIT
import "./Interfaces/IUniswapV2Router02.sol";
import…

Matteo Gigli
- 49
- 5
1
vote
0 answers
How to use selfPermit with Multicall?
Modern AMM routers (eg UniswapV3, Trident) feature an abstract contract selfPermit.sol that allow users to submit their own ERC712 permit signature and call another contract function in a single transaction.
As per Uniswap documentation, "These…

Pm Rivière
- 191
- 2
- 13
1
vote
3 answers
Uniswap V2 pool priceImpact
How do you calculate the priceImpact on Uniswap v2 pools? I can't find documentation to help me. The price impact appears on the UI when you select two tokens you want to swap.

Anthony
- 47
- 5
1
vote
1 answer
decoding uniswap event data in python with ABI?
I started two days ago with ethereum blockchain, so my knowledge is still a little bit all over the place. Nevertheless, i managed to connect to a node, pull some general block data and so on. As a next level of difficulty, I tried to start building…

user19976975
- 13
- 3
1
vote
2 answers
How permit function works
I'm trying to figure out what's purpose of permit function from the Uniswap core
I know that ecrecover function ensures, that messages was signed by some address, but that's not clear for me -- why we can use permit function?

Nikita Duginets
- 163
- 1
- 6
1
vote
0 answers
function swapExactTokensForTokens - amountOutMin
I have assigned 'uint amountOutMin' as 1. But when I swap 0.1BNB to btc, amoutOutMin will be less than 1. Will this transaction revert (since amountOutMin is <1). I belive we cannot set it to a value like 0.0001
function swapExactTokensForTokens(
…

DeFi
- 77
- 1
- 8