Giter Club home page Giter Club logo

solana-trading-bot's Introduction

Solana Trading Bot (Beta)

The Solana Trading Bot is a software tool designed to automate the buying and selling of tokens on the Solana blockchain. It is configured to execute trades based on predefined parameters and strategies set by the user.

The bot can monitor market conditions in real-time, such as pool burn, mint renounced and other factors, and it will execute trades when these conditions are fulfilled.

Setup

To run the script you need to:

  • Create a new empty Solana wallet
  • Transfer some SOL to it.
  • Convert some SOL to USDC or WSOL.
    • You need USDC or WSOL depending on the configuration set below.
  • Configure the script by updating .env.copy file (remove the .copy from the file name when done).
  • Install dependencies by typing: npm install
  • Run the script by typing: npm run start in terminal

You should see the following output:
output

Configuration

Wallet

  • PRIVATE_KEY - Your wallet's private key.

Connection

  • RPC_ENDPOINT - HTTPS RPC endpoint for interacting with the Solana network.
  • RPC_WEBSOCKET_ENDPOINT - WebSocket RPC endpoint for real-time updates from the Solana network.
  • COMMITMENT_LEVEL- The commitment level of transactions (e.g., "finalized" for the highest level of security).

Bot

  • LOG_LEVEL - Set logging level, e.g., info, debug, trace, etc.
  • ONE_TOKEN_AT_A_TIME - Set to true to process buying one token at a time.
  • COMPUTE_UNIT_LIMIT - Compute limit used to calculate fees.
  • COMPUTE_UNIT_PRICE - Compute price used to calculate fees.
  • PRE_LOAD_EXISTING_MARKETS - Bot will load all existing markets in memory on start.
    • This option should not be used with public RPC.
  • CACHE_NEW_MARKETS - Set to true to cache new markets.
    • This option should not be used with public RPC.
  • TRANSACTION_EXECUTOR - Set to warp to use warp infrastructure for executing transactions, or set it to jito to use JSON-RPC jito executer
    • For more details checkout warp section
  • CUSTOM_FEE - If using warp or jito executors this value will be used for transaction fees instead of COMPUTE_UNIT_LIMIT and COMPUTE_UNIT_LIMIT
    • Minimum value is 0.0001 SOL, but we recommend using 0.006 SOL or above
    • On top of this fee, minimal solana network fee will be applied

Buy

  • QUOTE_MINT - Which pools to snipe, USDC or WSOL.
  • QUOTE_AMOUNT - Amount used to buy each new token.
  • AUTO_BUY_DELAY - Delay in milliseconds before buying a token.
  • MAX_BUY_RETRIES - Maximum number of retries for buying a token.
  • BUY_SLIPPAGE - Slippage %

Sell

  • AUTO_SELL - Set to true to enable automatic selling of tokens.
    • If you want to manually sell bought tokens, disable this option.
  • MAX_SELL_RETRIES - Maximum number of retries for selling a token.
  • AUTO_SELL_DELAY - Delay in milliseconds before auto-selling a token.
  • PRICE_CHECK_INTERVAL - Interval in milliseconds for checking the take profit and stop loss conditions.
    • Set to zero to disable take profit and stop loss.
  • PRICE_CHECK_DURATION - Time in milliseconds to wait for stop loss/take profit conditions.
    • If you don't reach profit or loss bot will auto sell after this time.
    • Set to zero to disable take profit and stop loss.
  • TAKE_PROFIT - Percentage profit at which to take profit.
    • Take profit is calculated based on quote mint.
  • STOP_LOSS - Percentage loss at which to stop the loss.
    • Stop loss is calculated based on quote mint.
  • SELL_SLIPPAGE - Slippage %.

Snipe list

  • USE_SNIPE_LIST - Set to true to enable buying only tokens listed in snipe-list.txt.
    • Pool must not exist before the bot starts.
    • If token can be traded before bot starts nothing will happen. Bot will not buy the token.
  • SNIPE_LIST_REFRESH_INTERVAL - Interval in milliseconds to refresh the snipe list.
    • You can update snipe list while bot is running. It will pickup the new changes each time it does refresh.

Note: When using snipe list filters below will be disabled.

