diff --git a/src/Pool/swap.js b/src/Pool/swap.js index 7502c814..be76ada2 100644 --- a/src/Pool/swap.js +++ b/src/Pool/swap.js @@ -23,8 +23,7 @@ const { RAYDIUM_MAINNET_API, _ENDPOINT, wallet, - jito_fee, - second_connection + jito_fee } = require("../helpers/config.js"); const { getDecimals, @@ -46,7 +45,6 @@ const { const { jito_executeAndConfirm, } = require("../Transactions/jito_tips_tx_executor.js"); -const {getCurrentPriceRaydium, readBoughtTokens, writeBoughtTokens, logExitPrice} = require("../Trading/memecoin_trading_strategies/utils.js") /** @@ -226,10 +224,6 @@ async function swapOnlyAmmHelper(input) { console.log("txids:", txid); const response = await checkTx(txid); if (response) { - if(input.side==="sell") { - const currentPrice = await getCurrentPriceRaydium(input.tokenAddress); - await logExitPrice(input.tokenAddress, currentPrice); - } if (input.side === "buy") { console.log( `https://dexscreener.com/solana/${input.targetPool}?maker=${wallet.publicKey}` @@ -295,7 +289,7 @@ async function swap( inputToken, new BN(amountOfSol.mul(10 ** inputToken.decimals).toFixed(0)) ); - const slippage = new Percent(6, 100); + const slippage = new Percent(3, 100); const input = { outputToken, targetPool, @@ -330,13 +324,13 @@ async function swap( } const balnaceOfToken = await getSPLTokenBalance( - second_connection, + connection, tokenAccount, wallet.publicKey ); const percentage = sell_PercentageOfToken / 100; const amount = new Decimal(percentage * balnaceOfToken); - const slippage = new Percent(6, 100); + const slippage = new Percent(3, 100); const inputTokenAmount = new TokenAmount( inputToken, new BN(amount.mul(10 ** inputToken.decimals).toFixed(0)) diff --git a/src/helpers/.env.copy b/src/helpers/.env.copy deleted file mode 100644 index 9b61ddc2..00000000 --- a/src/helpers/.env.copy +++ /dev/null @@ -1,16 +0,0 @@ -## mainnet (comment the following if you want to switch to devnet) -PRIVATE_KEY = YOUR_PRIVATE_KEY -## devnet (un-comment the following if you want to switch to devnet) -#PRIVATE_KEY = YOUR_PRIVATE_KEY - -# recommend to use https://dev.helius.xyz/rpcs/my -# or https://shyft.to/dashboard/overview -DEVNET_ENDPOINT = YOUR_RPC_DEVNET_ENDPOINT -MAINNET_ENDPOINT = YOUR_RPC_MAINNET_ENDPOINT -# please get the api key in https://shyft.to/dashboard/overview -SHYFT_API_KEY = YOUR_SHYFT_API_KEY -# recommend to use 0.00009 -# specify the fee for jito if you want to land your transaction faster -JITO_FEE = "0.001" -TAKE_PROFIT = 0.1 # sell when price up 10% -STOP_LOST = 0.2 # sell when price down 20% \ No newline at end of file diff --git a/src/helpers/config.js b/src/helpers/config.js index a0095009..f2aebc8e 100644 --- a/src/helpers/config.js +++ b/src/helpers/config.js @@ -86,7 +86,4 @@ module.exports = { _ENDPOINT, shyft_api_key, jito_fee, - second_main_endpoint, - second_connection, - smart_money_wallet, };