@meteora-ag/dlmm 1.0.39-rc.7 → 1.0.39-rc.8
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 +1 -1
- package/dist/index.js +6 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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(minPrice: string): Promise<
|
|
5319
|
+
getLastPrice(minPrice: string): Promise<number>;
|
|
5320
5320
|
/** Private static method */
|
|
5321
5321
|
private static getBinArrays;
|
|
5322
5322
|
private static getClaimableLMReward;
|
package/dist/index.js
CHANGED
|
@@ -9909,27 +9909,25 @@ var DLMM = class {
|
|
|
9909
9909
|
let count = 0;
|
|
9910
9910
|
let binPriceWithLastLiquidity = minPrice;
|
|
9911
9911
|
while (count <= binArrays.length - 1) {
|
|
9912
|
-
const binArray = binArrays[count];
|
|
9912
|
+
const binArray = binArrays.reverse()[count];
|
|
9913
9913
|
if (binArray) {
|
|
9914
9914
|
const bins = binArray.account.bins;
|
|
9915
|
-
if (bins
|
|
9915
|
+
if (bins.every(({ liquiditySupply }) => liquiditySupply.isZero())) {
|
|
9916
9916
|
count++;
|
|
9917
9917
|
} else {
|
|
9918
9918
|
const lastBinWithLiquidityIndex = bins.findIndex(
|
|
9919
|
-
({ liquiditySupply }) => liquiditySupply.isZero()
|
|
9919
|
+
({ liquiditySupply }) => !liquiditySupply.isZero()
|
|
9920
9920
|
);
|
|
9921
9921
|
console.log(
|
|
9922
9922
|
bins[lastBinWithLiquidityIndex].amountX.toString(),
|
|
9923
|
-
bins[lastBinWithLiquidityIndex].amountY.toString()
|
|
9924
|
-
bins[lastBinWithLiquidityIndex - 1].amountX.toString(),
|
|
9925
|
-
bins[lastBinWithLiquidityIndex - 1].amountY.toString()
|
|
9923
|
+
bins[lastBinWithLiquidityIndex].amountY.toString()
|
|
9926
9924
|
);
|
|
9927
|
-
binPriceWithLastLiquidity = bins[lastBinWithLiquidityIndex
|
|
9925
|
+
binPriceWithLastLiquidity = bins[lastBinWithLiquidityIndex].price.toString();
|
|
9928
9926
|
count = binArrays.length;
|
|
9929
9927
|
}
|
|
9930
9928
|
}
|
|
9931
9929
|
}
|
|
9932
|
-
return binPriceWithLastLiquidity;
|
|
9930
|
+
return Number(binPriceWithLastLiquidity) / (2 ** 64 - 1);
|
|
9933
9931
|
}
|
|
9934
9932
|
/** Private static method */
|
|
9935
9933
|
static async getBinArrays(program, lbPairPubkey) {
|