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
0answers
4 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 ...
0
votes
0answers
13 views

How to check if swap was successful?

This is a part of my payable function that is causing a problem. What happens is we receive Eth and swap it to a specific token. It works great in testnet. But on mainnet the "require" check ...
0
votes
1answer
16 views

PancakeSwap's "getAmountsOut" suggests infinite liquidity; UniSwap equivalent works as expected

TDLR: the same code that works with UniSwap is capable of returning an infinite "amountOut" when querying PancakeSwap router function "getAmountsOut". I'm using web3.py to call the ...
0
votes
0answers
8 views

How to test in local, a contract if call an AMM contract?

I'm trying to test a smart contract but i have inside of my contract a call to PancakeSwap and i would like to test it, but i dont find what is the good way to do it: i have to mock router´s contract?...
0
votes
0answers
11 views

Failed tx/swap, 5 UNI in limbo, no Transfer Event Emitted. How to get UNI unstuck?

I attempted to swap 5 UNI for 40something SHI3lD. Tx failed, execution reverted but UNI wasnt sent back. 2nd Tx: 5 UNI for 41SHI3LD was successful. But I thought the 2nd would use the missing 5 UNI ...
0
votes
0answers
9 views

The method 'debug_traceTransaction' does not exist / is not available. Remix in BSC test net

I deployed with Remix a contract on BSC testnet successfully. I have tried to use the remix debugger with a failed transaction (swap in pancakeswap) but I get the following error message in Remix: ...
0
votes
1answer
36 views

swapExactETHForTokens function execution

Please, help me. I try to do swapExactETHForTokens function from PancakeSwap Router contract. It's my code: def swap_exact_eth(router_contract_sample, token_contract, ...
0
votes
0answers
19 views

Why is my transaction Failed - BSC Web3 Python

I tried to execute this code below, It went through but it failed after 20 seconds. https://bscscan.com/tx/0x8da9fbde14a5252a6c8f037ad39fa0db69e77b93990fe7f65d2c305dd208cd99 Can someone Please help me ...
0
votes
0answers
17 views

How can I get this mapping function in an interface? [duplicate]

I have this mapping in a smart contract: mapping (uint256 => mapping (address => UserInfo)) public userInfo; I want to call this in a interface like function view returns: Can someone tell me ...
0
votes
1answer
56 views

Pancake Swap Factory smart contract error

I am using web3js to call PancakeFactory v2 contract (bscscan): contract address: 0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73 Anytime I want to call any function present in the contract I end up with ...
0
votes
0answers
25 views

Pancakeswap Liquidity error on Testnet

