Giter Site home page Giter Site logo

gweidart / alpha-evm-dex-bot Goto Github PK

View Code? Open in Web Editor NEW
209.0 13.0 73.0 24.43 MB

๐Ÿค– Automated multifunctional DeFi trading bot for the KCC ecosystem. Sniping, Front run, Limit orders, Stop Loss, and more...

Home Page: https://github.com/cusdt-LINK/alpha-kcc-dex-bot/wiki

License: MIT License

Python 94.91% Dockerfile 0.15% Makefile 4.91% Batchfile 0.03%
kcc kucoin dex defi trading-bot bot limit-order trading automated-trading-bot kucoin-community-chain

alpha-evm-dex-bot's People

Contributors

gweidart 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

alpha-evm-dex-bot's Issues

How to change the network

The code automatically connects to the kcs network. I can't change the network despite repeated attempts.

Tarding fo token UNI/USDT is disabled

I wanted to buy uni token using sushiswap router and factory address on goerli testnet network but it says Trading for token UNI/USDT is disabled only.

gold8/WBNB

INFO: 2023-07-12 09:30:39,212 **********************************************************************************************************************
INFO: 2023-07-12 09:30:39,213 YOUR BOT IS CURRENTLY RUNNING VERSION  1.0.1
INFO: 2023-07-12 09:30:42,582 Current Wallet Balance is:  0.1 WBNB
INFO: 2023-07-12 09:30:42,785 Found 136.2059 liquidity for gold8/WBNB
INFO: 2023-07-12 09:30:42,884 -----------------------------------------------------------
INFO: 2023-07-12 09:30:42,885 Buy Signal Found =-= Buy Signal Found =-= Buy Signal Found 
INFO: 2023-07-12 09:30:42,885 
INFO: 2023-07-12 09:30:42,892 Buy price in gold8/WBNB : 0.000474947297749506
INFO: 2023-07-12 09:30:42,894 -----------------------------------------------------------
ERROR: 2023-07-12 09:30:43,397 Could not transact with/call contract function, is contract deployed correctly and chain synced?
Traceback (most recent call last):
  File "/home/codespace/.local/lib/python3.10/site-packages/web3/contract.py", line 1515, in call_contract_function
    output_data = web3.codec.decode_abi(output_types, return_data)
  File "/home/codespace/.local/lib/python3.10/site-packages/eth_abi/codec.py", line 181, in decode_abi
    return decoder(stream)
  File "/home/codespace/.local/lib/python3.10/site-packages/eth_abi/decoding.py", line 127, in __call__
    return self.decode(stream)
  File "/home/codespace/.local/lib/python3.10/site-packages/eth_utils/functional.py", line 45, in inner
    return callback(fn(*args, **kwargs))
  File "/home/codespace/.local/lib/python3.10/site-packages/eth_abi/decoding.py", line 173, in decode
    yield decoder(stream)
  File "/home/codespace/.local/lib/python3.10/site-packages/eth_abi/decoding.py", line 127, in __call__
    return self.decode(stream)
  File "/home/codespace/.local/lib/python3.10/site-packages/eth_abi/decoding.py", line 198, in decode
    raw_data = self.read_data_from_stream(stream)
  File "/home/codespace/.local/lib/python3.10/site-packages/eth_abi/decoding.py", line 305, in read_data_from_stream
    raise InsufficientDataBytes(
eth_abi.exceptions.InsufficientDataBytes: Tried to read 32 bytes.  Only got 0 bytes

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/workspaces/alpha-evm-dex-bot/AlphaBot.py", line 5062, in run
    liquidity_result = check_liquidity_amount(token, token['_BASE_DECIMALS'], token['_WETH_DECIMALS'])
  File "/workspaces/alpha-evm-dex-bot/AlphaBot.py", line 2830, in check_liquidity_amount
    custom_base_price_in_base = calculate_custom_base_price(outToken, DECIMALS_OUT, DECIMALS_weth)
  File "/home/codespace/.local/lib/python3.10/site-packages/cachetools/__init__.py", line 642, in wrapper
    v = func(*args, **kwargs)
  File "/workspaces/alpha-evm-dex-bot/AlphaBot.py", line 3199, in calculate_custom_base_price
    reserves = getReserves_with_cache(pair_contract)
  File "/home/codespace/.local/lib/python3.10/site-packages/cachetools/__init__.py", line 642, in wrapper
    v = func(*args, **kwargs)
  File "/workspaces/alpha-evm-dex-bot/AlphaBot.py", line 2512, in getReserves_with_cache
    return pair_contract.functions.getReserves().call()
  File "/home/codespace/.local/lib/python3.10/site-packages/web3/contract.py", line 959, in call
    return call_contract_function(
  File "/home/codespace/.local/lib/python3.10/site-packages/web3/contract.py", line 1532, in call_contract_function
    raise BadFunctionCallOutput(msg) from e
web3.exceptions.BadFunctionCallOutput: Could not transact with/call contract function, is contract deployed correctly and chain synced?
INFO: 2023-07-12 09:30:43,399 ERROR. Please go to /log folder and open your logs: you will find more details.

Trade error

2023-06-04 10:24:53.364964 Current Gas Price = 0.007085924
2023-06-04 10:24:53.364964 Transaction for WETH will be created with gas = 0.007085924
2023-06-04 10:24:53.364964
2023-06-04 10:24:54.029546 Found 820.0378 liquidity for WETH/UNI
2023-06-04 10:24:54.483094 --------------------------------------------------------------
2023-06-04 10:24:54.483094 Sell Signal Found =-= Sell Signal Found =-= Sell Signal Found
2023-06-04 10:24:54.483094
2023-06-04 10:24:54.483094 Sell price in WETH/UNI : 23.717447970859939943
2023-06-04 10:24:54.488736 --------------------------------------------------------------
2023-06-04 10:24:56.348186 Current WETH Liquidity = 117160.994916 $
2023-06-04 10:24:56.348186 MINIMUM_LIQUIDITY_IN_DOLLARS parameter = 1 --> Enough liquidity detected :
let's go!
2023-06-04 10:24:56.348186 Placing Sell Order WETH
2023-06-04 10:24:56.610802 Current Wallet Balance is: 0.1465 WETH
2023-06-04 10:24:57.383425 Transaction Hash = 0xc325938c608e3b9a3b9c1a2aff935c1e26e5d92a47733e08387ea37191dc58bc
2023-06-04 10:24:57.383425 Checking for transaction confirmation (waiting 60 seconds)...........................
2023-06-04 10:25:58.627707 --------------------------------
2023-06-04 10:25:58.628695 SELL TRANSACTION FAILURE !
2023-06-04 10:25:58.628695 --------------------------------
2023-06-04 10:25:58.629694 Type of failures and possible causes:
2023-06-04 10:25:58.629694 - TRANSFER_FROM_FAILED --> GASLIMIT too low. Raise it to GASLIMIT =
1000000 at least
2023-06-04 10:25:58.630694 - TRANSFER_FROM_FAILED --> Token is not approved for trade. AlphaBot will check approval right now.
2023-06-04 10:25:58.631694 - INSUFFICIENT_OUTPUT_AMOUNT --> SLIPPAGE too low
2023-06-04 10:25:58.631694 - TRANSFER_FAILED --> Trading is not enabled. Use WAIT_FOR_OPEN_TRADE parameter after reading wiki
2023-06-04 10:25:58.632692 - TRANSFER_FAILED --> There is a whitelist
2023-06-04 10:25:58.633692 - Sorry, We are unable to locate this TxnHash --> You don't have enough funds in your wallet to cover fees
2023-06-04 10:25:58.633692 - ... or your node is not functioning properly
2023-06-04 10:25:58.634692 -------------------------------
2023-06-04 10:25:58.634692 Checking Approval Status 0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6
2023-06-04 10:25:58.861437 Token is already approved --> AlphaBot can use this token
2023-06-04 10:25:59.095988 WETH/UNI Price: 23.717447970859939943011341 UNI - Buy: 0.04092 Sell: 0 Stop: 0 - Token balance: 0.1465 (= 3.47 UNI)
2023-06-04 10:25:59.314681 --------------------------------------------------------------
2023-06-04 10:25:59.314681 Sell Signal Found =-= Sell Signal Found =-= Sell Signal Found
2023-06-04 10:25:59.314681
2023-06-04 10:25:59.314681 Sell price in WETH/UNI : 23.717447970859939943
2023-06-04 10:25:59.314681 --------------------------------------------------------------
2023-06-04 10:26:00.010120 Current WETH Liquidity = 117160.994916 $
2023-06-04 10:26:00.025746 MINIMUM_LIQUIDITY_IN_DOLLARS parameter = 1 --> Enough liquidity detected :
let's go!
2023-06-04 10:26:00.025746 Placing Sell Order WETH
2023-06-04 10:26:00.263421 Current Wallet Balance is: 0.1465 WETH
2023-06-04 10:26:00.817478 Transaction Hash = 0xbf9bde1531d6ee87b1f64838e94c352ce718f5260473b1486289261c19577a67
2023-06-04 10:26:00.817478 Checking for transaction confirmation (waiting 60 seconds)...........................
2023-06-04 10:27:01.080950 --------------------------------
2023-06-04 10:27:01.082937 SELL TRANSACTION FAILURE !
2023-06-04 10:27:01.083951 --------------------------------
2023-06-04 10:27:01.083951 Type of failures and possible causes:
2023-06-04 10:27:01.084934 - TRANSFER_FROM_FAILED --> GASLIMIT too low. Raise it to GASLIMIT =
1000000 at least
2023-06-04 10:27:01.085934 - TRANSFER_FROM_FAILED --> Token is not approved for trade. AlphaBot will check approval right now.
2023-06-04 10:27:01.086932 - INSUFFICIENT_OUTPUT_AMOUNT --> SLIPPAGE too low
2023-06-04 10:27:01.087933 - TRANSFER_FAILED --> Trading is not enabled. Use WAIT_FOR_OPEN_TRADE parameter after reading wiki
2023-06-04 10:27:01.088932 - TRANSFER_FAILED --> There is a whitelist
2023-06-04 10:27:01.089931 - Sorry, We are unable to locate this TxnHash --> You don't have enough funds in your wallet to cover fees
2023-06-04 10:27:01.090931 - ... or your node is not functioning properly
2023-06-04 10:27:01.090931 -------------------------------

Some questions about the configs

I am wondering how can we setup this so we can enter fairlaunches where we do not know the token price. Tried this with busd and it works for buying and selling.

[
{
"ENABLED": "true",
"SYMBOL": "BUSD",
"ADDRESS": "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",
"KIND_OF_SWAP": "base",
"BUYAMOUNTINBASE": "0.02",
"BUYAMOUNTINTOKEN": "",
"MAX_BASE_AMOUNT_PER_EXACT_TOKENS_TRANSACTION": "100",
"BUYPRICEINBASE": "1",
"SELLPRICEINBASE": "1.01",
"STOPLOSSPRICEINBASE": "10",
"SLIPPAGE": "2",
"MOONBAG": "0",
"MAXTOKENS": "2",
"MAX_SUCCESS_TRANSACTIONS_IN_A_ROW": "20000000",
"MAX_FAILED_TRANSACTIONS_IN_A_ROW": "1",
"XXX_SECONDS_COOLDOWN_AFTER_SELL_SUCCESS_TX": "0",
"RUGDOC_CHECK": "true",
"BUYAFTER_XXX_SECONDS": "0",
"WAIT_FOR_OPEN_TRADE": "false",
"MULTIPLEBUYS": "false",
"BUYCOUNT": "(not used)",
"ALWAYS_CHECK_BALANCE": "true",
"MINIMUM_LIQUIDITY_IN_DOLLARS": "1",
"WATCH_STABLES_PAIRS": "false",
"LIQUIDITYINNATIVETOKEN": "true",
"USECUSTOMBASEPAIR": "false",
"BASESYMBOL": "BNB",
"BASEADDRESS": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
"SELLAMOUNTINTOKENS": "ALL",
"HASFEES": "false",
"GAS": "BOOST",
"MAX_GAS": "999999999999",
"BOOSTPERCENT": "0.01",
"GASLIMIT": "1000000",
"GASPRIORITY_FOR_ETH_ONLY": "1.5"
}
]

Need help

I managed to make it run but i cannot bypass the alpha token requirement. Can you please tell me what version i should use.

Thanks.

Frontrun

Thank you very much for the work.
Any idea or guidance to help me on initiating front run bot?

Could not identify the intended function with name `balanceOf`

hi dear,
awesome script.

im getting this error.

ERROR: 2022-03-01 01:32:53,403
Could not identify the intended function with name balanceOf, positional argument(s) of type (<class 'str'>,) and keyword argument(s) of type {}.
Found 1 function(s) with the name balanceOf: ['balanceOf(address)']
Function invocation failed due to no matching argument types.
Traceback (most recent call last):
File "C:\Users\PAPA\Desktop\KCC\bot\AlphaBot.py", line 4630, in run
token['_TOKEN_BALANCE'] = check_balance(token['ADDRESS'], token['SYMBOL'], display_quantity=False) / token['_CONTRACT_DECIMALS']
File "C:\Users\PAPA\Desktop\KCC\bot\AlphaBot.py", line 2201, in check_balance
balance = balanceContract.functions.balanceOf(settings['WALLETADDRESS']).call()
File "C:\Users\PAPA\AppData\Local\Programs\Python\Python310\lib\site-packages\web3\contract.py", line 878, in call
clone._set_function_info()
File "C:\Users\PAPA\AppData\Local\Programs\Python\Python310\lib\site-packages\web3\contract.py", line 883, in _set_function_info
self.abi = find_matching_fn_abi(
File "C:\Users\PAPA\AppData\Local\Programs\Python\Python310\lib\site-packages\web3_utils\contracts.py", line 163, in find_matching_fn_abi
raise ValidationError(message)
web3.exceptions.ValidationError:
Could not identify the intended function with name balanceOf, positional argument(s) of type (<class 'str'>,) and keyword argument(s) of type {}.
Found 1 function(s) with the name balanceOf: ['balanceOf(address)']
Function invocation failed due to no matching argument types.

front running

Is there any guide how to use the front running bot, not only to snipe new launches?

Pancakeswap

hello, ive setting the bot to trade on pancakeswap, however, when i run the program it keep on connecting to KCC and checking on my ALPHA balance. Where do i need to modify so that it can trade on BSC platform and using BNB to buy other tokens.

Below is the error
www

Below is my setting file
Screenshot_3ww

Below is the tokens file
Screenshot_3ww

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.