Questions tagged [pancakeswap]

62 questions
1
vote
0 answers

PancakeSwap API - how to get APR?

I need info about pools APR/APY from API endpoints like: https://api.pancakeswap.info/api/v2/summary or https://api.pancakeswap.info/api/v2/pairs but this info is missed there. How can I get it ? When going to v3 API, eg .…
Igor Savinkin
  • 5,669
  • 8
  • 37
  • 69
1
vote
2 answers

Crypto tradingbot (Pancakeswap) using node.js

I am using node.js in VSCode. I know another programming language decently enough that I could find relevant code snippets and create the below code. However, my JavaScript knowledge is very limited. The below code crashes at line 52, but states "No…
LDK
  • 51
  • 1
  • 2
1
vote
4 answers

How to get exact value of a token with Web3.py on PancakeSwap? Function getAmountsOut() returns a wrong value

I was trying to get the price of various crypto coins using web3.py. tokenAddres = '0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82' #Cake tokenAddres = Web3.toChecksumAddress(tokenAddres) bnbPrice = calcBNBPrice() print(f'current BNB price:…
SeriousTia
  • 11
  • 1
  • 1
  • 5
0
votes
0 answers

Web3Wallet's method "eth_sendTransaction" throwing error when i swap from pancakeswap in react-native wallet app

I'm using walletconnect v2's web3wallet in my react-native wallet app. I connected my wallet with pancakeswap,selected chain on pancake swap is binance mainnet. When i try to swap from bnb to usdt, in my walletapp modal is opened of…
0
votes
5 answers

Got an error on adding liquidity on PancakeSwap -> "addLiquidityETH" reverted with the following reason: PancakeLibrary: INSUFFICIENT_LIQUIDITY

I created my own token. Here is code of it: // SPDX-License-Identifier: MIT pragma solidity ^0.8.17; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns…
0
votes
0 answers

Pancakeswap STF error when making a trade with pancakeswap sdk (`SwapExactTokensForTokens`)

The token that I am trading is a token pair that is deployed on the pancakeswap V2 pool. However, the token that I am dealing with includes token tax which triggers the STF error when other token pairs work perfectly. I have made sure that the…
Jasper
  • 1
  • 1
0
votes
2 answers

Uniswap Emergency Withdraw - Masterchef Contract

I'm in search of where and how (if possible) I can do an emergency withdrawal on Uniswap V3. In other pools I've seen, you can do so by finding the Masterchef contract (pancake example), entering the blockchain explorer i.e. polygonscan, ethscan, or…
Jonca33
  • 3,333
  • 7
  • 25
  • 35
0
votes
1 answer

Understanding 2 transactions

I was analyzing some transactions on new coins, and I faced the following. Here are the two…
oktapodia
  • 1,695
  • 1
  • 15
  • 31
0
votes
1 answer

"Execution reverted with reason: STF" on Pancakeswap BSC Testnet. Works on Goerli

I am testing a smart contract that has a auto LP fee feature which means that the smart contract calls these two functions inside the _transfer function every 5 sells: function swapTokensForETH(uint256 tokenAmount) private { address[] memory…
Lopjf
  • 33
  • 1
  • 5
0
votes
0 answers

swapExactETHForTokensSupportingFeeOnTransferTokens makes tokens disappear

i have been struggling with doing swaps. i manage to run a successful transaction on pancake swap with the code below. (I use alchemy mainnet fork and hardhat) it("should use defi to get some tokens", async () => { const WBNB =…
Chris
  • 570
  • 2
  • 9
  • 19
0
votes
0 answers

Transaction declined PancakeSwap Smart Router V3

I am trying to exchange 1 USDT for some BNB. By using PancakeSwap Smart Router V3 and python web3. example code tokenOut = web3.to_checksum_address("0x1d2f0da169ceb9fc7b3144628db156f3f6c60dbe") # XRP tokenIn =…
0
votes
0 answers

Could not identify the intended function with name `quoteExactInputSingle`

I am trying to get the minimum amount of token when exchanging for pancakeswap. My Code. I Use BNB testnet test_provider = 'https://data-seed-prebsc-2-s3.binance.org:8545/' w3 = Web3(Web3.HTTPProvider(test_provider)) with open('router_abi.json') as…
0
votes
1 answer

Python 3.11.3 - Web3 6.4.0 - Python reports that contract.functions.swapExactETHForTokens does not have attribute buildTransaction

I have now Python 3.11.3 and Web3 6.4.0 and I cannot use anymore my old code for buying/selling tokens in Pancakeswap because Python reports that contract.functions.swapExactETHForTokens does not have attribute buildTransaction How Can I modify my…
0
votes
0 answers

Code which copy tradeers in pankakeswap doesnt work

So Im trying to use tihs code to copy traders in pancakeswap. But when the code achive the line (how i think) let decodedData = iface.parseTransaction({ data: txInfo.data }) code doesnt do bet like a trader. Code and errror is under. const { ethers…
ra1n89
  • 3
  • 3
0
votes
0 answers

I want replace transaction never happen if my transaction goes failed so the low gas fee should apply not the gas fee i have set

function _buy(bytes calldata _data) internal { ( address router, uint256 amountIn, uint256 amountOutMin, address[] memory path ) = abi.decode(_data, (address, uint256, uint256, address[])); IERC20…