Filters

  • FILTER_CHECK_INTERVAL - Interval in milliseconds for checking if pool match the filters.
    • Set to zero to disable filters.
  • FILTER_CHECK_DURATION - Time in milliseconds to wait for pool to match the filters.
    • If pool doesn't match the filter buy will not happen.
    • Set to zero to disable filters.
  • CONSECUTIVE_FILTER_MATCHES - How many times in a row pool needs to match the filters.
    • This is useful because when pool is burned (and rugged), other filters may not report the same behavior. eg. pool size may still have old value
  • CHECK_IF_MUTABLE - Set to true to buy tokens only if their metadata are not mutable.
  • CHECK_IF_SOCIALS - Set to true to buy tokens only if they have at least 1 social.
  • CHECK_IF_MINT_IS_RENOUNCED - Set to true to buy tokens only if their mint is renounced.
  • CHECK_IF_FREEZABLE - Set to true to buy tokens only if they are not freezable.
  • CHECK_IF_BURNED - Set to true to buy tokens only if their liquidity pool is burned.
  • MIN_POOL_SIZE - Bot will buy only if the pool size is greater than or equal the specified amount.
    • Set 0 to disable.
  • MAX_POOL_SIZE - Bot will buy only if the pool size is less than or equal the specified amount.
    • Set 0 to disable.

Warp transactions (beta)

In case you experience a lot of failed transactions or transaction performance is too slow, you can try using warp for executing transactions. Warp is hosted service that executes transactions using integrations with third party providers.

Using warp for transactions supports the team behind this project.

Security

When using warp, transaction is sent to the hosted service. Payload that is being sent will NOT contain your wallet private key. Fee transaction is signed on your machine. Each request is processed by hosted service and sent to third party provider. We don't store your transactions, nor we store your private key.

Note: Warp transactions are disabled by default.

Fees

When using warp for transactions, fee is distributed between developers of warp and third party providers. In case TX fails, no fee will be taken from your account.

Common issues

If you have an error which is not listed here, please create a new issue in this repository. To collect more information on an issue, please change LOG_LEVEL to debug.

Unsupported RPC node

  • If you see following error in your log file:
    Error: 410 Gone: {"jsonrpc":"2.0","error":{"code": 410, "message":"The RPC call or parameters have been disabled."}, "id": "986f3599-b2b7-47c4-b951-074c19842bad" }
    it means your RPC node doesn't support methods needed to execute script.
    • FIX: Change your RPC node. You can use Helius or Quicknode.

No token account

  • If you see following error in your log file:
    Error: No SOL token account found in wallet:
    it means that wallet you provided doesn't have USDC/WSOL token account.
    • FIX: Go to dex and swap some SOL to USDC/WSOL. For example when you swap sol to wsol you should see it in wallet as shown below:

wsol

Contact

  • If you want to leave a tip, you can send it to the following address: 7gm6BPQrSBaTAYaJheuRevBNXcmKsgbkfBCVSjBnt9aP

  • If you need custom features or assistance, feel free to contact the admin team on discord for dedicated support.

Disclaimer

The Solana Trading Bot is provided as is, for learning purposes. Trading cryptocurrencies and tokens involves risk, and past performance is not indicative of future results. The use of this bot is at your own risk, and we are not responsible for any losses incurred while using the bot.

solana-trading-bot's People

Contributors

ajakka avatar al366io avatar fdundjer avatar jiginjayaprakash avatar journeytojah avatar mcoder9 avatar nonvideri avatar t3chie-404 avatar theobrigitte avatar thomaille avatar vin0x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

solana-trading-bot's Issues

Non base58 character exception

This is what happens if i start the script:

PS D:\dev\solana-sniper-bot> npm run buy

buy
ts-node buy.ts

bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?)
D:\dev\solana-sniper-bot\node_modules\base-x\src\index.js:113
throw new Error('Non-base' + BASE + ' character')
^
Error: Non-base58 character
at Object.decode (D:\dev\solana-sniper-bot\node_modules\base-x\src\index.js:113:11)
at D:\dev\solana-sniper-bot\buy.ts:103:39
at Generator.next ()
at D:\dev\solana-sniper-bot\buy.ts:31:71
at new Promise ()
at __awaiter (D:\dev\solana-sniper-bot\buy.ts:27:12)
at init (D:\dev\solana-sniper-bot\buy.ts:96:12)
at D:\dev\solana-sniper-bot\buy.ts:376:9
at Generator.next ()
at D:\dev\solana-sniper-bot\buy.ts:31:71
PS D:\dev\solana-sniper-bot>

