@meteora-ag/dlmm 1.0.1 → 1.0.2-abcd12345.0
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.js +21 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7733,6 +7733,10 @@ var DLMM = class {
|
|
|
7733
7733
|
liquidityShares: posShares,
|
|
7734
7734
|
lastUpdatedAt
|
|
7735
7735
|
} = positionAccount;
|
|
7736
|
+
console.log(
|
|
7737
|
+
"\u{1F680} ~ DLMM ~ posShares:",
|
|
7738
|
+
posShares.map((a) => a.toString())
|
|
7739
|
+
);
|
|
7736
7740
|
const bins = this.getBinsBetweenLowerAndUpperBound(
|
|
7737
7741
|
lbPair,
|
|
7738
7742
|
lowerBinId,
|
|
@@ -7750,7 +7754,16 @@ var DLMM = class {
|
|
|
7750
7754
|
let totalXAmount = new (0, _decimaljs2.default)(0);
|
|
7751
7755
|
let totalYAmount = new (0, _decimaljs2.default)(0);
|
|
7752
7756
|
bins.forEach((bin, idx) => {
|
|
7757
|
+
console.log(
|
|
7758
|
+
"\u{1F680} ~ DLMM ~ bins.forEach ~ bin:",
|
|
7759
|
+
bin.xAmount.toString(),
|
|
7760
|
+
bin.yAmount.toString()
|
|
7761
|
+
);
|
|
7753
7762
|
const binSupply = new (0, _decimaljs2.default)(bin.supply.toString());
|
|
7763
|
+
console.log(
|
|
7764
|
+
"\u{1F680} ~ DLMM ~ bins.forEach ~ binSupply:",
|
|
7765
|
+
binSupply.toString()
|
|
7766
|
+
);
|
|
7754
7767
|
let posShare;
|
|
7755
7768
|
if (bin.version === 1 && version === 0 /* V1 */) {
|
|
7756
7769
|
posShare = new (0, _decimaljs2.default)(posShares[idx].shln(64).toString());
|
|
@@ -7758,7 +7771,15 @@ var DLMM = class {
|
|
|
7758
7771
|
posShare = new (0, _decimaljs2.default)(posShares[idx].toString());
|
|
7759
7772
|
}
|
|
7760
7773
|
const positionXAmount = binSupply.eq(new (0, _decimaljs2.default)("0")) ? new (0, _decimaljs2.default)("0") : posShare.mul(bin.xAmount.toString()).div(binSupply).floor();
|
|
7774
|
+
console.log(
|
|
7775
|
+
"\u{1F680} ~ DLMM ~ bins.forEach ~ positionXAmount:",
|
|
7776
|
+
positionXAmount.toString()
|
|
7777
|
+
);
|
|
7761
7778
|
const positionYAmount = binSupply.eq(new (0, _decimaljs2.default)("0")) ? new (0, _decimaljs2.default)("0") : posShare.mul(bin.yAmount.toString()).div(binSupply).floor();
|
|
7779
|
+
console.log(
|
|
7780
|
+
"\u{1F680} ~ DLMM ~ bins.forEach ~ positionYAmount:",
|
|
7781
|
+
positionYAmount.toString()
|
|
7782
|
+
);
|
|
7762
7783
|
totalXAmount = totalXAmount.add(positionXAmount);
|
|
7763
7784
|
totalYAmount = totalYAmount.add(positionYAmount);
|
|
7764
7785
|
positionData.push({
|