Skip to main content

Questions tagged [pancakeswap]

PancakeSwap is a Binance Smart Chain-based DEX launched by anonymous devs with a penchant for breakfast foods and rabbits. It looks a bit like Ethereum's SushiSwap (community governance, the ability to farm liquidity provider tokens), but also incorporates many other features that let you earn rewards.

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

Why are taxes not being deducted or received in the FEE_RECIEVER variable in my Solidity smart contract?

I'm working on a Solidity v0.8.20 smart contract with buy/sell tax features. Despite testing on BSC Testnet (PancakeSwap) and Sepolia Testnet (SourceHat), the taxes aren't being deducted or sent to ...
0 votes
0 answers
15 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 ...
0 votes
1 answer
31 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 ...
0 votes
2 answers
888 views

Understanding the getAmountsOut functrion, help please

I'm trying to understand the "getAmountsOut" function from Uniswap / Pancakeswap, line by line: // performs chained getAmountOut calculations on any number of pairs function getAmountsOut(...
0 votes
0 answers
9 views

Copi tokens missing from my metamask wallet [duplicate]

I had 10000 Copi tokens in my Metamask wallet and they are all transferred to 'PancakeSwap V2: COPI 5' and can see a transaction history. But I didn't initiate this. Could someone help me understand ...
0 votes
1 answer
17 views

I would like to know if with this code after deploy on REMIX IDE,it is possible swap my token in bnb,usdt,btc,eth and sol on Uniswap and Pancakeswap

// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable....
0 votes
1 answer
458 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 ...
3 votes
1 answer
3k views

How to send correct SwapExactEthForTokens params types on ethers/web3.js?

I need to know how to send correct paramaters / paramater types as in what does the parameter type has to be is it a hex number , a string ? help would be massively appreciated. Notes: 1)i cant set ...
1 vote
1 answer
1k views

Triangular Arbitrage or multiple swap arbitrage

Is it posible to develop a bot with a multiple step arbitrage? like 5 swaps and above? trying my hands on triangular arbitrage with bots on dexes, able to run a binary arbitrage. can i get a sample ...
0 votes
1 answer
25 views

I want to clone pancakeSwap V3-core-contracts. i need deployment step to run pancakeSwap clone succcessfully. github deployments not working properly

Add Key in .env file. It's a private key of the account that will deploy the contracts and should be gitignored. bscTestnet KEY_TESTNET or bsc KEY_MAINNET add ETHERSCAN_API_KEY in .env file. It's an ...
0 votes
1 answer
1k views

AttributeError: 'int' object has no attribute 'buildTransaction' - Python Web3 Solidity

I'm using this code to swap token USDT to token A but it has been stuck by this error: AttributeError: 'int' object has no attribute 'buildTransaction' Here is my code: path = [tokenA,tokenB] ...
1 vote
1 answer
1k views

Which method will return the liquidity list provided by user?

I am new to the DEX development. Am using pancakeswap router contract https://testnet.bscscan.com/address/0xd99d1c33f9fc3444f8101754abc46c52416550d1 Using ethers.js to call contracts. addLiquidityETH ...
0 votes
1 answer
723 views

Pancakeswap multihop how is it implemented

On Pancakeswap it uses multihop functionality when swapping a pair with no direct swap path. The v2 router does not support multihop and was wondering how PCS has this implemented? As an example on ...
1 vote
1 answer
833 views

Fail with errors 'Pancake: TRANSFER_FAILED'

https://bscscan.com/tx/0x41fcd1893c7500ae2ace0ab195bb0c9bbfcfefd05ad794707a65749d358da3df. I don't undestand why my transaction is failed. I fixed my fee limit at 1.500.000 and only 10% was used. If ...
0 votes
1 answer
543 views

Sending transaction to Uniswap/Pancakeswap Router using Nethereum failing

I'm trying to send a transaction to the Uniswap or Pancakeswap V3 router using Nethereum for a token swap via "exactInputSingle", but first I'm performing a gas estimate for the transaction. ...
1 vote
1 answer
428 views

0x bsc api returning the wrong path for Pancakeswap router v2

I query the api for bsc https://bsc.api.0x.org/swap/v1/quote?buyToken=0x368ce786ea190f32439074e8d22e12ecb718b44c&sellToken=0xe9e7cea3dedca5984780bafc599bd69add087d56&sellAmount=...
0 votes
2 answers
8k views

How to fix PancakeLibrary: INSUFFICIENT_INPUT_AMOUNT?

I'm trying to make a multiple swap function in my smart contract using solidity. For example we want to swap BNB->BUSD->USDT->ADA->BNB. The contract interacts with PancakeSwap. I deployed ...
1 vote
1 answer
831 views

Totally stumped with "INSUFFICIENT_LIQUIDITY_MINTED"

I have been at this now for about a day and a half an I'm totally lost. In advance, I'm sorry if this is a simple question - I'm new to solidity (although not new to programming, blockchain and crypto ...
0 votes
0 answers
18 views

Lost my coins after bought on pancakeswap

I have buy IPTOKEN token. The transition is succesful. But after receive on my wallet coins disapier from my wallet. Anyone can help me. This is trasnsaction https://bscscan.com/tx/...
1 vote
1 answer
528 views

What does to way multi approval transaction?

I am going to running swap transactions. At first, we are going to running an approval transaction. And then we are going to running a swap transaction. These repeat. I made the transaction data. ...
0 votes
0 answers
47 views

Swapping tokens with code

how do I swap tokens using java script in pancake swap v3 I'm looking for source code but not finding it anywhere
0 votes
2 answers
525 views

swap using swapExactTokensForTokens but execution reverted

I'm trying to swap BUSD to USDT using pancake swap on the testnet but whenever I try to swap using swapExactTokensForTokens function, I get "execution reverted" error, can you help me find ...
0 votes
2 answers
2k views

Send lp tokens to burn address

is there any repo or links where I can learn how to burn lp tokens? If someone added liquidity I want the contract itself to burn the lp tokens instead of sending them to a user.
0 votes
0 answers
41 views

Can't add liquidity to my token

I created a token and now I need to add liquidity to it. Here is a code of my contract: // SPDX-License-Identifier: MIT pragma solidity 0.8.20; abstract contract Context { function _msgSender() ...
1 vote
1 answer
40 views

Not getting every transaction and unable to parse data

The following JS code uses a basic BNB Smart Chain endpoint from QuickNode and ethers.js v6.3.0 to parse all transactions' data that is sent to PancakeSwap address. const address = '...
0 votes
1 answer
365 views

Understanding Deployment and contract design for BSC and pancakeswap

I understand that for the Ethereum Mainnet you need to create an ERC20 Token and for BSC you need a BEP20 Token. Let's say I want to create a simple smart contract and deploy it on Pancakeswap. In ...
2 votes
1 answer
506 views

How to predict if a transaction will succeed or fail while its in mempool?

I am working on frontrunning code for bot. The script found some target transaction as victim for frontrunning but this transaction mostly fails. So is there any way we can predict if a transaction is ...
0 votes
1 answer
36 views

Swapped from Cake to Catamoto on Pancakeswap and lost my tokens