Timer pools

Hello

#not a dev question

I am wondering whether there is a standard (efficient) method in the Raydium SDK to exclude 'timer' pools?

offset: LIQUIDITY_STATE_LAYOUT_V4.offsetOf('status'),
bytes: bs58.encode([6, 0, 0, 0, 0, 0, 0, 0]),

We can store the list of timer pools (by changing to "7") and then check the list before processing (how to set 2 separate listeners?). Perhaps we can check when the liquidity has been added vs currect time. I'm not sure if those are ok, but these are potential options.

Thanks for the help in advance

HELIUS RPC not worked

I added Helius RPC URLs to the .env file, now the bot writes INFO: Buy -- mint, url and dexurl adresses without any errors, but really the Buy does not occur and there are no transactions in Solscan.

RPC_ENDPOINT=https://mainnet.helius-rpc.com/?api-key=[mykey]
RPC_WEBSOCKET_ENDPOINT=wss://mainnet.helius-rpc.com/?api-key=[mykey]

Is it true? What I doing wrong?

Detect Total Tokens and SOL added to the Pool

Hey guys I've been trying to get the amount added to the pool but the bot usually sends late info.

From the pool, I was able to get the tokens in the LP but that's after trading as started it was not able to get the exact amount but the balance

For example if owner adds 5 SOL to pool on bot sending messages the 5 SOL owner adds might have pumped to 12 Sol before it being sent by the bot to the console

Here is my code line
https://github.com/CHToken/solana-sniper-bot/blob/master/buy.ts

Sniper bot

Hey Filip great work!

Ive tried using it, but what wallet do you prefer to use?
And also, do you have any other platform to write you a message? Like gmail or instagram, telegr.

Thank you,

Auto Sell Delay

I would like to use the function auto sell delay for some tokens. Is it possible to add the function again?
Why did you decide to take it out of the script? Was it not working correctly?

User interface

Proposal how to build a UI. the bot and other components have to communicate with the frontend (client).

If the bot has a websocket endpoint can implement a protocol like this eg. Each messages has a topic and a content

  • 'info', logging info eg about pools
  • 'tx', buy/sell info
  • 'balances', info about wallet

client can be written in react and display in realtime information from the websocket endpoint.

Open questions

  • what features to integrate? bot logs and info about tokens?
  • how to make this modular and not bloat the codebase. plugins?
  • make client a separate repo?

empty Token Accounts?

Hi,

Trying to understands this project by running it.

Am i the only one who gets empty Token Accounts?

image

image

ERROR: Failed to process pool

Dear Author,

Thanks for sharing your program. I have tried it but get the below error

