Skip to main content

Questions tagged [decentralized-exchange]

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

How to Ensure Custom Tax is Applied on Token Swaps in Solidity Smart Contract?

I'm developing a smart contract for a token (FMYNT) using Solidity on the Binance Smart Chain testnet, integrated with PancakeSwap testnet. I've implemented a custom 5% tax feature for buy and sell ...
Awais Ahmad's user avatar
0 votes
0 answers
17 views

Simple code example to implement tax on sell/buy transactions for a token on Uniswap DEX causing "Your swap is expected to fail.." error

I am trying to implement a sell/buy tax on transactions for my token when users trade on Uniswap DEX. My token's smart contract includes a tax deduction mechanism that functions correctly on EtherScan ...
Awais Ahmad's user avatar
0 votes
1 answer
32 views

How does the contract handle tax deductions for simple buy and sell transactions when the token is listed on any decentralized exchange (DEX)?

Could anyone provide an example solidity smart contract code for how to implement tax deduction using a router in a smart contract when list on DEX ? I've noticed that when adding custom tax deduction ...
Awais Ahmad's user avatar
0 votes
1 answer
21 views

Projects you made [closed]

Which projects you made that get you to expert level in solidity? I'm trying to be a smart contract dev. with solidity and wanna see which ones you made so I could benefit from it.
seojunchian's user avatar
1 vote
1 answer
34 views

Foundry error on CLI command

forge create --rpc-url $QUICKNODE_RPC_URL --private-key $PRIVATE_KEY --etherscan-api-key $ETHERSCAN_API_KEY --verify src/Token.sol:Token [⠒] Compiling... No files changed, compilation skipped The ...
Flegi's user avatar
  • 13
0 votes
0 answers
17 views

Contract Execution always fails while calling the flash loan with 1Inch API

I am getting the data from the 1inch api and I am using this contract for executing the flash loan. However, almost all the transactions are failed with the message, "Transaction Reverted ...
Rudransh Sharma's user avatar
0 votes
1 answer
20 views

How to Perform Cross-Chain Swaps?

I'm trying to facilitate cross-chain swaps between Binance Smart Chain (BSC) and Polygon networks. What are the steps or tools I can use to achieve this? I'd appreciate any guidance or resources you ...
adam mr's user avatar
  • 131
0 votes
0 answers
49 views

Call Swap from Uniswap V3 pool contract instead of through router

I am trying to call swap method from UniswapV3Pool contract, Kindly guide me step by step to call this method. ETCSwap (Ethereum Classic DEX) is using this approach, they are directly interact with ...
Syed Mokarram's user avatar
0 votes
0 answers
46 views

How To Find DexTool Trade Transaction Hash On BscScan / EtherScan

I'm presently trying to hunt down a rug pull of a fake PRCL token. I realize this is Binance Smart Chain, not Ethereum, but there's no community for Binance Smart Chain and it should hopefully be ...
azoundria's user avatar
  • 121
1 vote
2 answers
36 views

Do I have to pay twice for network fee?

I'm very new in crypto world and right now I'm trying to swap this coin but as you can see in the screenshot the ETH gas fee (Uniswap) is only $15 but once I tried to confirm transaction at my wallet ...
andrel58's user avatar
0 votes
2 answers
30 views

Are cross-chain Decentralized Exchanges and cross-chain bridges are the same?

I am newbie at DeFi. I am struggling with understanding what does author of Yellow paper of LayerZero mean in this sentence: "Currently, to convert between tokens of two chains, a user must ...
himchenhim's user avatar
1 vote
1 answer
21 views

Running a Cryptocurrency Bot 24/7 Without a Computer

I've developed a cryptocurrency trading bot, but I don't want to leave my personal computer running all the time just to keep it operational. Is there a method or service that allows me to run the bot ...
adam mr's user avatar
  • 131
1 vote
1 answer
21 views

How to query balance and lock duration of staked tokens across multiple protocols

I would like to query the stake/LP balances across multiple defi protocols for a given account address. debank.com does something similar and can show the LP balance for a DEX, the stake balance and ...
degen872's user avatar
1 vote
0 answers
291 views

How to Calculate Arbitrage Optimal amount in, in Uniswap v3 pools?

Let us assume that there is an arbitrage opportunity in uniswap v3 pools.Now I want to take a flash loan to make a swap in uniswap v3 pools.My doubt is how can I calculate the optimal amount in for ...
kumar's user avatar
  • 61
1 vote
1 answer
368 views

What would happen if you allocated 100% of a token's supply to a DEX liquidity pool?

So we all know what happens when there is no liquidity at all; it's impossible to buy or sell a token with no liquidity. But what would happen in the reverse scenario; if 100% of a token's supply was ...
Ashraile's user avatar
  • 125
0 votes
0 answers
43 views

How to get the token prices from the uniswap v3 pools?

I have to write the solidity code to fetch the prices of token pairs from the uniswap v3 pools but I have no idea how to get the prices of the token pairs from the uniswap v3 pools to my smart ...
kumar's user avatar
  • 61
0 votes
0 answers
41 views

