@meteora-ag/dlmm 1.0.39-rc.3 → 1.0.39-rc.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -5316,7 +5316,7 @@ declare class DLMM {
5316
5316
  * @returns {Promise<Transaction>}
5317
5317
  */
5318
5318
  syncWithMarketPrice(marketPrice: number, owner: PublicKey): Promise<Transaction>;
5319
- getLastPrice(): Promise<string>;
5319
+ getLastPrice(minPrice: string): Promise<string>;
5320
5320
  /** Private static method */
5321
5321
  private static getBinArrays;
5322
5322
  private static getClaimableLMReward;
package/dist/index.js CHANGED
@@ -9904,11 +9904,10 @@ var DLMM = class {
9904
9904
  lastValidBlockHeight
9905
9905
  }).add(syncWithMarketPriceTx);
9906
9906
  }
9907
- async getLastPrice() {
9908
- const { price } = await this.getActiveBin();
9907
+ async getLastPrice(minPrice) {
9909
9908
  const binArrays = await this.getBinArrays();
9910
9909
  let count = 0;
9911
- let binPriceWithLastLiquidity = price;
9910
+ let binPriceWithLastLiquidity = minPrice;
9912
9911
  while (count <= binArrays.length - 1) {
9913
9912
  const binArray = binArrays[count];
9914
9913
  if (binArray) {
@@ -9919,6 +9918,10 @@ var DLMM = class {
9919
9918
  const lastBinWithLiquidityIndex = bins.findIndex(
9920
9919
  ({ liquiditySupply }) => liquiditySupply.isZero()
9921
9920
  );
9921
+ console.log(
9922
+ bins[lastBinWithLiquidityIndex - 1].amountX,
9923
+ bins[lastBinWithLiquidityIndex - 1].amountY
9924
+ );
9922
9925
  binPriceWithLastLiquidity = bins[lastBinWithLiquidityIndex - 1].price.toString();
9923
9926
  count = binArrays.length;
9924
9927
  }