@meteora-ag/dlmm 1.6.0-rc.15 → 1.6.0-rc.17
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 +4 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13064,6 +13064,7 @@ function findBaseDeltaX(amountX, minDeltaId, maxDeltaId, binStep, activeId, minX
|
|
|
13064
13064
|
let c = new (0, _bnjs2.default)(0);
|
|
13065
13065
|
let m1 = minDeltaId;
|
|
13066
13066
|
let m2 = maxDeltaId;
|
|
13067
|
+
console.log(m1.toNumber(), m2.toNumber());
|
|
13067
13068
|
for (let m = m1.toNumber(); m <= m2.toNumber(); m++) {
|
|
13068
13069
|
const binId = activeId.addn(m);
|
|
13069
13070
|
const pm = getQPriceFromId(binId.neg(), binStep);
|
|
@@ -13072,7 +13073,7 @@ function findBaseDeltaX(amountX, minDeltaId, maxDeltaId, binStep, activeId, minX
|
|
|
13072
13073
|
const cDelta = new (0, _bnjs2.default)(m).mul(pm);
|
|
13073
13074
|
c = c.add(cDelta);
|
|
13074
13075
|
}
|
|
13075
|
-
console.log(amountX.
|
|
13076
|
+
console.log(amountX.sub(minX0).shln(SCALE_OFFSET).div(c.sub(b)).toString());
|
|
13076
13077
|
return amountX.sub(minX0).shln(SCALE_OFFSET).div(c.sub(b));
|
|
13077
13078
|
}
|
|
13078
13079
|
function findX0AndDeltaX(amountX, minDeltaId, maxDeltaId, binStep, activeId) {
|
|
@@ -13091,7 +13092,9 @@ function findX0AndDeltaX(amountX, minDeltaId, maxDeltaId, binStep, activeId) {
|
|
|
13091
13092
|
activeId,
|
|
13092
13093
|
minX0
|
|
13093
13094
|
);
|
|
13095
|
+
console.log("\u{1F680} ~ baseDeltaX:", baseDeltaX.toString());
|
|
13094
13096
|
const x0 = minDeltaId.neg().mul(baseDeltaX).add(minX0);
|
|
13097
|
+
console.log("\u{1F680} ~ x0:", x0.toString());
|
|
13095
13098
|
while (true) {
|
|
13096
13099
|
const amountInBins = getAmountInBinsAskSide(
|
|
13097
13100
|
activeId,
|