[18:13:01.017] INFO: Listening for raydium changes: 0
[18:13:01.017] INFO: Listening for open book changes: 1
[18:16:14.863] ERROR: Failed to process pool
status: "06"
nonce: "fe"
maxOrder: "07"
depth: "03"
baseDecimal: "06"
quoteDecimal: "09"
state: "01"
resetFlag: "00"
minSize: "3b9aca00"
volMaxCutRatio: "01f4"
amountWaveRatio: "4c4b40"
baseLotSize: "0f4240"
quoteLotSize: "2710"
minPriceMultiplier: "01"
maxPriceMultiplier: "3b9aca00"
systemDecimalValue: "3b9aca00"
minSeparateNumerator: "05"
minSeparateDenominator: "2710"
tradeFeeNumerator: "19"
tradeFeeDenominator: "2710"
pnlNumerator: "0c"
pnlDenominator: "64"
swapFeeNumerator: "19"
swapFeeDenominator: "2710"
baseNeedTakePnl: "00"
quoteNeedTakePnl: "00"
quoteTotalPnl: "00"
baseTotalPnl: "00"
poolOpenTime: "65c3bad0"
punishPcAmount: "00"
punishCoinAmount: "00"
orderbookToInitTime: "00"
swapBaseInAmount: "00"
swapQuoteOutAmount: "00"
swapBase2QuoteFee: "4e354a"
swapQuoteInAmount: "7a3343a0"
swapBaseOutAmount: "d0126e44656f"
swapQuote2BaseFee: "00"
baseVault: "DsTV4d2hRksBkaVCixZXoy1oDddquU5EqNvXpX6v21ny"
quoteVault: "DUzCVWAanSSAJ2a7b5cfePrhfAptDJkZJ4gLPEpykn1W"
baseMint: "9vZBamqVH4RyQFqcAE5mMAf1VZAriZteVxYpXugWK49d"
quoteMint: "So11111111111111111111111111111111111111112"
lpMint: "EfSzMbfsCHYyT1ADaWdaeSPTd6TUZkNf2hboJ6YJNzAU"
openOrders: "61v931f9xu8j8sNMCnbgaJWccvq5L95XuHAXGDWJenKq"
marketId: "DYF4VN7u63wzj4UFNKTyu342ExTszR4QS3guL1utyhJJ"
marketProgramId: "srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX"
targetOrders: "7ArUTyFeRr56L2cpmZoAuRYspiMGEpNb5G15bHG3Z3h7"
withdrawQueue: "11111111111111111111111111111111"
lpVault: "11111111111111111111111111111111"
owner: "GThUX1Atko4tqhN2NaiTazWSeFWMuiUvfFnyJyUghFMJ"
lpReserve: "021d0cad8dac"
padding: [
"00",
"00",
"00"
]
error: {
"type": "SendTransactionError",
"message": "failed to send transaction: Transaction simulation failed: Error processing Instruction 2: custom program error: 0x1",
"stack":
Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 2: custom program error: 0x1
at Connection.sendEncodedTransaction (C:\Users\Stefan\Desktop\Bots\Sol Snip bot\node_modules@solana\web3.js\src\connection.ts:5920:13)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Connection.sendRawTransaction (C:\Users\Stefan\Desktop\Bots\Sol Snip bot\node_modules@solana\web3.js\src\connection.ts:5879:20)
"logs": [
"Program ComputeBudget111111111111111111111111111111 invoke [1]",
"Program ComputeBudget111111111111111111111111111111 success",
"Program ComputeBudget111111111111111111111111111111 invoke [1]",
"Program ComputeBudget111111111111111111111111111111 success",
"Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL invoke [1]",
"Program log: CreateIdempotent",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]",
"Program log: Instruction: GetAccountDataSize",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 1569 of 392795 compute units",
"Program return: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA pQAAAAAAAAA=",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
"Program 11111111111111111111111111111111 invoke [2]",
"Transfer: insufficient lamports 904720, need 2039280",
"Program 11111111111111111111111111111111 failed: custom program error: 0x1",
"Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL consumed 11473 of 399700 compute units",
"Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL failed: custom program error: 0x1"
]
}

Check Ownership Renounced and Creator Balance

Notice of ownership renunciation and the balance of the creator has some correlation with whether the token will be subject to a rug pull. It's uncertain if there's a way to programmatically check these two factors.

image

Script runs but it's not making any buys o showing errors.

I have USD & SOL in my Wallet.
I've configured correctly the RPC because I can see requests on my dashboard.
But when I run the scripts I get the following screenshot but no error thrown or message.
image

What I'm doing wrong or is missconfigured?
Thanks.

swapping out after swapping in

i got this to work after a few small changes.

question, i am trying to figure out the swap transaction to sell at a higher price from the initial buy swap.

A) have you figured out where the price data is of the token is stored? is the value calculated from helper methods in the raydium sdk Liquidity.computePrice() methods? or is it on-chain with an oracle feed elsewhere?
B) in constructing the swap instruction to sell the tokens at market rate, should i use the same fixed in swap? or is it fixed out?

More Filters

