Skip to content

Commit

Permalink
fixed all issues and deleted my own code
Browse files Browse the repository at this point in the history
  • Loading branch information
outsmartchad committed Jun 27, 2024
1 parent b421c5a commit 6168ad3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 29 deletions.
14 changes: 4 additions & 10 deletions src/Pool/swap.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ const {
RAYDIUM_MAINNET_API,
_ENDPOINT,
wallet,
jito_fee,
second_connection
jito_fee
} = require("../helpers/config.js");
const {
getDecimals,
Expand All @@ -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")


/**
Expand Down Expand Up @@ -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}`
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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))
Expand Down
16 changes: 0 additions & 16 deletions src/helpers/.env.copy

This file was deleted.

3 changes: 0 additions & 3 deletions src/helpers/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,4 @@ module.exports = {
_ENDPOINT,
shyft_api_key,
jito_fee,
second_main_endpoint,
second_connection,
smart_money_wallet,
};

0 comments on commit 6168ad3

Please sign in to comment.