Subgraph Link for Uniswap V2 on BSC?

I'm looking for the SubGraph Api endpoint to interact with UniswapV2 on the Binance Smart Chain (BSC). Can anyone provide the specific link or information on how to access it? I appreciate any ...
adam mr's user avatar
  • 131
0 votes
1 answer
21 views

Is it safe to use block.timestamp when swapping erc20 tokens?

I have a swapping function in my smart contract and for the deadline I am using block.timestamp. The swap function can only be called by the owner of the contract. Is this a safe way of working with ...
guiflam's user avatar
  • 11
0 votes
1 answer
21 views

Forking Swap from bsc on goerli, max input of native token 0

I'm trying to fork cheeseswap from bsc onto goerli. I've also tried to fork another swap from another network onto goerli and have the same issue. I Change all the chainid numbers, rpcs, factory, ...
Bobo From Florida's user avatar
0 votes
0 answers
144 views

0x API: Am I able to Swap absolutely NEW coins?

I have a trading bot that operates on newly created tokens in BSC and ETH networks. It works only for new tokens, that were created with WBNB (BSC chain with PancakeSwap) or with WETH (ETH chain with ...
Danik Logan's user avatar
0 votes
0 answers
10 views

How to use ethereum on decentralized exchanges in the US?

See https://www.reddit.com/r/Bitcoin/comments/145yka4/comment/jnoduy1/?utm_source=share&utm_medium=web2x&context=3 Dex's don't deal with Fiat directly, you always need a cex to buy your ...
Ralph Yozzo's user avatar
0 votes
0 answers
16 views

Looking for DEX code to create an internal token swap

I'm currently working on a project with a token contract and I need to add an internal token swap feature. So to avoid writing everything from scratch i'm Looking for any GitHub repositories or open-...
The matador's user avatar
0 votes
0 answers
90 views

How to calculate expected token amount out in a UniswapV3 swap

Accounting for slippage, is there a good way of reading data from a UniswapV3 pair and estimate how many tokens will be received when performing a swap (accounting for slippage)? I couldn't think of a ...
Rudi's user avatar
  • 1
0 votes
2 answers
75 views

Fail with error 'This pool does not exist on router1'

I was attempting to make a token swap and got an error: This pool does not exist on router1. This is my transaction: Etherscan link Any idea how I can prevent this error and verify that the pool ...
pigfox's user avatar
  • 71
0 votes
1 answer
48 views

How to decode internal transaction in mempool

i'm researching on how mev works. I know that they are watching all pending transactions, then define function that is swap on dex and calculate amount to do sandwitch. However, when user do a swap, ...
dang.pm.IT's user avatar
1 vote
0 answers
21 views

How to swap ETH for another token and send this token to another wallet using only one transaction for both actions?

Please, tell me, is it possible to do it using Uniswap V2 router (via smart-contract or dapps)
misha s's user avatar
  • 11
0 votes
1 answer
88 views

execution reverted despite not writing to the blockchain

I am attempting to read the value of a token on a DEX. When I run the code I get execution reverted despite not writing to the blockchain. Code is reproducible with your own Infura api key. Any ideas ...
pigfox's user avatar
  • 71
1 vote
0 answers
66 views

How can I approve spending limit manually without having to use metamask?

When interact with smart contract on EVM chain, new token need to use "approve" function on metamask. I know this, but I have a good reason to approve the spending limit manually without ...
cht's user avatar
  • 11
0 votes
0 answers
197 views

Is there a V2 Router for BaseSwap DEX on the Base Chain Testnet?

I am currently working with the BaseSwap decentralized exchange that runs on the Base Chain. I noticed that they have a router for facilitating transactions on mainnet, but I am particularly ...
Jenny From the Block's user avatar
0 votes
0 answers
21 views

Is there an API for real time token values?

This is not a coding question so if this is the wrong place to ask it please advice where I can ask it. I am looking for an API where I can get real time token values both on Sepolia and then also on ...
pigfox's user avatar
  • 71
0 votes
0 answers
36 views

swapping tokens on clipper dex with code

https://etherscan.io/address/0x655eDCE464CC797526600a462A8154650EEe4B77 This is the link to the Clipper exchange pool where you can swap weth/wbtc/usdt/usdc/dai. I've been trying to execute a swap ...
aksu Ristola's user avatar
0 votes
0 answers
11 views

Market Cap: $Infinity

What can cause this to happen on poocoin?, Market Cap: $Infinity I have been trying to deploy an erc20 token and the deployment was successful but on poocoin, after adding liquiduty, it shows Market ...
KeNs's user avatar
  • 1
0 votes
2 answers
191 views

Batch Token Swap using 0x

I'm trying to make a telegram bot that sells all the tokens available on a wallet using Ox API. In order to automate the process with only command, I'm okay with adding the private key to the script. ...
Liju Thomas's user avatar
0 votes
3 answers
529 views

How can I find router addresses of decentralized exchanges

When I want to find router addresses like pancakeswap router (V2) or uniswap router, I can search them like pancakeswap router bscscan in Google or track transactions in bscscan.com to find them. Do ...
Mahdi Karami's user avatar
1 vote
0 answers
126 views

Can we rely on 1inch Swap API price feeds

It is not clear to me how 1inch swagger API is getting the prices from different dexes. Can we rely on them? As they are not open-sourced. I tried using the aggregator but faced this issue RPC timeout ...
Saikat Karmakar's user avatar
0 votes
1 answer
102 views

RPC timeout while doing multicall on `1inch aggregator` on local forks

I may be doing this wrong but I think there is an issue when performing multicall Spot price aggregator contract.But when it comes to multicall ganache/hardhat all make Time out error. Poc: Performed ...
Saikat Karmakar's user avatar
0 votes
0 answers
47 views

How is exchange rate calculated on DEX platforms like uniswap and sushiswap?

I started getting into the crypto scene and I read about liquidity pools but I am not sure how to get exchange rates into my javascript code, I looked for API's and SDK's but couldn't find any for the ...
user125002's user avatar
2 votes
1 answer
92 views

`ZIPPO_CONTEXT_INVALID` error when querying 0x goerli swap api quote endpoint

When querying the following endpoint and parameters: https://goerli.api.0x.org/swap/v1/quote?buyToken=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&sellAmount=1000000000000&sellToken=...
Luckydev's user avatar
1 vote
1 answer
22 views

error Dai/insufficient-allowance even when sufficient amount has been approved

I am testing smart contract interaction with Gains.trade on hardhat mainnet fork. However i always got this error Error: VM Exception while processing transaction: reverted with reason string 'Dai/...
Haziq Raz's user avatar
1 vote
1 answer
106 views

Metamask signature request with empty message

Can someone help me to understand these empty signature requests? For example using the Plutus Dex when clicking to stake your plu you got this: What does this mean? And what harm this can cause? And ...
BigLeo's user avatar
  • 141
1 vote
2 answers
946 views

Error: invalid signer or provider (argument="signerOrProvider", value={}, code=INVALID_ARGUMENT, version=contracts/5.7.0)

import { AlphaRouter } from "@uniswap/smart-order-router"; import { ethers, BigNumber } from "ethers"; // Import BigNumber from ethers import { Token, CurrencyAmount, TradeType, ...
Nilesh Nath's user avatar
0 votes
2 answers
423 views

Contract Address for Swap Router for Goerli ARB

Does anyone know an address or sanple address for Swap Router in Goerli Arbitrum Testnet Network? Like this sample in mumbai https://mumbai.polygonscan.com/address/...
Lloyd Ramos's user avatar
0 votes
0 answers
520 views

Who can me give me detailed steps to fork Uniswap on v3?

There ! I m forking uniswap v3. Already downloaded v3-core, v3-periphery,interface repository, but I can't customize them. Especially in Interface, I can't find the way how can integrate smart ...
Marin Seremet's user avatar
0 votes
0 answers
58 views

Determining the Percentage of Uniswap V3 Trading Volume from Arbitrageurs vs Regular Traders

I am trying to understand the trading dynamics on Uniswap V3. Specifically, I am interested in finding out what percentage of the trading volume on Uniswap V3 comes from arbitrageurs versus regular ...
MShakeG's user avatar
  • 1,733
1 vote
1 answer
416 views

Liquidity provisioning with yield-bearing tokens

I want to add liquidity to a pool with a yield-bearing token, such as stETH/ETH. Where does the yield of this token go to? Does it just go to the smart contract and gets owned by the smart contract, ...
João Areias's user avatar
1 vote
0 answers
24 views

Uniswap: Why is there an intermediary when swapping?

I am trying to understand why sometimes when a wallet buys a token the Uniswap pool sends the token through an intermediary address before it gets sent to the buyer. Here's an example of such ...
Martin's user avatar
  • 11
1 vote
1 answer
49 views

it’s possible that swap transaction get executed some blocks later

i want call X function, there are multiples external calls in this function.one of this external calls is a DEX trade. it’s possible this DEX trade transaction get executed in the some blocks later or ...
Saeed Alipoor's user avatar
0 votes
1 answer
24 views

Chainlink vs DEXs & NFT Market prices

I am doing a futures dApp, so I need the price of the underlying assets (all assets are on-chain not fiat). What is the difference between using DEX and NFT Marketplace on-chain prices as oracle and ...
stevealock's user avatar
0 votes
0 answers
140 views

How to calculate "amountOutMin" on some DEX-es?

There's a function in a contract on HOT-protocol exchange sendToL2( uint256 chainId, address recipient, uint256 amount, uint256 amountOutMin, uint256 deadline, address relayer, uint256 relayerFee ) ...
Kyell's user avatar
  • 91
0 votes
1 answer
126 views

Need Guidance on Handling a Paused Token pair in Uniswap : extract ETH from pair

I currently have a token pair (Token A and ETH) listed on Uniswap DEX. However, Token A's smart contract has been paused by its issuer, rendering this token immovable at the moment. Now, I'm aiming to ...
Jorney's user avatar
  • 1

1
2 3 4 5 6