LimitSwap
Search…
LimitSwap Bot setup guide πŸ› οΈ

1/ First steps

Prerequisites :
  • Read the Readme on GitHub for a step-by-step tutorial on how to install the bot
Our bot works with 2 json files :
  • settings.json
  • tokens.json

2/ Configure your settings

You need first to configure your account.
1/ Run the bot first, and enter your wallet and Private Key : bot will ask you to enter a password so as to encrypt your private keys.
2/ Open settings.json file and set your Exchange / Node values:
1
[
2
{
3
"LIMITWALLETPRIVATEKEY": "do not enter it manually, open the bot : it will encrypt it",
4
"LIMITWALLETADDRESS": "wallet address where you hold your LIMIT tokens",
5
"WALLETADDRESS": "wallet address you want to trade on : can be different from LIMIT wallet",
6
"PRIVATEKEY": "do not enter it manually, open the bot : it will encrypt it",
7
"WALLETADDRESS2": "null",
8
"PRIVATEKEY2": "null",
9
"WALLETADDRESS3": "null",
10
"PRIVATEKEY3": "null",
11
"WALLETADDRESS4": "null",
12
"PRIVATEKEY4": "null",
13
"WALLETADDRESS5": "null",
14
"PRIVATEKEY5": "null",
15
"USECUSTOMNODE": "false",
16
"CUSTOMNODE": "put your own node here if you want and set USECUSTOMNODE = true",
17
"EXCHANGE": "pancakeswap",
18
"EXCHANGEVERSION": "2",
19
"PREAPPROVE": "true",
20
"UNLIMITEDSLIPPAGE": "false",
21
"PASSWORD_ON_CHANGE": "false",
22
"VERBOSE_PRICING": "false",
23
"SLOW_MODE": "false",
24
"ENABLE_APPRISE_NOTIFICATIONS": "true",
25
"APPRISE_PARAMETERS": ["macosx://", "windows://"]
26
}
27
]
Copied!
​
Since 4.0.0, LimitSwap can trade with 5 wallets at the same time, if you use MULTIPLEBUYS option
  • EXCHANGE : enter the exchange you want to use. Available values:
    • Uniswap
    • Pancakeswap
    • Biswap
    • Pinkswap
    • Bakeryswap
    • Spiritswap
    • Spookyswap
    • Quickswap
    • ApeSwap
    • KuSwap
    • KoffeeSwap
    • Pangolin
    • Traderjoe
    • ... and also Pancakeswaptestnet and Uniswaptestnet, if you want to use the bot on testnets
      πŸ˜‡
TUTORIAL : HOW TO TEST THE BOT ON PANCAKE TESTNET
1/ Enter "pancakeswaptestnet" in settings.json
2/ Ask 1 testnet BNB here : https://testnet.binance.org/faucet-smart
3/ Add BNB testnet to your metamask
4/ Use this website to make a swap on testnet : https://pancake.kiemtienonline360.com/
5/ Go here to find the contract address of the token you just sniped on testnet : https://testnet.bscscan.com/
6/ Enter this contract address in your tokens.json
7/ Snipe :)
​
HOW TO FIND TOKENS on BSC testnet ?
You can find many transactions on Pancake testnet here : https://testnet.bscscan.com/address/0xd99d1c33f9fc3444f8101754abc46c52416550d1
-----------------------------------------------
TUTORIAL : HOW TO TEST THE BOT ON ETH RINKEBY TESTNET
1/ Enter "uniswaptestnet" in settings.json
2/ Ask 0.1 testnet ETH here : https://faucets.chain.link/rinkeby
3/ Add ETH testnet Rinkeby to your metamask
5/ HOW TO FIND TOKENS ? go here to find contract address of tokens : https://rinkeby.etherscan.io/address/0x7a250d5630b4cf539739df2c5dacb4c659f2488d
6/ Enter contract address in your tokens.json
7/ Important : use this in your tokens.json
"GAS": "BOOST",
"BOOSTPERCENT": "150",
8/ Snipe :)
9/ See results here : https://rinkeby.etherscan.io/
​
  • EXCHANGEVERSION Only available for Pancakeswap. Select "1" or "2".
    If you're not using Pancake, just leave it like this, bot won't take it into account.
  • LIMITWALLETPRIVATEKEY / PRIVATEKEY You need to enter here the Private key (and not the 12 words seed phrase) of the wallets you want to use. Read this article to learn how to export your private key from Metamask.
