On Limit-sniper bot, use base token to buy and i found an issue.
token A listed with pair A/B, base token of exchange is C. Bot will buy with C-> B -> A. And calculate buy price with pair A/C.
when token already buy, bot checking price to take a profit or stoploss... but bot checking price with pair A/B not A/C -> wrong price to take profit or stoploss
In my case:
Token MAD added liquidity with pair MAD/MMF
Bot using CRO to buy MAD: CRO -> MMF -> MAD
After buy successful, the bot trying calculate cost per token in pair. MAD/CRO and also calculate take profit and stoploss with price of pair MAD/CRO. Bot should check price MAD/CRO to make a decision stoploss or take profit, but it's not, it's checking price of MAD/MMF and because price of MAD in MMF is lower than MAD in CRO -> Stoploss event trigger -> Bot sell my token.
This is log file
INFO: 2022-03-31 08:06:59,396 Current Wallet Balance is : 84.410583092688020215 CRO
INFO: 2022-03-31 08:06:59,408 ENTER scan_mempool_public_node
INFO: 2022-03-31 08:09:53,032 WE FOUND SOMETHING IN MEMPOOL
INFO: 2022-03-31 08:09:53,032 - Block number: 2144033
INFO: 2022-03-31 08:09:53,033 - Function: <Function addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256)>
INFO: 2022-03-31 08:09:53,033 - TxHash: 0x443ed84770e9f0b1970b0818d37217eec34fae85f655f87d335a8b0b7e143a3d
INFO: 2022-03-31 08:09:53,033 - GAS will be the same as liquidity adding event for your BUY Tx: GAS= 5000.0
INFO: 2022-03-31 08:09:53,033 ------------------------------------------------
INFO: 2022-03-31 08:09:53,034 ENOUGH LIQUIDITY
INFO: 2022-03-31 08:09:53,034
INFO: 2022-03-31 08:09:53,034 - You have set MINIMUM_LIQUIDITY_IN_DOLLARS = 5 $
INFO: 2022-03-31 08:09:53,034 - Liquidity added for MAD = 230.32 $
INFO: 2022-03-31 08:09:53,034 --> Let's buy!
INFO: 2022-03-31 08:09:53,034 ------------------------------------------------
INFO: 2022-03-31 08:09:53,044 make_the_buy condition 10
INFO: 2022-03-31 08:09:53,072 Transaction Hash = 0xbfd3e4f67c1c10fc0ce936a5b22d181dc62a10f91316fa5ce0b66da6daae621b
INFO: 2022-03-31 08:09:57,224 ----------------------------------
INFO: 2022-03-31 08:09:57,224 SUCCESS : your buy Tx is confirmed
INFO: 2022-03-31 08:09:57,419 - Your BUY Block number is : 2144034
INFO: 2022-03-31 08:09:57,420 - Addliquidity Block number was: 2144033
INFO: 2022-03-31 08:09:57,420 You bought 1 blocks later
INFO: 2022-03-31 08:10:00,472 Current Wallet Balance is: 95.40201546521781 CRO
INFO: 2022-03-31 08:10:00,495 Current Wallet Balance is: 0.07038045838824342 MAD
INFO: 2022-03-31 08:10:00,495
INFO: 2022-03-31 08:10:00,495 You bought 0.07038045838824342 MAD tokens
INFO: 2022-03-31 08:10:00,495 ----------------------------------
ERROR: 2022-03-31 08:10:00,496 macosx:// is disabled on this system.
ERROR: 2022-03-31 08:10:00,497 windows:// is disabled on this system.
INFO: 2022-03-31 08:10:00,517 MAD cost per token was: 14.2084894429594
INFO: 2022-03-31 08:10:00,518 --> SELLPRICEINBASE = 300% * 14.2084894429594 = 42.6254683288782
INFO: 2022-03-31 08:10:00,611 Sell Signal Found @4.460480199630425524
INFO: 2022-03-31 08:10:00,612
INFO: 2022-03-31 08:10:00,612 Sell price in MAD/CRO : 4.460480199630425524
INFO: 2022-03-31 08:10:02,973 Current Wallet Balance is: 0.07038045838824342 MAD
INFO: 2022-03-31 08:10:03,309 sell condition 15
INFO: 2022-03-31 08:10:03,359 Transaction Hash = 0x89121c3f3fea1a331e1b519e258cac9bebe7c922114c4da0b224f0c2b70ac388
INFO: 2022-03-31 08:10:08,796 ----------------------------------
INFO: 2022-03-31 08:10:08,796 SUCCESS : your sell Tx is confirmed
ERROR: 2022-03-31 08:10:08,796 macosx:// is disabled on this system.
ERROR: 2022-03-31 08:10:08,797 windows:// is disabled on this system.
INFO: 2022-03-31 08:10:08,821 Current Wallet Balance is: 95.7162529959551 CRO
INFO: 2022-03-31 08:10:08,839 Current Wallet Balance is: 0.0 MAD
INFO: 2022-03-31 08:10:08,839 ----------------------------------
On Limit-sniper bot, use base token to buy and i found an issue.
when token already buy, bot checking price to take a profit or stoploss... but bot checking price with pair A/B not A/C -> wrong price to take profit or stoploss
In my case:
This is log file
INFO: 2022-03-31 08:06:59,396 Current Wallet Balance is : 84.410583092688020215 CRO INFO: 2022-03-31 08:06:59,408 ENTER scan_mempool_public_node INFO: 2022-03-31 08:09:53,032 WE FOUND SOMETHING IN MEMPOOL INFO: 2022-03-31 08:09:53,032 - Block number: 2144033 INFO: 2022-03-31 08:09:53,033 - Function: <Function addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256)> INFO: 2022-03-31 08:09:53,033 - TxHash: 0x443ed84770e9f0b1970b0818d37217eec34fae85f655f87d335a8b0b7e143a3d INFO: 2022-03-31 08:09:53,033 - GAS will be the same as liquidity adding event for your BUY Tx: GAS= 5000.0 INFO: 2022-03-31 08:09:53,033 ------------------------------------------------ INFO: 2022-03-31 08:09:53,034 ENOUGH LIQUIDITY INFO: 2022-03-31 08:09:53,034 INFO: 2022-03-31 08:09:53,034 - You have set MINIMUM_LIQUIDITY_IN_DOLLARS = 5 $ INFO: 2022-03-31 08:09:53,034 - Liquidity added for MAD = 230.32 $ INFO: 2022-03-31 08:09:53,034 --> Let's buy! INFO: 2022-03-31 08:09:53,034 ------------------------------------------------ INFO: 2022-03-31 08:09:53,044 make_the_buy condition 10 INFO: 2022-03-31 08:09:53,072 Transaction Hash = 0xbfd3e4f67c1c10fc0ce936a5b22d181dc62a10f91316fa5ce0b66da6daae621b INFO: 2022-03-31 08:09:57,224 ---------------------------------- INFO: 2022-03-31 08:09:57,224 SUCCESS : your buy Tx is confirmed INFO: 2022-03-31 08:09:57,419 - Your BUY Block number is : 2144034 INFO: 2022-03-31 08:09:57,420 - Addliquidity Block number was: 2144033 INFO: 2022-03-31 08:09:57,420 You bought 1 blocks later INFO: 2022-03-31 08:10:00,472 Current Wallet Balance is: 95.40201546521781 CRO INFO: 2022-03-31 08:10:00,495 Current Wallet Balance is: 0.07038045838824342 MAD INFO: 2022-03-31 08:10:00,495 INFO: 2022-03-31 08:10:00,495 You bought 0.07038045838824342 MAD tokens INFO: 2022-03-31 08:10:00,495 ---------------------------------- ERROR: 2022-03-31 08:10:00,496 macosx:// is disabled on this system. ERROR: 2022-03-31 08:10:00,497 windows:// is disabled on this system. INFO: 2022-03-31 08:10:00,517 MAD cost per token was: 14.2084894429594 INFO: 2022-03-31 08:10:00,518 --> SELLPRICEINBASE = 300% * 14.2084894429594 = 42.6254683288782 INFO: 2022-03-31 08:10:00,611 Sell Signal Found @4.460480199630425524 INFO: 2022-03-31 08:10:00,612 INFO: 2022-03-31 08:10:00,612 Sell price in MAD/CRO : 4.460480199630425524 INFO: 2022-03-31 08:10:02,973 Current Wallet Balance is: 0.07038045838824342 MAD INFO: 2022-03-31 08:10:03,309 sell condition 15 INFO: 2022-03-31 08:10:03,359 Transaction Hash = 0x89121c3f3fea1a331e1b519e258cac9bebe7c922114c4da0b224f0c2b70ac388 INFO: 2022-03-31 08:10:08,796 ---------------------------------- INFO: 2022-03-31 08:10:08,796 SUCCESS : your sell Tx is confirmed
ERROR: 2022-03-31 08:10:08,796 macosx:// is disabled on this system. ERROR: 2022-03-31 08:10:08,797 windows:// is disabled on this system. INFO: 2022-03-31 08:10:08,821 Current Wallet Balance is: 95.7162529959551 CRO INFO: 2022-03-31 08:10:08,839 Current Wallet Balance is: 0.0 MAD INFO: 2022-03-31 08:10:08,839 ----------------------------------