Questions tagged [uniswap]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

Swap of ERC20 token reverts in some cases without error message using UniswapV3 exactInputSingle(params)

I wrote the following function to swap DAI to an ERC20 token on Rinkeby. It worked perfectly for some time and then it started to revert without any message when trying to swap DAI to UNI on Rinkeby. ...
0
votes
0answers
9 views

Is a full node a requirement to broadcast transactions?

Sometimes I want to interact with some smart contract ( maybe a decentralized exchange like uni swap) And I want my transaction to be confirmed the fastest. But usually, we are relying on other full ...
0
votes
0answers
18 views

How is Etherscan Token Tracker Feature Built

How is the Etherscan ERC-20 Token Address page built (different from address Page)? My understanding is that ERC-20 only logs (emits) the events 'Transfer' and 'Aprove', so we are limited to these ...
0
votes
0answers
10 views

How to prevent MEV Bots "attacks" to a fork of uniswap V2

I deployed a smart contracts structure to create a DEX in the mainnet. Is a fork of UniswapV2, only changing the variable names. I added some liquidity to it and it worked well. After some days, we ...
0
votes
0answers
8 views

How to know when my ERC20 contract is being called for a Swap from an exchange?

I'm developing an ERC20 Token Contract in Solidity. I would like to know if there is a way to determine when transfers are called for Swap transactions via Exchanges that implement Uniswap v2 (Such as ...
0
votes
0answers
27 views

How an external contract can access to my wrapped ether balance?

I deployed a fork of uniswap in mainnet and I add to it some liquidity, creating a pair between ETH and my token. I made some swaps, and after some days I noticed that someone stole the liquidity, I ...
1
vote
0answers
8 views

Can't check balance of a user using ethersjs

const lpERC20 = new ethers.Contract(pairAddress, lpABI); console.log(await lpERC20.callStatic.balanceOf(usr)); where pairAddress is const pairAddress = await factory.getPair(tA.address, tB.address); ...
0
votes
1answer
21 views

Can't add liquidity pool for my ERC-20 token on uniswap

