MeteoraAg / dlmm-sdk

An SDK for building applications on top of Dynamic CLMM
68 stars 57 forks source link

Fix array indices calculation #112

Closed shadeglare closed 1 month ago

shadeglare commented 1 month ago

This patch fixes the bin array indices calculation in the addLiquidityByStrategy method. Prev the indices could be outside the range of the actual min /max bin array indices a position can have.

shadeglare commented 1 month ago

@McSam94 Gm. Please, take a look. Maybe the byWeight method also should be patched I just don't use it atm. Originally discovered the bug when was trying to provide liq into arbitrary bins in my positions.