Don't worry, your private keys are encrypted with a password
πŸ”
​
You can use same wallet or different wallets, for holding LIMIT tokens and trading. It's as you prefer
πŸ˜‡
  • USECUSTOMNODE Set it to "true" if you want to use a custom node.
  • CUSTOMNODE If you want to use a custom node, enter here your node's address in http, wss, or IPC Example: https://bsc-dataseed4.ninicoin.io or wss://bsc-ws-node.nariox.org:443
Go read this page if you want tips on nodes / custom nodes
πŸ•΅
​
​
  • PREAPPROVE Tells the bot to preapprove tokens on startup or not
    ​
  • ENCRYPTPRIVATEKEYS Will be filled automatically when you start the bot for the first time
  • UNLIMITEDSLIPPAGE Use this parameter if you want the bot to bypass completely the slippage setting and buy at any slippage, to avoid the "INSUFFICIENT_AMOUNT" Error If you select UNLIMITEDSLIPPAGE= true, bot won't take into account SLIPPAGE parameter.
Use UNLIMITED SLIPPAGE WITH CAUTION THIS SHOULD BE USED FOR DEGEN SNIPES ONLY AND CAN RESULT IN LOSS OF FUNDS IF USED INCORRECTLY!!!
​
  • PASSWORD_ON_CHANGE Activate this option if you want the bot to ask your private key's password again when you update tokens.json (useful if you're afraid someone could change it while the bot is running)
  • VERBOSE_PRICING Default setting is "true", but if you set it to "false", bot will only show lines on the screen if the price is updated, like this :
  • SLOW_MODE
    A user contacted me because he was running the bot 24/24 on the default node, and his IP got temporarily banned because he made too many calls. Indeed, on default RPC nodes, there is a rate limit (example : https://docs.binance.org/smart-chain/developer/rpc.html#rate-limit) --> We created a SLOW_MODE parameter, who makes the bot do price check every 0.5s only. Use it if you let the bot run all night on default node, if you just need to sell tokens without need for sniping, for instance
    To use it :
    • enter SLOW_MODE : true in settings.json
    • or run python LimitSwap.py --slow_mode
    • or run python LimitSwap.py -sm
​
  • ENABLE_APPRISE_NOTIFICATIONS / APPRISE_PARAMETERS You can now receive real-time notifications when LimitSwap made a BUY or a SELL order What is Apprise ? It's an API who allows you to get Push notifications on your Phone / computer / Telegram / Discord / SMS... basically everywhere ! Check : https://github.com/caronc/apprise
    How to use it 1/ Check Apprise Github for documentation : https://github.com/caronc/apprise#popular-notification-services 2/ Configure your settings.json : - "ENABLE_APPRISE_NOTIFICATIONS": "true", - "APPRISE_PARAMETERS": [put your parameters here : you can put several notifications at the same time]
    Example
    • you are using a Windows computer and want to receive a Windows notification
    • you have registered on PushSafer so as to receive a notification on your phone. The private key they gave you is eFhoOW0gh0vwvOCqDPlB
    --> enter this in your settings.json : - "ENABLE_APPRISE_NOTIFICATIONS": "true", - "APPRISE_PARAMETERS": ["windows://", "psafers://eFhoOW0gh0vwvOCqDPlB"]

3/ Configure your tokens

Open tokens.json to configure the tokens and the orders that your bot will create. Here's an example:
1
[
2
{
3
​
4
"ENABLED": "true",
5
​
6
"SYMBOL": "CAKE",
7
"ADDRESS": "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82",
8
9
"KIND_OF_SWAP": "tokens",
10
"BUYAMOUNTINBASE": "0.000005",
11
"BUYAMOUNTINTOKEN": "10",
12
"MAX_BASE_AMOUNT_PER_EXACT_TOKENS_TRANSACTION": "0.1",
13
​
14
"BUYPRICEINBASE": "10",
15
"SELLPRICEINBASE": "15",
16
"STOPLOSSPRICEINBASE": "8",
17
"SLIPPAGE": "5",
18
​
19
"MAXTOKENS": "0.1",
20
"MOONBAG": "0",
21
​
22
"RUGDOC_CHECK": "true",
23
"BUYAFTER_XXX_SECONDS": "0",
24
"WAIT_FOR_OPEN_TRADE": "true",
25
​
26
"MAX_FAILED_TRANSACTIONS_IN_A_ROW": "2",
27
"MAX_SUCCESS_TRANSACTIONS_IN_A_ROW": "2",
28
"MULTIPLEBUYS": "false",
29
"BUYCOUNT": "1",
30
"ALWAYS_CHECK_BALANCE": "false",
31
​
32
"WATCH_STABLES_PAIRS": "true",
33
"MINIMUM_LIQUIDITY_IN_DOLLARS": "10000",
34
​
35
"LIQUIDITYINNATIVETOKEN": "true",
36
"USECUSTOMBASEPAIR": "false",
37
"BASESYMBOL": "BUSD",
38
"BASEADDRESS": "0xe9e7cea3dedca5984780bafc599bd69add087d56",
39
​
40
"SELLAMOUNTINTOKENS": "ALL",
41
"HASFEES": "false",
42
"GAS": "7",
43
"MAX_GAS": "99999",
44
"BOOSTPERCENT": "30",
45
"GASLIMIT": "1000000",
46
"GASPRIORITY_FOR_ETH_ONLY": "1.5"
47
48
}
49
]
Copied!
  • ENABLED Enable trading or not (if false, bot won't try to buy tokens)
  • SYMBOL Symbol of the token you want to buy
  • ADDRESS Contract address of the token you want to buy
  • KIND_OF_SWAP (since 4.0.4.2) You now have the choice between : 1/ "KIND_OF_SWAP": "base" --> you want to swap with an amount of Base tokens (example : I want to buy 1 BNB of CAKE token) 2/ "KIND_OF_SWAP": "tokens" --> you want to swap an exact amount of tokens (example : I want to buy 50 CAKE tokens)
  • BUYAMOUNTINBASE (used with "KIND_OF_SWAP": "base") Put here the amount in the base symbol that you want the bot to buy with
  • BUYAMOUNTINTOKEN (used with "KIND_OF_SWAP": "tokens") Put here the amount of tokens that you want the bot to buy
  • MAX_BASE_AMOUNT_PER_EXACT_TOKENS_TRANSACTION (used with "KIND_OF_SWAP": "tokens") Put here the maximum amount of BNB / ETH / AVAX... that you want the bot to use, if you're swapping per tokens --> this option avoids you to spend too much to buy the tokens you want to buy
  • BUYPRICEINBASE (used with "KIND_OF_SWAP": "base") Buy price of 1 token in the base symbol : if the price of 1 token is < or = to this price, the bot will buy.
If you want the bot to never buy, set BUYPRICEINBASE = 0 (price cannot be below 0)
  • SELLPRICEINBASE Sell price of 1 token in the base symbol : if the price of 1 token is > or = to this price, the bot will sell. (it will sell at the Market price, not at your price)
BUYPRICEINBASE and SELLPRICEINBASE are the buy price of ONE token in BASE pair.
Think about it as if you were in front of this screen:
​
​
If you want the bot to never sell, set SELLPRICEINBASE = 99999999
  • STOPLOSSPRICEINBASE Set your Stop Loss price in the base symbol Bot will sell if token price < STOPLOSS price
  • SLIPPAGE Slippage you want to use (in %).
  • MOONBAG Minimal amount of token you want to keep in your wallet. If you don't want to keep any token, put 0. (in this example, the bot will keep at least 20 KPAD token in your wallet)
  • MAXTOKENS This parameter is used to make the bot stop buying:
    • before buying, the bot checks MAXTOKENS
    • if you hold more tokens than MAXTOKENS, the bot does not buy
This parameter does not influence how many tokens the bot will buy during your trade: if you set MAXTOKENS = 1, the bot can buy 50000 tokens for example, no problem
➑️ If you want to make the bot stop buying after 1 trade, set MAXTOKENS to a low value, like "1" for instance.
  • RUGDOC_CHECK Call RugDoc's API to check if a contract is a honeypot or not.
    Check their website, be careful it cannot be 100% reliable of course!
  • BUYAFTER_XXX_SECONDS Ask the bot to wait for XXX seconds before making BUY order, to avoid anti-bot protections
  • WAIT_FOR_OPEN_TRADE This option is for tokens where liquidity is added, but team enables trading with a "EnableTrading" option. In this case, if you don't enable this option, the bot will try to buy when trading is not enabled, resulting in a "TRANSFER_FAILED" error. The difficulty is the fact that there are many ways to enable trading, so it is very difficult for the bot to detect it.
The bot can detect EnableTrading in 2 ways :
1/ The bot scans pending transactions, and detect the EnableTrading functions that we have implemented in the code --> It's faster, but we need to implement in the code as many ways to do EnableTrading as wa can, and it's impossible to guarantee that the team will not use an unknown way to Enable Trading 2/ The bot waits for the price to move before making an order --> It's a "universal" way to detect that trading is enabled, but your sniping will be a little bit slower, since you need to wait for someone to buy before you.
4 possibilities : 1/ "WAIT_FOR_OPEN_TRADE": "true" --> bot will scan pending transactions and wait for the price to move AT THE SAME TIME
2/ "WAIT_FOR_OPEN_TRADE": "mempool" --> bot will only scan pending transactions
3/ "WAIT_FOR_OPEN_TRADE": "true_after_buy_tx_failed" --> same as "true", but bot will try to make a BUY order as soon as he sees liquidity, and launch wait_for_open_trade if the Tx is failed
WAIT_FOR_OPEN_TRADE": "true_after_buy_tx_failed" is the team recommandation
πŸ‘
​
4/ "WAIT_FOR_OPEN_TRADE": "mempool_after_buy_tx_failed" -> same as "mempool", but bot will try to make a BUY order as soon as he sees liquidity, and launch wait_for_open_trade if the Tx is failed
​
⚠
​
⚠
BE CAREFUL
⚠
​
⚠
To make "WAIT_FOR_OPEN_TRADE": "true" or "mempool_after_buy_tx_failed" work, you need to snipe on the same liquidity pair that liquidity added by the team Why ? Because if you try to snipe in BUSD and liquidity is in BNB, price will move because of price movement between BUSD and BNB Examples: - Liquidity is in BNB or ETH : --> use LIQUIDITYINNATIVETOKEN = true / USECUSTOMBASEPAIR = false
- Liquidity is in BUSD --> use LIQUIDITYINNATIVETOKEN = false / USECUSTOMBASEPAIR = true / BASEADDRESS = 0xe9e7cea3dedca5984780bafc599bd69add087d56
​
WE NEED YOUR HELP TO IMPROVE ENABLE TRADE DETECTION: Please give us some examples of function used to enable trading here: https://github.com/tsarbuig/LimitSwap/issues/1 Examples
1
https://bscscan.com/tx/0xa98ae84de5aee32d216d734b790131a845548c7e5013085688dccd58c9b5b277
2
Function: tradingStatus
3
MethodID: 0x0d295980
4
​
5
https://etherscan.io/tx/0x65d66d1e7d3ff3d8fc67308d105aac6722b00da23f116c89a5420544db5b875d
6
Function: openTrading()
7
MethodID: 0xc9567bf9
Copied!
​
  • LIQUIDITYINNATIVETOKEN Use this option if you want to trade with liquidity in BUSD / USDT / USDC / etc.
WARNING : be VERY CAREFUL about this LIQUIDITYINNATIVETOKEN option If you set up wrong configuration, bot will trade on wrong pair and make you lose funds. Beware
​
This option will make the bot :
  • Detect liquidity which is not in native token
  • Make transactions go through direct route
Situation
What to choose?
Liquidity is in ETH / BNB / etc.
LIQUIDITYINNATIVETOKEN = True
Liquidity is in BUSD / USDT / etc.
- LIQUIDITYINNATIVETOKEN = False
- CUSTOMBASEPAIR = liquidity token
Example with token with BUSD liquidity
If you want to trade a token with BUSD liquidity, you need to set CUSTOMBASEPAIR = BUSD. So, you need to set:
1
LIQUIDITYINNATIVETOKEN": "false",
2
"USECUSTOMBASEPAIR": "true",
3
"BASESYMBOL": "BUSD",
4
"BASEADDRESS": "0xe9e7cea3dedca5984780bafc599bd69add087d56",
Copied!
WARNING : be VERY CAREFUL about this LIQUIDITYINNATIVETOKEN option If you set up wrong configuration, bot will trade on wrong pair and make you lose funds. Beware!
​
  • USECUSTOMBASEPAIR Must be "true" or "false"
    • "false" : the bot uses native token (BNB / ETH / MATIC / KCC / etc.) to make trades
      πŸ‘‰
      You only need to hold this native token
    • "true" : bot uses the BASE pair you've entered below
WARNING If liquidity is in native token, be careful not to use this option if you trade with a big amount of money (several thousands dollars).
Why? By using this option, bot needs to route your transaction through several routes (Custom base token
➑
Native token
➑
Token you're sniping) and one of this route could have low liquidity
​
πŸ‘‰
If you trade with big amount, it could result in a big price impact, and make you lose money
Team recommendations if you want to make big trades: - if token has native token liquidity (ETH / BNB...)
πŸ‘‰
do not use custom base pair - if token has BUSD / USDT liquidity
πŸ‘‰
use: - LIQUIDITYINNATIVETOKEN = false - USECUSTOMBASEPAIR = true , with same base pair as liquidity
​
  • BASESYMBOL Symbol of the token you want to trade with if you selected USECUSTOMBASEPAIR = True (in this example : I want to buy KPAD with the WBNB I have in my wallet)
  • BASEADDRESS Contract address of the token you want to trade with if you selected USECUSTOMBASEPAIR = True
  • MAX_FAILED_TRANSACTIONS_IN_A_ROW Tells the bot to stop making buy/sell orders after XXX failed transactions
  • MAX_SUCCESS_TRANSACTIONS_IN_A_ROW Tells the bot to stop making buy orders after XXX success transactions
  • MULTIPLEBUYS Since 4.0.0, LimitSwap is able to create up to 5 buys orders with 5 different wallets at the same time ! Useful for tokens where trading is limited to a maximum amount per wallet.
  • BUYCOUNT If you use MULTIPLEBUYS = true , tells the bot how many buys to make in //
The same amount of wallets must be entered in settings.json Example : if you use MULTIPLEBUYS = 3, LimitSwap will buy with wallets 1, 2, 3 at the same time --> those 3 wallets must be configured in settings.json)
​
  • ALWAYS_CHECK_BALANCE To increase speed to maximum, the default behaviour of LimitSwap is to check your balance only at bot launch. It allows to reduce the amount of actions before make a sell order. But some users want the bot to detect when they receive a token in their wallet while the bot is running, to sell the tokens as quickly as possible --> use this option to make the bot check your tokens balance between every price check (but this makes the bot a little bit slower - not too much slower, don't worry)
  • WATCH_STABLES_PAIRS (since 4.2.0)
    πŸš€
    ​
    πŸš€
    ​
    πŸš€
    ​
    πŸš€
    LimitSwap is not able to check automatically ALL STABLES PAIRS + NATIVE TOKEN (BNB/ETH...) PAIR at the same time !
    πŸš€
    ​
    πŸš€
    ​
    πŸš€
    ​
    πŸš€
    --> Instead of telling the bot to snipe on BNB or BUSD or USDT or USDC... the bot now checks all pairs automatically ! (of course you need to hold BUSD / USDT / USDC in your wallet to make the buy order go through)
    You just need to enter BUYPRICEINBASE and BUYAMOUNTINBASE, and it will automatically calculate good price and good amount if BUY is made on another pair.
Example :
BUYPRICEINBASE = 0.0001 means:
- if liquidity is in BNB, bot will buy at a price of 0.0001 BNB
- if liquidity is in BUSD, bot will buy at a price of 0.05 BUSD BUYAMOUNTINBASE = 0.10 means:
- if liquidity is in BNB, bot will buy 0.10 BNB
- if liquidity is in BUSD, bot will buy 50 BUSD
Can I use the bot as before ??
No problem : simply put "WATCH_STABLES_PAIRS": "false",
​
  • MINIMUM_LIQUIDITY_IN_DOLLARS (since 4.0.5) Use this option if you want the bot to set a minimal amount of liquidity before buying.
    Put liquidity amount in $.
Some people add very small amount of liquidity to Exchanges --> if you swap on this, you will lose all your money !! To avoid this, the team recommend to set MINIMUM_LIQUIDITY_IN_DOLLARS = 10000
​
  • SELLAMOUNTINTOKENS Put here the amount of token that you want the bot to sell
  • HASFEES Select "TRUE" if you want to trade a token with additional fees, like automatic transfer to liquidity when you buy / additional taxes / rebase / etc.
  • GAS / BOOSTPERCENT
    There is 2 ways to set your Gas :
  1. 1.
    Set your own fixed Gas price --> simply set Gas price in "GAS" parameter
    1
    "GAS": "200",
    Copied!
  2. 2.
    Let the bot calculate Gas price relating to current Gas Price on blockchain :
    1. 1.
      it reads the gas price on the blockchain
    2. 2.
      it applies the boost you set on Fast price. Example :
1
"GAS": "BOOST",
2
"BOOSTPERCENT": "30",
Copied!
  • MAX_GAS Put here the maximum of GAS you want to pay if you use BOOST. If GAS > MAX_GAS : Tx won't be made
  • GASLIMIT Set it with the Gaslimit value you want to use (we recommend to set it to 1000000 to avoid to be out of Gas)
  • GASPRIORITY_FOR_ETH_ONLY This is for ETH only : sets Max Priority Gas. The max priority fee, also referred to as the "miner tip", goes to the miner or validator, and incentivizes them to prioritize your transaction. Most often, the value you put in for "max priority fee" will be the amount you pay. More details here : https://www.blocknative.com/blog/eip-1559-fees

4/ Launch the bot
πŸš€

Last modified 2d ago