Skip to content

nextInitializedTickArrayStartIndex may be wrong with the calculation #116

Open
@smallncq

Description

@smallncq

Is there something wrong with the calculation in nextInitializedTickArrayStartIndex method?

https://github.com/raydium-io/raydium-sdk-V2/blob/45d37d45460f4948d61762e8e4b149706778c217/src/raydium/clmm/utils/tickarrayBitmap.ts#L35C1-L35C52

const nextTickArrayStartIndex = zeroForOne
      ? lastTickArrayStartIndex - TickQuery.tickCount(tickSpacing)
      : lastTickArrayStartIndex + TickQuery.tickCount(tickSpacing);

I think when zeroForOne is true,

nextTickArrayStartIndex should be : lastTickArrayStartIndex,not lastTickArrayStartIndex - TickQuery.tickCount(tickSpacing)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions