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
0
votes
1 answer

Listen to uniswap events by ethers

I have a simple code that aimed to listen to Uniswap Router V3 protocol events import { ethers } from "ethers"; import { ALCHEMY_HTTP } from "./const"; async function main() { const provider = new ethers.providers.JsonRpcProvider(ALCHEMY_HTTP); …
0
votes
3 answers

Uniswap v3 nonfungiblePositionManager.mint revert after createAndInitializePoolIfNecessary

I use the official deploy tool "successfully" to deploy Uniswap v3 to a EVM comparable testnet. After NonfungiblePositionManager.createAndInitializePoolIfNecessary(), I call NonfungiblePositionManager.mint() to mint a new position but it always…
H.Li
  • 171
  • 2
  • 12
0
votes
0 answers

How to effectively provide a token liquidity on uniswap for the first time?

I created 100.000 Tokens, now Id'like to provide liquidity on uniswap with 100$ (0.04 ETH) I have as of now (2022-02-25th), however these are my concerns: What if someone bought all my tokens since it's cheaper (eg. 0.0000001 eth/token)? If someone…
Baziwe
  • 27
  • 1
  • 9
0
votes
0 answers

addLiquidity() function fails on UniswapV2 on local ganache instance?

addLiquidity() function reverts without any reason on local development instance of ganache, any ideas why this might be happening? Some background: I have forked the UniswapV2Factory and UniswapV2Router02 and deployed on ganache. I have created 2…
Suraj Kohli
  • 547
  • 2
  • 5
  • 11
0
votes
1 answer

Transaction exited with an error (status 0) after invoking swapExactETHForTokens several times

I am experimenting with UniswapV2 on a forked local environment (ganache --fork [mainnet]. I am able to deploy my own token, interact with the uniswapv2 contracts located on the fork and add liquidity to token/eth pair. Next I am able to do one…
Ramdiman
  • 13
  • 3
0
votes
1 answer

How to get historical swap data from different exchanges using web3js

This is what I want to achieve The web3.eth.getTransaction() doesn't provide the data I am looking for. I want to get historical data of a swap from token to the token and the amount. Thanks for the help in advance.
0
votes
2 answers

Uniswap error:A transfer error ocurred when invoking `fpoSwap.swapAndLiquidity()` in the `_transfer` function

These codes send a transaction to uniswap contract and charge some handling fee, adding Liquidity to the Capital pool. However, I don't know where the "_transfer" function is wrong, which calls fpoSwap.swapAndLiquidity(), a method in the "FPOSwap"…
Yg Hu
  • 1
  • 1
0
votes
1 answer

Example for addLiquidity method of UniswapV2 Router

I am reading through UniswapV2 docs and can't understand the inputs of addLiquidity method properly. As listed in the docs: amountAMin (uint): Bounds the extent to which the B/A price can go up before the transaction reverts. Must be <=…
invisiblecat
  • 125
  • 1
  • 10
0
votes
1 answer

TypeError: "msg.value" and "callvalue()" can only be used in payable public functions

In my contract I'm trying to swap Eth for Dai using Uniswap's swapExactETHForTokens() function: pragma solidity ^0.6.6; interface IUniswap { function swapExactETHForTokens( uint amountOutMin, address[] calldata path, address to, …
Jasperan
  • 2,154
  • 1
  • 16
  • 40
0
votes
1 answer

How can I take back control of the uniswapV3 pool

Earlier I released a token at 0x779084304ff90e8be79d5c4dbd1ca323b9ac555e and it has been listed on the uniswapV3 exchange. Since the wallet was stolen, I did a transferOwnership to a new wallet, but there was no transfer pool. Finally, I published…
0
votes
1 answer

Solidity - External contract call not working

So, I'm new to solidity and I've been trying to make a contract that can call another contract. I've found some articles describing this exact problem such as: https://soliditydeveloper.com/uniswap2 Altough, even with the provided code I can't make…
nfnvsc
  • 49
  • 4
0
votes
1 answer

Uniswap V3 AlphaRouter - "Failed to get subgraph pools from any providers"

I am trying to swap WETH against MyToken from a previously created Uniswap V3 pool on Arbitrum Rinkeby. When calling AlphaRouter.route, however, I get the following error message Failed to get subgraph pools from any providers What is still…
Homer
  • 239
  • 2
  • 11
0
votes
0 answers

Invalid or incomplete introspection result

When I am trying to run the below subscription code I am getting the error: TypeError: Invalid or incomplete introspection result. Ensure that you are > passing the 'data' attribute of an introspection response and no 'errors' > were returned…
0
votes
1 answer

A problem with uniswap v2 periphery contract, can't make a swap through my own contract using the interfaces

I have deployed this code on ropsten testnet to test uniswap swaps. I am trying to make swap using function "swap" of my contract with this data path: 0xc778417E063141139Fce010982780140Aa0cD5Ab,0xad6d458402f60fd3bd25163575031acdce07538d, 1000000,…
0
votes
2 answers

Questions about ABI in Solidity

I'm studying Uniswapv2 codes and I got stucked with ABI. https://github.com/Uniswap/v2-core/blob/master/contracts/UniswapV2Pair.sol Why use ABI with call method, even if we can call transfer function from interface directly? bytes4 private…
SungJunEun
  • 53
  • 3
1 2 3
16
17