GithubHelp home page GithubHelp logo

pancakeswap-sniper-bot's Introduction

alt text

PancakeSwap sniper bot

Purpose

This bot helps you to compete with other trading bots or traders when buying a cryptocurrency on the PancakeSwap DEX. The bot can be used for fairlaunch ( stealthlaunch ) projects or if you just want to buy as fast as possible on PancakeSwap trading pair creation. If a project is hype and the community which is willing to buy the particular token is quite big, then it is close to impossible to compete manually with bots or traders. PancakeSwap, PooCoin, etc are known to have slow UX which will only make your buying transaction slower and in the end you might buy at not desired price. For long time bots have been integral part of trading not only for the cryptocurrencies, but also for stocks, fiat currencies, etc.

Grateful users & support

This sniper bot is fully free and it was never meant to be paid. However if you appreciate my work I accept BNB or ETH donations at 0x5ADD71300d924213456b037b5be25020C62D9e08. The real rockstars will follow my twitter as well:

Twitter URL

For the people who have expressed their support through a donation I offer personal assistance in setting up the bot. ( contact me in Twitter )

Features

  • Operating with PancakeSwap: Router v2
  • Has the option to work with both BSC mainnet and testnet
  • Including all kind of transaction options like gas price, gas limit, transaction slippage, transaction deadline, etc
  • Has the option to fire multiple transactions at once
  • Supporting milliseconds
  • Free

Requirements

  • npm 6.0.0 or above
  • NodeJS 10.0.0 or above

Installation

Clone this repository ( or download from Code -> Download ZIP ) and open your terminal inside the bot folder. Run npm install inside the bot folder. This command will download all the needed libraries which the bot needs to work properly. After the installation of the libraries is done then you're all set up to start sniping tokens!

Usage

You can run the script using node or pm2 commands. I personally like to use the pm2 command on my server, because PM2 is a process manager which takes care for my script to run 24/7. ( For the pm2 option you need to own a virtual server. )

Required parameters:

  • tokenAddress - this is the contract address of the token you're willing to buy. String, 42 bytes size starting with 0x.
  • buyingBnbAmount - this is the amount of BNB which you are willing to use to execute the buying transaction. Integer or float.
  • senderPrivateKey - this is the private key of the wallet address which will be used to execute the buying transaction. String, 66 bytes size starting with 0x.

