tsarbuig / WalletHunter

The first Copytrading crypto bot in the World - for Uniswap & Pancakeswap
21 stars 8 forks source link

[Bug] BUY_SEVERAL_TIME_SAME_TOKEN : false - failed #24

Closed AdamB2023 closed 1 year ago

AdamB2023 commented 1 year ago

02-05 19:12:28 WH bought COIN_NAME

-- SWAP DETECTED -----------------------------------------------                                                                                                                                                                                     [1715/7880]
02-05 19:12:28.1228  Tx ? from #7: ? - id: 489e
02-05 19:12:28.1228  NEW - This is a Uniswap Universal Tx with Command: 0b0800 --> let's try to clone it

489e -- PRE-CHECKS BEFORE Tx ----------------------------------------
02-05 19:12:28.1228  489e - TX GAS CONTROL ------- Tx GAS = 58.698129361 and current GAS price = 26.550632993  --> let's continue
02-05 19:12:28.1228  489e - MIN_MAX_MARKETCAP ---- liquidity = 42419.44$ --> let's buy
02-05 19:12:28.1228  489e - AMOUNT CONTROL ------- your buyAmount (0.475) > MAXIMUM_BUY_AMOUNT_IN_BASE (0.1) --> let's use MAXIMUM_BUY_AMOUNT_IN_BASE (buy_specific)
02-05 19:12:28.1228  489e - GAS CALCULATION ------ Tx GAS = 58.698129361 --> your Tx GAS = 110% * 58.698129361 = 64.567942297
02-05 19:12:28.1228  489e - HONEYPOT / TAX CHECK - Honeypot: false | BuyTax: 5% | SellTax: 7% - Check made in: 0.00396s

489e -- COPY SWAP ---------------------------------------------------
02-05 19:12:28.1228  489e - BUY Tx - COIN_NAME - ? - Case 1 - Swap sent in: 0.01783s

489e -- CONTROLS AFTER Tx -------------------------------------------
02-05 19:12:36.1236  489e - BUY PRICE  ----------- You used 0.100000000000 Wrapped Ether to buy 3284.417426940000 COIN_NAME --> Buy price = 0.000030446800 Wrapped Ether/COIN_NAME
02-05 19:12:36.1236  489e - SAME BLOCK ? --------- Swap block: 16564295 / Your Tx block: 16564295 --> CONGRATS!! Your Tx was in the same block :)
02-05 19:12:36.1236  489e - POSITION IN BLOCK ---- FRONTRUN : you managed to frontrun the original Tx :) (2 position before)
02-05 19:12:36.1236  489e - BALANCE CHECK -------- Your ETH balance is: 0.532832764841433509
02-05 19:12:36.1236  489e - TOKEN APPROVAL ------- Token COIN_NAME needs approval --> let's approve
02-05 19:12:48.1248  489e - COIN_NAME approval Tx: ?

02-05 19:13:46 it detected swap for same coin, and skipped it as intended.

-- SWAP DETECTED -----------------------------------------------
02-05 19:13:46.1346  Tx ___ from #7: ___ - id: 3cc1
02-05 19:13:46.1346  NEW - This is a Uniswap Universal Tx with Command: 0b0800 --> let's try to clone it

3cc1 -- PRE-CHECKS BEFORE Tx ----------------------------------------
02-05 19:13:46.1346  3cc1 - TX GAS CONTROL ------- Tx GAS = 60 and current GAS price = 26.138649428  --> let's continue
02-05 19:13:46.1346  3cc1 - BUY...SAME_TOKEN ----- Token COIN_NAME was already bought --> buy cancelled

Then i made an update to recent version, and it did not prevented purchase next day.

-- SWAP DETECTED -----------------------------------------------
02-06 03:59:34.5934  Tx ___ from #7: ___ - id: 13ef
02-06 03:59:34.5934  NEW - This is a Uniswap Universal Tx with Command: 0b0800 --> let's try to clone it

