You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it depends on the buy in percentage from the .env file
HOW TO USE
import{setInitTokenObj,checkIfHitEntryPrice,path_To_bought_tokens,loadBoughtTokens,order_size}from"./trading_dev/ProfitAndLoss";import{wallet}from"./helpers/config";import{buy}from"./raydium/buy_helper";// create a limit order object locally when your searcher bot finds a tokenasyncfunctionsearcherLogic(){// when your searcher bot finds a token, you can create a limit order objectwhile(true){// logic to find a target token...// ...// ...consttokenAddress="token address";awaitsetInitTokenObj(tokenAddress,path_To_bought_tokens);// successfully create a limit order object in the bought_tokens.json file, // before using it, please see the implementation of setInitTokenObj() in src/trading_dev/ProfitAndLoss/utils.ts}}// check if the token has hit the entry price, if so, buy the tokenasyncfunctionbuy_checker(){while(true){constbought_tokens=awaitloadBoughtTokens(path_To_bought_tokens);for(consttokeninbought_tokens){consttokenObj=bought_tokens[token];if(checkIfHitEntryPrice(tokenObj,path_To_bought_tokens)){// buy the tokenbuy("buy",token,order_size,wallet);}}}}
take profit / stop-loss
it depends on the tp/sl percentage from the .env file