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
24 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
117 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
46 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
64 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
379 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
165 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
266 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
209 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
173 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
140 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
129 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
23 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 ...
0
votes
0answers
348 views

JSON RPC Error code -32000 when deploying on BSCTESTNET with Remix IDE using Metamask

So I wrote a contract here: https://github.com/connova/CareBuds-Finance/blob/main/contracts/Buds.sol When deploying this using the injected web3 on the binance testnet (network name BSC Testnet) using ...
0
votes
1answer
22 views

How the exchange calls my Smart Contract methods?

I'm new to the smart contract world and there are many things that I still don't get how works. I've created a simple contract with the following methods: constructor() { tokenCreator = msg.sender;...
0
votes
1answer
272 views

Retrieving APY from PancakeSwap CAKE auto-compounding pool

Looking at the contract from the CAKE auto-compounding pool (https://bscscan.com/address/0xa80240Eb5d7E05d3F250cF000eEc0891d00b51CC#code), it appears there is no direct call for calculating the ...
1
vote
2answers
700 views

understanding the Swap function in pancakeSwap Pair contract

Hi i am trying to understand the reasoning behind the swap function of a pancake pair on the pancakeSwap DEX and the checks it does. this is the function : require(amount0Out > 0 || amount1Out > ...
0
votes
1answer
401 views

Check valid slippage before sending transaction using web3

I have a web3 script that buys and sells the token on Binance Smart Chain (BSC). Now let's say there is a token that has mentioned a mandatory 10% fee in their contract but I don't know about that at ...
0
votes
0answers
64 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
1answer
57 views

where is exchange.pancakeswap.finance repo located?

I have forked pancake frontend successfully from here: https://github.com/pancakeswap/pancake-frontend But seems like Trade(swap, liquidity ...etc) are hosted from different code. Where can i find ...
0
votes
0answers
57 views

Unable to addLiquidity from pancakeSwap fork

I have forked pancakeSwap core and periphery and successfully migrated them on bscTestnet. I have also retrieved the init has code from factory and replaced it on router library. When i tried to call ...
4
votes
1answer
2k views

How to create a liquidity pool by code?

I've seen some scams that : In deploy stage all tokens goes to the owner. The owner go to PancakeSwap and create a liquidity pool using some BNB he have and all supply of tokens. After some time the ...
0
votes
1answer
284 views

How to connect Yield farm frontend to Matic/Polygon

The idea I am following is to create yield farm like https://polyvertex.finance/. Backend with contracts is clear to some extent thanks to tutorials. Problems come with frontend for which I barely can ...
0
votes
0answers
213 views

Set up auto liquidity address for new token

I'm trying to learn how to launch a token and all the necessary steps. So I found a smart contract that fits my needs and would like to deploy it using Remix. But I don't know to set up the auto ...
0
votes
1answer
2k views

Fail with error 'Pancake: TRANSFER_FAILED'

https://bscscan.com/tx/0x66f323c23d249c78da2b8f6f79faa1468bd98533618d7a655081075058e4d086 This deal was failed. Status: Fail with error 'Pancake: TRANSFER_FAILED' To: Warning! Error encountered during ...
0
votes
1answer
292 views

Understand price impact and liquidity in pancakeswap

I am trying to understand how the price impact and liquidity was calculated in uniswap or pancakeswap through the router contract? UNI Router: https://etherscan.io/address/...
0
votes
0answers
133 views

Scam: Variation of the price of the token in 5 orders of magnitude in a second. How does it work?

When purchasing a token, the wrong price is displayed. Specifically, trade.minimumAmountOut (slippageTolerance).raw ('trade' object is from @pancakeswap-libs/sdk-v2) minimumAmountOut shows much less ...
0
votes
0answers
212 views

How to get the liquidity of a pair in pancakeswap or uniswap?

How can I know in pancakeswap or uniswap when a pair is created and how much liquidity is added? At the moment what I have thought is to read the "PairCreated" logs of the Factory contract, ...
0
votes
0answers
274 views

What reason? "Unhandled Rejection (Error): replacement fee too low "

I am going to swap two BSC tokens using etherjs. I sent approval for a transaction and then I sent a swap transaction. I am using a Pancakeswap v2 router. I had this error. Unhandled Rejection (Error):...
0
votes
0answers
74 views

How " migrate " function on PanCake Masterchef Smart Contract work?

Hi folks, I am discovering PancakeSwap Staking contract ! How exactly this below function works ? Here is address contract : https://bscscan.com/address/0x73feaa1ee314f8c655e354234017be2193c9e24e#code ...
0
votes
0answers
682 views

Pancakeswap Error when trying to swap token to BNB using Web3.js and Python

I have written a Swap in python using web3.js. I can't seem to get it to work when I try to buy BNB for tokens. The transaction is created, but the Pancakeswap router gives me the following error: ...
0
votes
0answers
81 views

How to view staking rewards on blockchain? (Pancake Swap)

I recently staked CAKE in Pancake Swap's CAKE auto-compounding SYRUP pool. I get regular, auto-compounding rewards. No problem here. However, I need to see the individual transactions (i.e. have a ...
0
votes
0answers
62 views

How to add more liquidity (tokens for sale)?

I'm a begineer doing some tests using an example token. I want to add more liquidity to pancake swap sale, so potential buyers could for example, buy it. Initially, I've added 10% of the total tokens (...
0
votes
0answers
77 views

I am going through pancakeswap factory contract and unable to understand the feeto ditribution fee

// if fee is on, mint liquidity equivalent to 8/25 of the growth in sqrt(k) function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) { address feeTo = IPancakeFactory(...
0
votes
0answers
39 views

Where do the Swap values come from?

In this transaction, there is a Swap event: amount0In: 0 amount1In: 61415 amount0Out: 14972458620320 amount1Out: 0 It says that 0.00061415 of POOCOIN is being traded for 0.00001497245862032 BUSD. ...
0
votes
0answers
14 views

Getting last buy timestamp for msg.sender in Solidity

I am looking for a way to implement an increased tax fee for msg.sender if they sell a smart contract token within a certain time frame from the last time they received the token. In Solidity, is it ...
1
vote
0answers
52 views

Timestamp of when address received a token

Trying to find a way or documentation in obtaining the timestamp of when an address received the token in a smart contract. I have read many reflection based contracts that apply different levels of ...
0
votes
1answer
779 views

swapExactTokensForETHSupportingFeeOnTransferTokens fails for some tokens when called from script, but works when submitted from Pancakeswap

I have a simple code using web3.py that sells BEP20 tokens: deadline = int(time.time()) + 1200; nonce = w3.eth.get_transaction_count(w3.eth.default_account) sellTxn = self.web3Context.routerContract....
0
votes
1answer
47 views

Pancakeswaps Router 2.0 swapExactTokensForTokens fails. No errors

Please tell me why this tx is failed? https://bscscan.com/tx/0xa5d5df02bfd7ea6f69664f3f404973e572fca20b35e0c5d27fd74aea0fe3b5cf Tx Data: 0 amountIn uint256 66350193942313470867 1 amountOutMin ...
1
vote
2answers
3k views

Is there a way to convert Binance pegged tokens into Ethereum based tokens?

This is confusing me a lot. Basically if you have a metamask wallet and have some BNB there, and you use PancakeSwap for example, even if you convert the BNB into ETH or BTC, it won't be the real ...
0
votes
0answers
710 views

calculate automatic slippage for pancakeswap exchange like Poocoin.app does

I am trying to automate swap on pancakeswap but for some tokens manual slippage percent doesn't help and it fails. I need to set slippage automatically every time based on token requirement. In ...
0
votes
0answers
34 views

How to associate Transfer events with a Swap event?

Let's take this Transaction as an example. Here we have events: 287 Transfer 289 Transfer 291 Swap We can associate those two Transfer events with Swap event by looking at the sequence of events and ...
0
votes
1answer
154 views

Is this smart contract code malicious?

I was looking at the code here: https://0bin.net/paste/Y0Vas-gl#qPO+In23eGFEftdhXP7hWqIkI2xfyqxEbyjL-beMsLH which is shown in a tutorial about flash loans: https://www.youtube.com/watch?v=o9o141Luzzo&...
0
votes
1answer
326 views

Getting the balance of a token in wallet - decimal issue

Im trying to get the balance of a certain token from a wallet address in order to then swap out those tokens. The problem i have is that the code returns the tokens where the decimal point is out ...
1
vote
1answer
94 views

What does a Swap event describe when amount0In and amount0Out are non-0, but amount1In and amount1Out are zero?

Take a look at this transaction, It describes the following event: amount0In: 104852331424429462 amount0Out: 104642626761580603 amount1In: 0 amount1Out: 0 104852331424429462 WBNB was transferred in ...
1
vote
0answers
8 views

What's effective rate when one of the reserves is 0?

In this transaction, ECT/WBNB reserves were: reserve0: 0 reserve1: 316227766034 given that WBNB/ECT rate is calculated by dividing reserve1/reserve0, what does it make the spot price of the token?
1
vote
0answers
61 views

pros/cons for creating own custom contract router

I have seen some people (bots?) using custom routers/contracts for trading and tried to google this why someone wants to use custom router instead uniswap/pancakeswap. I wonder if someone here knows ...
0
votes
1answer
991 views

What are the Pancakeswap "*SupportingFeeOnTransfer" methods for?

There are a couple of methods in the Pancakeswap router contract ending in *SupportingFeeOnTransferTokens, such as swapExactTokensForTokensSupportingFeeOnTransferTokens Example: https://github.com/...
1
vote
1answer
265 views

What's the relationship between LP reserves and Swap rate?

This transaction transaction describes Swap event: amount0_in=14067900000000 amount1_out=393017164305296368 This means that the effective trade rate is: trade_rate=round(amount1_out/amount0_in)=27,...
3
votes
1answer
108 views

How to understand the constant product formula?

Let's use this transaction as an example. Here 1 BUSD was transferred to Zombie / BUSD LP in exchange for 172054109197 Zombie tokens. (3511308350 (2%) Zombie tokens were burned as part of the ...
0
votes
0answers
25 views

How to calculate new reserve values after a Swap?

Let's use this transaction as an example. Here 1 BUSD was transferred to Zombie / BUSD LP in exchange for 172054109197 Zombie tokens. (3511308350 (2%) Zombie tokens were burned as part of the ...