I am trying to add liquidity on pcs testnet. Here is the code snippet: function _addLiquidity() payable public { uint256 _amountToken = balanceOf(address(this))...
0
votes
1answer
19 views

I accidently send unrequited Token to Pancakeswap Pool. My Tokens liquidity stolen

I am an owner of bep20 token and locked the liquidity with mudra locker. I accidentally send token from outside to pancakeswap pair address and 2k dolar WBNB transferred to an unknown wallet. My ...
0
votes
1answer
88 views

What happens when disconnect my wallet from Pancakeswap

Suppose I have a Binance Chain Wallet and I use that to connect to Pancakeswap or similar site to do staking and yield farming. I successfully set up everything and start yield farming. So far so good....
0
votes
2answers
26 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 it to user.
0
votes
0answers
13 views

Addliquidity function

If I want only owner can add liquidity no one else. Is this possible using only owner modifier in addliquidty function or is there any other way?
0
votes
0answers
30 views

How to send bnb programmatically in different scenarios

I am trying to add a price pool in bnb for my token and I did the following code: function swap(uint256 amount, address destination) private { uint256 bnbBalance = address(this).balance; ...
0
votes
1answer
54 views

Way to tackle arbitrage bots

I deployed a token ABC and created a liquidity pool in pancakeswap with pair ABC/BNB. But arbitraged bots attacked and stole a large sum of money. How to stop this and why is this occurring? I think ...
0
votes
1answer
33 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
0answers
41 views

SwapExactTokensForETH is called instead of TransferFrom

I developed a smart contract which calls PCS router V2 to get some data, however I don't know what I did to change the way it works and now when I interact with it via PancakeSwap the method called is ...
0
votes
1answer
23 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
1answer
22 views

Delegate Call Reverting for Unknown Reason

I'm trying to make a delegatecall to the PancakeSwap Routerv2 from my contract, to perform a swap, but for some reason it's not working. Here's my code: // pancakeswap router address address public ...
0
votes
0answers
24 views

Question about swapExactETHForTokens() in uniswap Router02

Is calling the function on the uniswap router v2 function swapExactETHForTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external ...
0
votes
0answers
476 views

The transaction cannot succeed due to error: execution reverted: PancakeRouter: INSUFFICIENT_OUTPUT_AMOUNT

Why i cant exchange my fckn tokens on pancakeSwap?
1
vote
1answer
55 views

PancakeSwap charges a fee to mint LP according to their code?

I am looking at the PancakeSwap contract for LP's and I noticed they charge a fee for creating LP's. No where in their documentation does it say there is a fee for depositing liquidity. What is ...
0
votes
0answers
33 views

Tokenomics don't work

I have a problem with the tokenomics of my token. Since yesterday when I tried to increase the auto LP fee, tokenomics are not working on transactions from PCS (burn, redistribution and auto LP). ...
1
vote
0answers
18 views

Uniswap (pair/liquidity) creation in contrat constructor. How is it possible?

Many of the new tokens create pair on Pancakeswap/Uniswap at the token constructor. I understand that the token constructor runs when the contract is created. constructor() public { ...
1
vote
1answer
142 views

How to differentiate AddLiquidity from SwapExactTokensForETH on contract function execution on UniSwap fork

we are trying to process a fee when tokens are "Sold" on PancakeSwap. For now "Sold" is when the user swaps their tokens for BNB. Initially our current logic would also charge a ...
0
votes
0answers
34 views

Adding initial liquidity to a token

We've had a bit of a struggle finding an answer to this question online: When creating a brand new token, and adding initial liquidity to it from the creator address(e.g. 100BNB), should we add that ...
0
votes
0answers
104 views

Unable to remove liquidity using method removeLiquidityETHSupportingFeeOnTransferTokens

I'm trying to deploy a token with transaction fee on Remix, I deployed my own factory and router, and I copied the code of safemoon with some changes with _name, _symbol, _tTotal, _maxTxAmount and ...
0
votes
0answers
34 views

How do I get the token symbol, token name, and size of liquidity pool for a newly minted pair using Node.js and Web3?

//original code courtesy of EatTheBlocks factory.on('PairCreated', async (token0, token1, pairAddress) => { console.log(` New pair detected on PancakeSwap ================= ...
0
votes
0answers
49 views

PancakeSwap Approve error 401

I'm trying to use the contract approve function, but I have this 401 error : events.js:352 throw er; // Unhandled 'error' event ^ Error: Unexpected server response: 401 at ClientRequest. (H:\bot\...
0
votes
0answers
29 views

How to determine current(=pending) Uniswap V2 Pair's price?

Are there any ways to get the current/latest price of an Uniswap Pair (V2)? I've understood that getReserve and getAmountsOut calculates the the return values based on the latest mined block? But for ...
0
votes
0answers
58 views

tx.wait() never resolves using ethers library

I am using ethers library in my nodejs , and trying to call a function in smartcontract which looks like: const tx = await router.swapETHForExactTokens( amountOut, [bnb,...
0
votes
1answer
289 views

Testing Token with Uniswap liquidity provisioning using hardhat

I'm attempting to fork Safemoon (or really NotSafeMoon), and use it as a vehicle to learn smart contract development. (I've got a substantial amount of what you might call "Web 2.0" dev ...
0
votes
0answers
263 views

bot sniping tokens on pancakeswap by watching the mempool

i seen a video on youtube of a sniper bot buying tokens as soon as the token launches on pancakeswap and gets in on the same block. i have tried to use another bot that buys the tokens when the pair ...
1
vote
1answer
151 views

How To Read LP Tokens Held By Address After Being Staked On Pancakeswap

My understanding is that after a user provides liquidity to a farm on pancakeswap they are given a Liquidity Pool token (which is added to their wallet) but once they stake this LP token it is no ...
0
votes
1answer
860 views

How to conduct a flash loan on PancakeSwap?

Apparently it's possible to take a flash loan on PancakeSwap, being that it's a fork of Uniswap. However, I haven't found any examples anywhere of a flash loan on PancakeSwap, nor do the docs mention ...
0
votes
1answer
551 views

Web3 Python token sell pancakeswap

I am trying to sell my tokens via python web3. But sometimes I get an error "execution reverted: Pancake: K". I researched this error and it has to do with the slippage but pancake swap docs ...
0
votes
0answers
22 views

How to create liquidity with code [duplicate]

I'm currently working on a BEP20 token. I am trying to figure out this whole liquidity thing works. I know that you can add liquidity manually in the Pancake swap. I'm wondering is there a way to do ...
0
votes
0answers
77 views

Error 'ds-math-sub-underflow' when trying to use pancakeswap router contract

I'm coding a simple app in node.js to retrieve token prices. I am using router contract '0x10ED43C718714eb63d5aA57B78B54704E256024E' and ethers.js library Most addresses seem to work correctly, but ...
0
votes
1answer
40 views

Smart contract to exchange old bep20 tokens for new ones

I've created two Bep20 tokens (old/new) and I was wondering if I could write a smart contract that exchanges/swaps old tokens for new ones. Is there a simple way to exchange two Bep20 tokens using a ...
0
votes
0answers
52 views

Retrieve APR data from Pancakeswap Finance [BSC]

Is there an API by Pancakeswap Finance (BSC) to receive the APR for each farm and pools? I personally don't wan't to calculate all APR individually by hand.
0
votes
1answer
266 views

Uniswap/PancakeSwap function swapExactTokensForETH produce error

I have code to call pancakeswap/uniswap router function to swap token. In my code, I have no problem calling swapExactETHforTokens when swapping WBNB to BUSD in BSC. my problem came when I tried ...
0
votes
1answer
113 views

How to deal with liquidity for a BEP-20 token?

I've released a few BEP-20 tokens so far and some of them have been quite successful at launch but then suffer from lack of perpetual marketing, my team and I are dealing with this challenge. However, ...
1
vote
1answer
175 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 ...
1
vote
1answer
163 views

UNISWAP/PANCAKESWAP get list of LP holders of a token

Is there a simple way to get a list of LP-holders for a particular Uniswap/Pancakeswap pair? I need to know the addresses of people who has provided liquidity for my token (which has been already ...
1
vote
1answer
116 views

How can we fetch the current market price to our DEX?

We are fixing the price at the time of creating pair for our token with BNB by adding liquidity. If the Price of the BNB/BUSD. How can we fetch the current market price and update in our DEX? Is there ...
0
votes
2answers
101 views

How to set token transaction limit?

If I create a token on Cointool.app, is there any way I can add a limit on the number of tokens bought in any transaction? Or does it depend on the amount that's in the liquidity? e.g. If I want to ...
1
vote
0answers
93 views

Token w/ liquidty fees - create LP pair before send tokens to pancakeswap or to burn?

If I create a token (through cointool.app) that has liquidity fees, and I want to burn some of the supply after creating it, and I need to send the rest to pancakeswap for trading - do I need to ...
0
votes
1answer
19 views

How does CAKE get burnt since all the burn functions are internal in the source code

I am trying to study CAKE of Pancakeswap source code. I don't seem to grasp how does the owner or users burn the tokens(CAKE) since all burn functions in the source code are internal functions. on of ...