A simple python code to farm Dexes like Jupiter and Raydium for potential airdrops (the former is more likely to be of relevance)
wallet: the wallet class represent a wallet on Solana. It contains attributes that are used for signing transactions like the public key and keypair. Some logging attributes are also there, like trade count and volume
utils: Where most of the heavy work is done. Most used functions are implemented there to reduce code size in other files like wallet.py and main.py
main: here is where the logic of swapping and farming is. There are some pre-implemented routes of farming swaps, however you can use your own for more diversification and sybil avoidance
This project assumes that you have some constans in your ~/.zshrc for more secure access of senstive information, like your private keys and rpc urls. You'll then never have to enter these in the code. For ease of use and instantiation of Wallet objects, constans shall have the following format
export solrpc="https://api.mainnet-beta.solana.com”
export spl0="LxPXMnGLsDxR..”
export spl1="VP4es7u5XVDGF1..”
export spl2="2N2yd6eBsl42XS...”
.
.It's advised to obtain a custom rpc url, from services like QuickNode
With python 3.9.7
run:
python3 -m ensurepip --upgradeand after cloning and having splfarm/src as cwd, run:
pip install -r ../requirements.txtHead to main.py, instantiate desired Wallet objects and adjust desired metrics like logic, size, and trade frequency.
Then run:
python3 main.pyIn log.py, processed and failed transactions, fetched qoutes, volume, and swapping rounds are logged to the log folder and are saved in both json and csv.