I created an ERC-20 token, tested it in truffle and remix, and deployed it to the Rinkeby testnet. I went to uniswap and connected my metamask (after verifying the contract on etherscan and adding my ...
0
votes
1answer
19 views

How to catch INSUFFICIENT_OUTPUT_AMOUNT Error?

I'm trying to create a trading bot and I noticed that even when a transaction is 100% gonna fail, the swapExactTokensForTokens still pushes through hence paying gas fee. My question is, how does ...
0
votes
0answers
66 views

Need help in understanding AlphaFinance approach for Uniswap's fair LP Token Pricing

so i'm trying to understand the alpha finance's approach to calculate fair LP token pricing for constant product AMMs. What i understood, current Uniswap LP pricing is vulnerable to flash loans by ...
0
votes
0answers
19 views

UniswapV2: TRANSFER_FAILED when triggering auto-sale

I encoutered a strange behavior when using UniswapV2 pools. I have a plain ERC20 token that is triggering another contract when a sale happens via a predefined Uniswap pool. I define a sale by ...
0
votes
0answers
8 views

Locking Liquidity and renounce: still able to withdraw after lock period?

Someone can help me to understand how Locking Liquidity works? I want to know how Unicrypt or Trustswap lock our tokens: If I create a token, add the liquidity, lock it with unicrypt, renounce the ...
0
votes
0answers
10 views

Uniswap V3 IncreaseLiquidity Event

When someone mints a liquidity position on UniswapV3 these events are logged. https://etherscan.io/tx/0x10f934c6e71699365730309ba508afedb2ced65f70c59d6c94c03c7c8cda75f2/advanced#eventlog How do I ...
0
votes
0answers
10 views

Uniswap V2: Using the "SupportingFeeOnTransfer" methods for all tokens?

Looking at the contract source code of Uniswap V2, it seems the only difference between the "SupportingFeeOnTransfer" methods and the normal methods is that the "SupportingFeeOnTransfer&...
0
votes
0answers
34 views

How can I fix this Uniswap Router bot?? It's making me put a time.sleep(40) just before buy() function?

This uniswap router bot triggers a swapExactETHForTokens transaction but it always fails with an "out of gas" error unless I put a time.sleep(40) just before the buy() function. I tried to ...
0
votes
0answers
10 views

Getting my estimated impernemant loss

I am using web3 lib for node js for the first time. I am trying to wrap my mind of how to get my impernament loss. I had in mind two ways and hoping you can help me. Use getReserves function at my ...
1
vote
1answer
19 views

Do you know where to find a library or example of a script to be able to see how much liquidity there is in a contract?

I need to see in a new listed contract in BSC, through python, how much liquidity has been added or possess. I can't find a library and a script as an applied example that can help me see that ...
0
votes
0answers
37 views

How to Buy/Sell tokens using Uniswap V3 Multicall function?

I used to create programs to buy and sell tokens by interacting directly with Uniswap V2 router functions (SwapExactEthForTokens, and others). It was fairly simple because all I needed to do was to ...
0
votes
0answers
8 views

How to see that selling is impossible from contract on UNISWAP

I have been studying contract codes on etherscan for some tokens. I was wondering are there any parts of code which can indicate that the token can not be sold. For example, I noticed that some ...
1
vote
0answers
6 views

Max amount of coins I can trade to a certain slippage

I want to calculate in solidity and uniswap dex the max amount of coins I can receive before touching 5% slippage with 0, 1 and 2 hops (or at least, approximately). For example, suppose I want to ...
0
votes
0answers
17 views

Uniswap V2 get all pools that the wallet holds (web3 / ethers.js)

Is it possible to find all the liquidity pools where my wallet holds a certain amount of tokens? for example i added liquidity for 5 liquidity pools. is it possible to fetch all the pools that i have ...
0
votes
0answers
20 views

TRANSFER_FROM_FAILED Adding New Pool to Uniswap

I created a new ERC20 token and I'm trying to create a new pool ETH pair with my token on Uniswap V2. However, when I get to the last step on Uniswap and press "Add" it doesn't do anything. ...
1
vote
1answer
34 views

How to blacklist an Ethereum address to trade on a decentralised exchange?

How to blacklist a particular token to trade on a decentralised exchange?
0
votes
2answers
1k views

How to swap wETH for ETH on Polygon network?

The current largest mining pool Ethermine has an option to be paid in wETH through the Polygon network instead of in ETH on the mainnet. Through MetaMask on the Polygon network, I see my wETH in my ...
0
votes
0answers
65 views

Uniswap parse current token price

I am trying to query token's prices from Uniswap. I have found the official documentation of Uniswap but it is still not clear for me, as it returns an object that I cannot formulate into an actual ...
0
votes
0answers
6 views

Access Uniswap with MyCrypto desktop with Parity Signer,

I have some tokens in a wallet created in March with MyCrypto desktop and Parity Signer. Is it possible to exchange tokens on Uniswap (i.e. ETH for RETH) with MyCryptoDesktop and Parity Signer? ...
1
vote
2answers
89 views

Is it possible to make a static call to a non-static function from within a smart contract without changing blockchain state?

Ive seen that the web interface from Uniswap is making a "fake" call to the contract holding the liquidity positions, and claims all fees (.collect(..)) without actually claiming them. ...
0
votes
0answers
9 views

How is the approval process before call removeLiquidityETH?

I am in a middle of something very strange. I know that I have to approve a spending of some balance to the router when we want to use the removeLiquidity function from Uniswap. When I use "...
0
votes
1answer
29 views

How does Uniswap Interact with my Token Contract When Users Swap?

I've been getting the hang of smart contract development and token creation in general, but the one thing I've been struggling with is understanding how Uniswap interacts with my token contract when ...
1
vote
0answers
31 views

How pancakeswap website find a multi-hop path to trade a coin

I publish tokenA I add liquidity to tokenA/usdt I then want to use my "cake" to get tokenA Pancakeswap website discover there is no liquidity cake->tokenA, it then could very ...
0
votes
0answers
20 views

Formulas behind liquidity pool (constant formula)

I'm trying to understand (implement) a liquidity pool. However, I have a hard time trying to understand how to calculate a provider's LP tokens (stakes). Reading Uniswap v1 whitepaper I see this ...
0
votes
2answers
69 views

Cannot approve or sell token swapExactTokensForTokens: transaction fails (not a honeypot)

I am trying to sell a token (DOBO). Buying DOBO is no problem and it goes through. But I cannot sell it. I get a failed transaction, but no error message on node.js (see https://bscscan.com/tx/...
0
votes
0answers
15 views

ds-math-sub-underflow error comes when i am try to remove liqudity

Hello Everyone first i am add liquidty of 1000 token(18 decimals) then i am trying to remove liqudity and use removeLiqudity function(uniswap V2)but get the error of ds-math-sub-underflow. Look at ...
0
votes
1answer
19 views

BEP-20 BNB vs. BNB

I have ETH (BEP-20) in my wallet. I understand that to transact with it, I need some amount of BNB for gas. My question is, do I need BNB or BNB (BEP-20) ? I wish to eventually swap the BEP-20 ETH for ...
0
votes
0answers
20 views

How do you convert block timestamps to GMT or any other timezone for oracles on EVM. Are GMTs the same as block timestamps on EVMs?

pragma solidity >=0.4.16 <0.9.0; import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol'; import '@uniswap/lib/contracts/libraries/FixedPoint.sol'; // library with helper methods for ...
0
votes
0answers
19 views

Pancakeswap token price

I am trying to build a rather low latency app that would query directly from pancakeswap the prices of various tokenpairs. I haven't seen that pancakeswap would have an actual API that I could query. ...
1
vote
0answers
12 views

Q number format

The fees in the uniswap contracts are in Q128.128 format. But the docs don't mention if this is signed or unsigned. Does anyone know ? If it's unsigned, then simply dividing by 2^128 should give the ...
0
votes
1answer
114 views

Undefined output when using getPair and getReserves in web3 / node.js

Happy new year to you all! I am trying to get the wBNB/BUSD pair address from Pancakeswap (using getPair) and then check for their liquidity (using getReserves). I have pretty much copied the code ...
1
vote
1answer
102 views

How are Uniswap fees distributed equally factoring in both proportion and duration pooled?

A similar question has already been asked, however a satisfactory answer has not yet been provided. The Uniswap V2 Pools docs states: If the provider is minting a new pool, the number of liquidity ...
0
votes
0answers
75 views

How to properly subscribe to Uniswap v3 pool price events with NodeJS and JavaScript?

In reviewing the Uniswap v3 Quoter documentation: These functions are not marked view because they rely on calling non-view functions and reverting to compute the result. They are also not gas ...
0
votes
0answers
30 views

Why the transaction reverted when I try to sell tokens on uniswap v2 router2, but success on browser?

I am using web3 to send transaction to uniswap v2 router2 to sell my tokens for ETH, with both the sold token and WETH approved for router2 with amount of uint256max, and I set amountOutMin to 0 ...
0
votes
0answers
11 views

UniswapV3 NFT creation timestamp

Can we get NFT creation timestamp in smart contract from the uniwapV3 smart contracts. I want use position creation timestamp in my smart contract without using orcales.
0
votes
0answers
16 views

Why We use hex'ff' for genrate the pair address in uniswapV2 library?

I am working on uniswap router contract for _addLiquadity and there uniswap used uniswapV2library and into that library this below function is return the pair address but i dont understand what first ...
0
votes
0answers
31 views

Token Price on Swap and CEX/DEX

My question is actually almost similar with this one : How to keep the token price in uniswap the same with the centralized exchange I want to know how to sync token price more deeply : From the link ...
1
vote
1answer
39 views

uniswap constant formula seems confusing

let's say Liquidity on ETH/DAI pair is 5 ETH and 18652 DAI. At the time of this writing, I figured out how many DAI is 5ETH and 18652 was the number. So 1eth costs costs 3730DAI Now, let's say user ...
0
votes
1answer
47 views

Error: The called function should be payable if you send value and the value you send should be less than your current balance

This is my constructor. I cant figure out why this error is ocurring as the constructor is identical to another deployed contract. It is related to the .createpair call. If i comment this out then it ...
0
votes
1answer
37 views

Proper way of automating trades on uniswap with nodejs

I am wondering what would be the proper way (if possible at all) to automate trades on uniswap using their SDK or just web3 or ethers with the router and factory contract instances. I want to build a ...
0
votes
1answer
159 views

ethers js .callStatic() method doesn't support Uniswap Router

I have created a test project for the purpose of this question for testing a simple swap using Uniswap Router. My aim is to simply test the transaction before it is actually sent, so I'm trying to use ...
0
votes
0answers
14 views

Why is Uniswap v3 factory.getPool() not working?

Given the following setup: require("dotenv").config({}); const { ethers } = require('ethers'); let infuraMainnetProvider = new ethers.providers.JsonRpcProvider(process.env....
1
vote
1answer
67 views

Why can't I access the Uniswap v3 Factory .getPool() function?

As a personal exercise, I am trying to convert the following Uniswap v2 project to Uniswap v3: Uniswap token price monitoring (this is not swapping), i.e. ETH/DAI https://www.youtube.com/watch?v=...

1
2 3 4 5
13