Optional parameters:

  • node - by default the bot will be using a standard BSC node. This node will be enough for signing transactions and sniping tokens, but however if you want be as fast as possible then you should find your self a fast node. When you're able to provide a node better than the standard one you can pass it as node parameter when starting the bot. The node has to be full URI to the RPC endpoint, example: https://localhost:8545.
  • gasLimit - the maximum amount of gas you are willing to consume on a transaction, default value is 500 000. ( This value may not be sufficient in some cases, because some projects require more gasLimit in order for the tokens to be transferred. )
  • gasPrice - the transaction gas price in Gwei, default value is 10 Gwei. ( Something very important related to the transaction fee is that the address which is used to snipe should have the minimum of gasLimit * gasPrice(in wei) BNB balance to complete the transaction. Which means if the gasLimit is 500 000 and then gasPrice is 50 Gwei then we should have 500 000 * 0.00000005 = 0.025 BNB in our balance on top of the amount we placed in the buyingBnbAmount parameter. This does not mean that the 0.025 BNB will get spent, it's just how the validation before the transaction signing works. )
  • transactionIterations - how many times you want the transaction to be executed. Some fairlaunch projects have smart contract conditions to not buy big amounts of tokens for single transaction, so in the case that you want to buy bigger amount and to bypass the contract condition you can execute many transactions buying same amount. Setting transactionIterations to 3 will execute 3 different buying transactions with the same transaction parameters. Default value is 1.
  • transactionSlippage - the difference ( in percents ) between the expected price of a trade and the executed price of that trade. Default value is 15 percents, integer.
  • transactionDeadline - your transaction will revert if it is pending for more than this long. Default value is 1200 seconds, integer.
  • bscNetwork - accepts only mainnet and testnet values. Defines to which network should the bot submit blockchain transactions. Default value is testnet.
  • createLogs - boolean, if set to true it will create ./logs folder and save logs on different bot actions.
  • cronTime - how often should the bot try to buy the particular token. Default is */100 * * * * * * aka every 100 milliseconds.
  • botInitialDelay - by default when starting the bot for first time it has 10 seconds delay to double check what parameters have been passed. Setting this parameter to 0 will remove the delay if needed.
  • explorerApiKey - this parameter is the API key generated by https://bscscan.com/apis. By passing this parameter the bot will only execute the buy transactions only if the contract is publicly verified on the blockchain explorer. The bot need this API key in order to make the request to the explorer API. Warning - for your own safety do not buy tokens with not verified smart contracts. It's very possible that this is a malicious contract.

Sample terminal command:

  • Using node - node pancakeswap-sniper-bot.js -- tokenAddress=0xc9849e6fdb743d08faee3e34dd2d1bc69ea11a51 buyingBnbAmount=1.05 senderPrivateKey=0x8da4ef21b864d2cc526dbdb2a120bd2874c36c9d0a1fb7f8c63d7f7a8b41de8f createLogs=true gasPrice=25 transactionSlippage=30 bscNetwork=mainnet
  • Using pm2 - pm2 start pancakeswap-sniper-bot.js -- tokenAddress=0xc9849e6fdb743d08faee3e34dd2d1bc69ea11a51 buyingBnbAmount=1.05 senderPrivateKey=0x8da4ef21b864d2cc526dbdb2a120bd2874c36c9d0a1fb7f8c63d7f7a8b41de8f createLogs=true gasPrice=25 transactionSlippage=30 bscNetwork=mainnet ( This option is for people who are owners of virtual servers. By using pm2 you can start the bot on the virtual server and shut down your physical device. If you wish to use the bot at same time for multiple crypto tokens you could make several pm2 instances by passing --name parameter to the pm2 command. Example: --name "app name". )

pancakeswap-sniper-bot's People

Contributors

miroslavnedelchev avatar mnedelchev-vn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pancakeswap-sniper-bot's Issues

Token selling opportunity

Hello! First of all I want to say thanks to you for your time and effort spent on the project which works great for me!
But I want to ask you a question: is there any way to modify code for selling token?

hi i got this error

Hi i got this error . How can i fix it ? Thanks a lot

internal/modules/cjs/loader.js:892
throw err;
^

Error: Cannot find module 'cronr'
Require stack:

  • C:\sniper\pancakeswap-sniper-bot.js
    ←[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)←[39m
    ←[90m at Function.Module._load (internal/modules/cjs/loader.js:745:27)←[39m
    ←[90m at Module.require (internal/modules/cjs/loader.js:961:19)←[39m
    ←[90m at require (internal/modules/cjs/helpers.js:92:18)←[39m
    at Object. (C:\sniper\pancakeswap-sniper-bot.js:3:15)
    ←[90m at Module._compile (internal/modules/cjs/loader.js:1072:14)←[39m
    ←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)←[39m
    ←[90m at Module.load (internal/modules/cjs/loader.js:937:32)←[39m
    ←[90m at Function.Module._load (internal/modules/cjs/loader.js:778:12)←[39m
    ←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)←[39m {
    code: ←[32m'MODULE_NOT_FOUND'←[39m,
    requireStack: [ ←[32m'C:\sniper\pancakeswap-sniper-bot.js'←[39m ]

Node Js and NPM Install

Hello, I'm a Windows user trying to install node js and npm and no matter what I do I run into issues when I go to run NPM Install, so it would be good to know more information if possible on what are the exact requirements cause when I got install to use the bot I get this kind of error, Thank you!

image

error

Error: Cannot find module 'cronr'

i got this error

i getting this error now . Can you help me ? Thanks

trading pair is active.
Cronjob iteration.
Cronjob iteration.
Cronjob iteration.
Method pancakeContract.methods.swapExactETHForTokens.estimateGas() failed. Message: Returned error: execution reverted
Cronjob iteration.
Cronjob iteration.
Cronjob iteration.

noob

Hey bro I am total noob in this.
Could you please help me get through the installation of the bot! I mean I have downloaded Nodejs, that instralled chocolatey with virtual studios 2017. Now in the read me section it says "run npm install inside the project folder" i've tried watching a few videos, But still do not knows what to do!
Is there any video that shows the steps from cloning/ downloading the ZIP to installing the software to run them, to running the bot ? Or maybe can you help me get through this please!

estimategas error

great bot , work well for all most coins., Got an issue with 1 coin though:

tokenAddress=0xb9654A42f0F5dCDEf5617DebF8bd048E33F180E7

Pancake: TRANSFER_FAILED
Cronjob iteration.
Trading pair is active.
Method pancakeContract.methods.swapExactETHForTokens.estimateGas() failed. Message: Returned error: execution reverted: Pancake: TRANSFER_FAILED

estimateGas() failed error

image

Hello, I am getting this error when trying to snipe certain tokens. Otherwise the bot works pretty well. I have tested all sorts of gas limit, slippage, and gas price settings, same error, only on certain tokens. Even well after the liq has been added, same error.

Missing or wrong tokenaddress parameter

after doing everything mentioned, i get the error that the token address is missing or wrong.

// ======================== REQUIRED PARAMETERS ========================
if (!projectData.utils.propertyExists(args, '0xa73c2c0f359ab3a3bf6c9022adb84ba21609d548') || args.tokenAddress == '' || args.tokenAddress == null || args.tokenAddress == undefined || args.tokenAddress.length != 42) {
return console.error('Missing or wrong tokenAddress parameter.');
} else if (!projectData.utils.propertyExists(args, '1') || args.buyingBnbAmount == '' || args.buyingBnbAmount == null || args.buyingBnbAmount == undefined) {
return console.error('Missing or wrong buyingBnbAmount parameter.');

terminal:
/pancakeswap-sniper-bot.js
Welcome to PancakeSwap Sniper bot!
Missing or wrong tokenAddress parameter.

PM2 Error - Script not found

An error is occurring when trying to run pm2 command. Can you help me?

[PM2] Spawning PM2 daemon with pm2_home=C:\Users\User\.pm2
[PM2] PM2 Successfully daemonized
[PM2] Starting C:\Users\User\Downloads\pancakeswap-sniper-bot-main\pancakeswap-sniper-bot.js in fork_mode (1 instance)
[PM2] Done.
[PM2][ERROR] Script not found: C:\Users\User\Downloads\pancakeswap-sniper-bot-main\tokenAddress=0xc9849e6fdb743d08faee3e34dd2d1bc69ea11a51

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.