Skip to content

Hardcoded position amount? #2

@brandonros

Description

@brandonros

According to the IDL, the buy signature is this:

// buy(amount, maxSolCost)
      const amount = new BN(this.positionAmount)
      const maxSolCost = new BN(this.positionAmount + this.positionAmount * 0.05);
      const transaction = await this.pumpFun.anchorProgram.methods
        .buy(amount, maxSolCost)

I could be wrong but I think when a token is launched, its supply is kind of "unique". Certain amount of decimals, etc.

I would have thought you needed to do math to figure out for example how many tokens 0.1 SOL (after slippage? before slippage?) would get you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions