Questions tagged [uniswap]

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

255 questions
2
votes
0 answers

Minting new position on Uniswap V3 using hardhat

So basically I am trying to mint a position in a pool created by me. To create and initialise the pool: const factory = await ethers.getContractAt("UniswapV3Factory", factoryAddress) let poolAddress = await…
FatherSena
  • 21
  • 3
2
votes
0 answers

Building a Uniswap Multicall V3 Method with Ethers

I'm trying to build a multicall method (standard swap) with ethers library and JS but running into this error: (0, properties_1.defineReadOnly)(this, "fragments", abi.map(function (fragment) { …
2
votes
0 answers

Inconsistent reserve computation on UniswapV2

I'm trying to process pool reserves on uniswapV2. On the pool: WETH - USDC on UniswapV2. address of the pool: 0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc https://etherscan.io/address/0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc I have this two…
Vince M
  • 890
  • 1
  • 9
  • 21
2
votes
2 answers

GraphQL filtering the nested objects

I want to get some info about some Uniswap transactions using The Graph but I don't know how to go about filtering. I want to get only Swaps that one of their tokens is ether. That means that the symbol of the token is "ETH". Is there a way to do…
damavrom
  • 325
  • 2
  • 9
2
votes
1 answer

Arbitrum and Optimism gas price oracle api

Have a code where gas price data provided via gasstation api. Now it works on polygon. Wanted to start this on Arbitrum and Optimism, but can't find any api with gas price. As i understand, the gas on Arbitrum and Optimism has 2 parts, l1 and l2. If…
Dajeir
  • 51
  • 1
2
votes
2 answers

What's the different with UniSwap Router and UniSwap Factory?

People can swap token though with UniSwap Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D) and also UniSwap Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f) But what's the different? Why there are two contract exists for swaping token? I saw…
Moon soon
  • 2,616
  • 2
  • 30
  • 51
2
votes
0 answers

How to find the totalValueLocked of each token in each tick of a certain pool using uniswap v3 subgraph?

-> How to calculate totalValueLocked of each token in each tick of a certain pool in uniswap from subgraph api and also the TVL percentage in each tick of a pool ? Currently, I am fetching all ticks for a certain pool and each tick's liquidityNet…
2
votes
1 answer

Math in Uniswap UQ112xUQ112 library

Can anyone explain how the math in this contract works? pragma solidity =0.5.16; // a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format)) // range: [0, 2**112 - 1] // resolution: 1 /…
RɘN __
  • 53
  • 7
2
votes
0 answers

How to perform a Swap on Uniswap? ValueError: Gas estimation failed: 'execution reverted: STF'

I'm trying to perform a Uniswap V3 swap on this contract from WETH to DAI. I'm using a local environment that consists of: Solidity extension, VS Code, and Python framework Brownie-eth. The contract deploys without issues, however calling…
2
votes
0 answers

Cyclic SwapExactTokensForTokens

Is it possible to call SwapExactTokensForTokens on any one of the popular DEX Routers in such a manner that I get the same token out as I put in. For example: USDC → DAI DAI → USDT USDT → USDC The SwapExactTokensForTokens works with multi-hops, but…
hellowill89
  • 1,538
  • 2
  • 15
  • 26
2
votes
2 answers

Create a swap function of tokens using solidity without using uniswap ( swap with rate btw)

I am newbie to this field, and just learning some courses online about solidity and creating a simple contract, I would like to ask about a simple project that I try but not successful yet. I want to create a swap function that can swap between 2…
mintorii
  • 39
  • 4
2
votes
1 answer

How to pass an Interface object in a constructor parameter?

I don't know how to deploy this contract whit HARDHAT because there is an Interface object in the constructor. Please can someone explain to me how to initialize IUniswapV2Pair _pair IUniswapV2Pair is a Uniswap Library written in Solidity. const…
2
votes
1 answer

How can I deploy this repo(uniswap v3 subgraph) on my own subgraph?(The Graph) #104

I just try to deploy uniswap v3 subgraph in The Graph. (hosted service) I clone this repo and ran this steps yarn npm run codegen npm run build graph auth --product hosted-service npm run deploy when 5 I got Build completed: ~~~ ✖…
mingo
  • 21
  • 1
2
votes
2 answers

swapExactTokensForETHSupportingFeeOnTransferTokens has a path argument, I know I have to put the token's contract address first

I want to swap a token to BNB function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; I do not know what to put on calldata path, I've…
Surface
  • 21
  • 1
  • 4
2
votes
3 answers

How to understand uniswap v3 swap event?

https://docs.uniswap.org/protocol/reference/core/interfaces/pool/IUniswapV3PoolEvents In the uniswap v3 doc, there is some description. event Swap( address sender, address recipient, int256 amount0, int256 amount1, uint160…
youwenti
  • 133
  • 9
1 2
3
16 17