Since I got rugged several times, I propose more filters to prevent this:

  1. Detect High Ownership (if a lot of token supply is only in a few wallets)
  2. Detect Dexscreener Enhanced Info (if a dev/creator paid $300 for enhanced info, there is a little bit higher probability the project is not a scam)
  3. Detect Low Liquidity (don't buy if the current liquidity is below a set liqudity)

Thanks, great work so far!

private key not found

When running script i keep getting private key not found.
I edited the .env file and included private key from secondary phantom wallet.
also converted private key to base 58 format and still get same error msg [22:59:01.574] error: private_key is not set

Thanks again!
Sully

Filter - Revoke Mint Authority / LP Burn / Sell Timer

Hi everyone, I would like to ask if it is possible to add conditions to filter out invidual pools where the Revoke Mint Authority and LP Burn had occured. Plus to set a timer for the subsequent sale of a given coin after a bot purchase? Thank you.

To improve the speed of purchase, what can be done?

Hello!
I use "snipe list" and can buy after only 15-17 seconds
my place after purchase is always 90+

tried different settings:
setComputeUnitLimit { units: 1_400_000 } // min 200k max 1.4kk
setComputeUnitPrice { microLamports: 10_000_000 } // 0,01 Sol = Lamport 10000000

Tell me what parameters can be changed or how can the script be improved to get into that 1-5-10 range when purchasing?

Maybe someone has a simple script for the BUY function for a token that has not yet appeared in the pool, so that he tries to buy it and maybe it will be faster (with the error ignored)?

I got error while running the code

  throw new SolanaJSONRPCError(
        ^

SolanaJSONRPCError: failed to get accounts owned by program 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8: the method getProgramAccounts does not exist/is not available
at Connection.getProgramAccounts (/Users/solana-sniper-bot-master 2/node_modules/@solana/web3.js/src/connection.ts:3677:13)
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: -32601,
data: undefined
}

Great work thanks! Question regarding new pool

Hi, from my understanding, you set a listener for each time a new pool is created.
Is there a way to get the opening time of the pool?
Could not find the information clearly on Raydium SDK.

I could help adding this feature to your code.

Regards.

How to convert SOL to WSOL?

Hey, I can't seem to figure out how to convert SOL to WSOL. My Phantom wallet doesn't have this option nor I can exchange sol to wsol. How do you guys do it?

Buy transactions error

Encountering this error sometime, not always.

[08:30:02.429] ERROR: Failed to process pool
    status: "8481abfe57889b06"
    nonce: "35c01846637f68fb"
    maxOrder: "553beb1adc39c4da"
    depth: "0100000000f0a098"
    baseDecimal: "b244fbdde3fb7667"
    quoteDecimal: "ed2ffaab54205e65"
    state: "3846d74dd270550f"
    resetFlag: "1f51148ef48039aa"
    minSize: "06b73f891e"
    volMaxCutRatio: "00"
    amountWaveRatio: "00"
    baseLotSize: "00"
    quoteLotSize: "00"
    minPriceMultiplier: "010100000000"
    maxPriceMultiplier: "1f1df000"
    systemDecimalValue: "00"
    minSeparateNumerator: "00"
    minSeparateDenominator: "00"
    tradeFeeNumerator: "00"
    tradeFeeDenominator: "00"
    pnlNumerator: "00"
    pnlDenominator: "00"
    swapFeeNumerator: "00"
    swapFeeDenominator: "00"
    baseNeedTakePnl: "00"
    quoteNeedTakePnl: "00"
    quoteTotalPnl: "00"
    baseTotalPnl: "00"
    poolOpenTime: "00"
    punishPcAmount: "00"
    punishCoinAmount: "00"
    orderbookToInitTime: "00"
    swapBaseInAmount: "00"
    swapQuoteOutAmount: "00"
    swapBase2QuoteFee: "00"
    swapQuoteInAmount: "00"
    swapBaseOutAmount: "00"
    swapQuote2BaseFee: "00"
    baseVault: "11111111111111111111111111111111"
    quoteVault: "11111111111111111111111111111111"
    baseMint: "11111111111111111111111111111111"
    quoteMint: "11111111111111111111111111111111"
    lpMint: "11111111111111111111111111111111"
    openOrders: "11111111111111111111111111111111"
    marketId: "11111111111111111111111111111111"
    marketProgramId: "11111111111111111111111111111111"
    targetOrders: "11111111111111111111111111111111"
    withdrawQueue: "11111111111111111111111111111111"
    lpVault: "11111111111111111111111111111111"
    owner: "11111111111111111111111111111111"
    lpReserve: "00"
    padding: [
      "00",
      "00",
      "00"
    ]
    error: {
      "type": "Error",
      "message": "Number can only safely store up to 53 bits",
      "stack":
          Error: Number can only safely store up to 53 bits
              at assert (/root/solana-sniper-bot/node_modules/bn.js/lib/bn.js:6:21)
              at BN.toNumber (/root/solana-sniper-bot/node_modules/bn.js/lib/bn.js:547:7)
              at createPoolKeys (/root/solana-sniper-bot/liquidity/liquidity.ts:98:43)
              at /root/solana-sniper-bot/buy.ts:430:41
              at Generator.next (<anonymous>)
              at fulfilled (/root/solana-sniper-bot/buy.ts:28:58)
              at processTicksAndRejections (node:internal/process/task_queues:95:5)
    }

Rugpull safety

Last night I was playing with the script, it bought like 15 tokens and all of them were rugpulls in less thank a minute, I didn't have a chance to sell before liquidity was taken to zero. Is there any way the buy method can be enhanced to decrease the risk of scam tokens?

Sell method

@fdundjer Is it possible to have a method for selling sol tokens? possibly with a timed strategy?

ERROR: RPC_ENDPOINT is not set

Getting an error when I set my RPC endpoint. I'm using quick node and the file is saved but for some reason the code cannot detect the rpc?

Wallet

Where to add or enter or provide our wallet address?It only asks for private keys.Help me out

Buys but does not sell

Displays an error, but buys and does not sell.
Zrzut ekranu 2024-02-26 192348
AUTO_SELL true
SELL_DELAY 3000

what am i doing wrong? ;)