Here is the transaction.. I lost Anyone know how I can get them back/ From: 0x2440B5b7cF4619FD98cd43CeCa9039E3d9E6b0c5 Interacted With (To): 0x13f4EA83D0bd40E75C8222255bc855a974568Dd4 (PancakeSwap: ...
2 votes
1 answer
962 views

How would I collect fees from an liquidity pool on pancake swap?

I understand that to start collecting fees you need to add liquidity to a pool e.g. BNB/BUSD Liquidity pool. So I have a smart contract that uses the uniswapv2 interface to add liquidity to the BNB/...
0 votes
1 answer
480 views

approve function not working while trying to add Liquidity

I have a created a pair of DAI (0x8e60C2Ab51Ea0dB31208F11FDc35CF30372eCE0a) and BUSD (0xe33a84F08326fdbcb4b6511eDEb90868113569dB) on BSC Testnet. The contracts are also verified there. I want to ...
0 votes
1 answer
430 views

Pancakeswap trade occasionally reverts without a reason

I'm calling the swapExactTokensForETH in order to exchange some Eternal token for BNB. amountOutMin is set to 0 (I swap small amounts) and timestamp is set to uint256 max. Here's an example of the ...
0 votes
2 answers
1k views

Subscribe to PairCreated Event on PancakeSwap's Factory Contract

I'm using ethersjs and bscscan to try and subscribe to the PairCreated event on the factory contract of PancakeSwap. I do the following and run it with node: const ethers = require('ethers'); const { ...
0 votes
0 answers
30 views

addLiquidityETH reverts even after token approval

I am trying to deploy liquidity on a testnet using this code. However, it reverts with no explanation given other than that error. According to the UniswapV2 docs, I am using the correct router (...
0 votes
1 answer
509 views

Quickswap transaction always reverts when using swapExactTokensForTokens

pragma solidity 0.7.5; import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract Swap { ...
1 vote
1 answer
426 views

Deploying with hardhat : ProviderError: INTERNAL_ERROR: could not replace existing tx

I am trying to deploy pancakeSwapv3 contracts on goerli network. I have been able to do it successfully on hardhat network and also on BSCtestnet, using the pre existing deploy script provided in the ...
1 vote
1 answer
708 views

How would I be able to set slippage for exactInputSingle on Uniswap v3 and Pancakeswap v3?

I'm able to do swap transactions using multicall and exactInputSingle functions on both Uniswap v3 and Pancakeswap v3. However, I have no idea how would I be able to set the slippage. The v2 routers ...
0 votes
1 answer
427 views

pancakeswap v2 flash loan arbitrage real output amount is not as expected

when i monitor a profitable trade. The difference in profit calculated by my own method and the result of getAmoutsOut is not significant. Before sending the transaction, I would use the getAmoutsOut ...
1 vote
3 answers
587 views

Liquidity locking and ETH loose

When you provide liquidity to a liquidity pool, you add 2 different tokens and you get LP Token (liquidity pool tokens). You can recover your 2 tokens amount when you give back your LP Tokens, ...
0 votes
2 answers
623 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
1 answer
39 views

Having trouble adding liquidity to Pancakeswap

I've added tokens to pancakeswap before, and it was easy, but now it doesnt work anymore... perhaps I am doing something really dumb, but I can't seem to figure it out and could use a little help. I ...
1 vote
1 answer
412 views

How to get Buys and sells of a token on a Dex

Im trying to rebuild a simple app that gives me the latest buys or sells of a token on pancakeswap. Im using this code here and it kind of works: def handle_event(event): print(Web3.toJSON(...
0 votes
1 answer
930 views

Setting the value of AmountOutIn

I have been running this small script to buy through the PCS router contract and as it works, the slippage is set to 0. I need to know how to find the value and what it expects so that i can set ...
0 votes
0 answers
18 views

Does removing liquidity from a staked pancakeswap lp unstake it?

If I remove all the liquidity from a PancakeSwap V3 LP, I know it also collect the fees earned. But if that LP is staked in a farm, will removing the liquidity automatically unstake it and harvest the ...
0 votes
1 answer
2k views

unable to swap via swapExactTokensForTokens

i have a problem and hope you could help me. I try to swap BUSD on pancakeswap against an other token. I have a script, written in web3.py which works perfectly fine with BNB and the function "...
0 votes
1 answer
613 views

Sending transactions to smart contract every 3 seconds

I have been trying to solve this issue for a while now and would really appreciate any help i can get. i am essentially trying to create a loop that doesnt stop after one succesful tx. End goal is to ...
0 votes
2 answers
704 views

function swap without Router Uniswap

What is the way to exchange token 0 for token 1 without using the router in Solidity? Does it interact with the token pair?
0 votes
0 answers
105 views

Swap on Pancake swap V3 using web3.py

How can I programatically swap this transaction (https://bscscan.com/tx/0xeb82366f808d194bcae4ede724bb0dbaeebc431fe492ff70b1c3c7a5d5762d47) using web3.py? When swapped from their official webgui they ...
0 votes
1 answer
520 views

How can I calculate gas fee when swapping tokens?

This is my code. const amountIn = ethers.utils.parseUnits('0.1', 'ether'); //ether is the measurement, not the coin const amounts = await router.getAmountsOut(amountIn, [buyToken, sellToken]); const ...
0 votes
1 answer
469 views

Having trouble adding liquidity - JSON RPC Error

I've been having this error over and over again when trying to get liquidity into my token on Pancakeswap. I've reviewed everything and looks fine to me. Can any of you take a look and guide me on the ...
3 votes
3 answers
24k views

Fail with error 'TransferHelper: TRANSFER_FROM_FAILED' even approved in contract

I'm rying to swap some BNB -> Token, then swap it back, all in one solidity function. Here's my code: interface IERC20 { function approve(address spender, uint256 value) external returns (bool);...

1
2 3 4 5
7