13ef -- PRE-CHECKS BEFORE Tx ----------------------------------------
02-06 03:59:34.5934  13ef - TX GAS CONTROL ------- Tx GAS = 30.199644428 and current GAS price = 17.17356482  --> let's continue
02-06 03:59:34.5934  13ef - MIN_MAX_MARKETCAP ---- liquidity = 30384.63$ --> let's buy
02-06 03:59:34.5934  13ef - AMOUNT CONTROL ------- your buyAmount (0.1425) > MAXIMUM_BUY_AMOUNT_IN_BASE (0.1) --> let's use MAXIMUM_BUY_AMOUNT_IN_BASE (buy_specific)
02-06 03:59:34.5934  13ef - GAS CALCULATION ------ Tx GAS = 30.199644428 --> your Tx GAS = 110% * 30.199644428 = 33.219608871
02-06 03:59:34.5934  13ef - HONEYPOT / TAX CHECK - Honeypot: false | BuyTax: 5% | SellTax: 7% - Check made in: 0.00190s

13ef -- COPY SWAP ---------------------------------------------------
02-06 03:59:34.5934  13ef - BUY Tx - COIN_NAME - ___ - Case 1 - Swap sent in: 0.01661s

13ef -- CONTROLS AFTER Tx -------------------------------------------
02-06 03:59:47.5947  13ef - BUY PRICE  ----------- You used 0.100000000000 Wrapped Ether to buy 5045.467234040000 COIN_NAME --> Buy price = 0.000019819770 Wrapped Ether/COIN_NAME
02-06 03:59:47.5947  13ef - SAME BLOCK ___ --------- Swap block: 16566917 / Your Tx block: 16566917 --> CONGRATS!! Your Tx was in the same block :)
02-06 03:59:47.5947  13ef - POSITION IN BLOCK ---- FRONTRUN : you managed to frontrun the original Tx :) (1 position before)
02-06 03:59:47.5947  13ef - BALANCE CHECK -------- Your ETH balance is: 0.367970195324476052
02-06 03:59:47.5947  13ef - TOKEN APPROVAL ------- Token COIN_NAME is already approved
02-06 03:59:47.5947  13ef - ANTI RUG ------------- Anti rug-pull method was already started for token COIN_NAME
02-06 03:59:47.5947  13ef - SHOULD WE CONTINUE___ -- BUY Tx made in a row = 1 | AMOUNT_OF_BUY_TX_BEFORE_THE_BOT_STOP parameter = 5 --> let's continue

13ef -- AUTO SELL ---------------------------------------------------
02-06 03:59:49.5949  13ef - AUTO SELL VALUES ----- COIN_NAME | Buy price (including fees) 0.000019819769976 | Stoploss (50%) 0.000009909884988 | You are holding 672988466098 tokens
02-06 03:59:49.5949  13ef - AUTO SELL VALUES ----- COIN_NAME | 1st target price 0.000039639539952 --> will sell 50% of your initial bag (336494233049 tokens)
02-06 03:59:49.5949  13ef - AUTO SELL VALUES ----- COIN_NAME | 2nd target price 0.001981778799898 --> will sell 50% of your initial bag (336494233049 tokens)
COIN_NAME     Price (13ef): 0.000019532452 | Sell Tax 5% | Price after Tax 0.000018555829281462 | 1st target price 0.000039639540 | Stoploss 0.000009910 | Current profit: -6.4%
tsarbuig commented 1 year ago

yeah, this feature prevents to buy same token during the SAME DAY

(it looks through your Tx file of the day)

I could create only one BIG tx file, but then it would become bigger and bigger and slow down the bot...

is this super important ? do I need to work on it ?

(please tell me not lol)

AdamB2023 commented 1 year ago

Currently, it may end up in short time period - few minutes before and after midnight will trigger. Please allow the user to define how many days he wants to store coins list. By default, the file will be small, but everyone who needs can prevent being pulled into the same coin again for a longer period, and eventually maintain his contracts blacklist 🙏

AdamB2023 commented 1 year ago

Just faced it again:

02-17 23:51:32.5132  299a - BUY Tx - COINNAME1 - 0x - Case 1 - Swap sent in: 0.02189s

00:03 - WH restart, and then later it bought same token:

02-18 00:11:20.1120  9d8c - BUY Tx - COINNAME1 - 0x - Case 2 - Swap sent in: 0.02627s

Please allow user to define, how long the logs should be stored.

tsarbuig commented 1 year ago

changing log is quite difficult, but I've improved WalletHunter to check if you did not bought same tokens TODAY AND YESTERDAY --> should solve 99% of cases I guess in v0.50.1c