Swap transaction delayed / dropped

Hello
I am building a solana sniper bot aswell

I tried running yours and got an error.

I just wanted to know if you are able to swap new pools almost instantly or not, because my buy attempts are always dropped when I try to buy in the first ~10 sec after juicy new pool launch, but if I wait ~10 sec then it works fine. The same tx with same settings ofc

the error if it inrerests you :

/home/quarch/fdundjer/buy.ts:5
MARKET_STATE_LAYOUT_V2,
^
TypeError: Cannot read properties of undefined (reading 'pubkey')
at /home/quarch/fdundjer/buy.ts:113:25
at Generator.next ()
at fulfilled (/home/quarch/fdundjer/buy.ts:5:58)
at processTicksAndRejections (node:internal/process/task_queues:95:5)

Some feedback, some questions

#Not pro coder feedback

Just wanted to drop some feedback. This code I've been testing from open sources is rock solid, delivering the best results I've seen yet (pool detection speed). The author is pure gold. I've put it through its paces with various public nodes and geos (like Helius, which spans multiple regions/countries, though exact city details are scarce).

Observations:

  • The code's performing well, swap is almost instant (depends on node/load)
  • Instant pool detection (for instant pool detection tx commitment = confirmed -> processed
  • makeSwapFixedInInstruction sometimes misses when passing new poolKeys

Would be awesome if @fdundjer or other contributors would prompt how to build 'sell-after' function

p.s. If someone is looking to integrate basic pool/token info to filter out scam pools (liquidity, authority, Raydium supply, top holders, and socials), below are my findings as far:

  1. Liquidity amount: QuoteVault is probably where its stored. getBalance method can be used to obtain LP in Sol.
  2. Supply/Top holders%/Raydiyum%: raw data can be obtained using getTokenSupply / getTokenLargestAccounts / getParsedAccountInfo
  3. Mint/Freeze authority authority, deployer info can be decoded from account data: https://www.helius.dev/blog/solana-dev-101-deserializing-account-data-on-solana

BR

Error: No SOL token account found in wallet:

D:\video\sol\solana\buy.ts:28
import { retrieveEnvVariable } from './utils';
^
Error: No SOL token account found in wallet: 9ShLJ6KyegT4X6YXGnqc3bBpGpDwNuYXBqkoKXBMzZm6
at D:\video\sol\solana\buy.ts:146:11
at Generator.next ()
at fulfilled (D:\video\sol\solana\buy.ts:28:58)
at processTicksAndRejections (node:internal/process/task_queues:95:5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.