warp-id / solana-trading-bot

Solana Trading Bot - Beta
Microsoft Public License
1.3k stars 616 forks source link

Great work thanks! Question regarding new pool #1

Closed AndoKarim closed 5 months ago

AndoKarim commented 6 months ago

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.

fdundjer commented 6 months ago

Hey @AndoKarim, the liquidity pool should be open as soon as it gets created. Do you see any errors when running the script?

AndoKarim commented 6 months ago

It's just that sometimes a pool can be created but the open_time is in the future. And for those ones you cannot snipe them since the event is received and won't be re-triggered when the pool opens.

On Fri, 5 Jan 2024, 7:41 pm Filip Dunđer, @.***> wrote:

Hey @AndoKarim https://github.com/AndoKarim, the liquidity pool should be open as soon as it gets created. Do you see any errors when running the script?

— Reply to this email directly, view it on GitHub https://github.com/fdundjer/solana-sniper-bot/issues/1#issuecomment-1878869140, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXOQMHZN7DRSMLADBXL373YNANL7AVCNFSM6AAAAABBOAHGKCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZYHA3DSMJUGA . You are receiving this because you were mentioned.Message ID: @.***>

fdundjer commented 6 months ago

Thanks for sharing, I was not aware of this functionality. Looks like pool opening time is available in a new version of Raydium SDK. https://github.com/raydium-io/raydium-sdk/commit/9d346fcc76d354c8dc2d8c2378131ef3b9fda372 LIQUIDITY_STATE_LAYOUT_V4 now contains pool time.

I think updating SDK package should give you the ability to read the opening time.

chiochocolate commented 6 months ago

Hey @AndoKarim , Great question!.

Can i contact you on another platform like instagram or gmail? I have a question about this. Im facing a problem with the opening time.

Thank you,

AndoKarim commented 6 months ago

@fdundjer Thanks for your help.

I tried so far but using LiquidityPoolJsonInfo, it does not have the openingTime on it, even on last version. Pretty weird.

dtmrc commented 6 months ago

@fdundjer Thanks for your help.

I tried so far but using LiquidityPoolJsonInfo, it does not have the openingTime on it, even on last version. Pretty weird.

i think you have to parse data account using layout_v5..

saurabh41 commented 6 months ago

is it possible to find pool id from mint address(aka token address) ?

fdundjer commented 6 months ago

@fdundjer Thanks for your help.

I tried so far but using LiquidityPoolJsonInfo, it does not have the openingTime on it, even on last version. Pretty weird.

Not sure where is the problem, I'm able to get pool time. I'll push the updated version with typed variables, so you can easily find pool time.

ps. If you want just to snipe open pools, instead of checking pool time, you could update the listener to subscribe to the correct pool status. eg:

 {
        memcmp: {
          offset: LIQUIDITY_STATE_LAYOUT_V4.offsetOf('status'),
          bytes: binary_to_base58([1,0,0,0,0,0,0,0])
        },
 }

where bytes would in this case represent "Initalized" pool status. You can use 6 instead of 1 to listen to pools that have transitioned from closed (waitingToTrade) to open.

Here you can see code that does this transition on raydium: https://github.com/raydium-io/raydium-amm/blob/f290430a417569c3de514c43a17dad872ead59a2/program/src/processor.rs#L1208

If you are not in a rush, I can update the script.

AndoKarim commented 6 months ago

Hello, thanks again for the help do you have a Telegram or Discord by chance?

Thanks!

fdundjer commented 6 months ago

@AndoKarim Hey, you can send me a message on discord

fdundjer commented 5 months ago

@AndoKarim I've added a check for open pools. Let me know if script works as expected.