@magmaprotocol/magma-clmm-sdk 0.5.86 → 0.5.87
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 +16 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2096,28 +2096,28 @@ function toAmountsBothSideByStrategy(activeId, binStep, minBinId, maxBinId, amou
|
|
|
2096
2096
|
}
|
|
2097
2097
|
case 2 /* Curve */: {
|
|
2098
2098
|
if (activeId < minBinId) {
|
|
2099
|
-
const
|
|
2100
|
-
res = toAmountBothSide(activeId, binStep, amountX, amountY, amountXInActiveBin, amountYInActiveBin,
|
|
2101
|
-
}
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2099
|
+
const weights = toWeightDecendingOrder(minBinId, maxBinId);
|
|
2100
|
+
res = toAmountBothSide(activeId, binStep, amountX, amountY, amountXInActiveBin, amountYInActiveBin, weights);
|
|
2101
|
+
} else if (activeId > maxBinId) {
|
|
2102
|
+
const weights = toWeightAscendingOrder(minBinId, maxBinId);
|
|
2103
|
+
res = toAmountBothSide(activeId, binStep, amountX, amountY, amountXInActiveBin, amountYInActiveBin, weights);
|
|
2104
|
+
} else {
|
|
2105
|
+
const weights = toWeightCurve(minBinId, maxBinId, activeId);
|
|
2106
|
+
res = toAmountBothSide(activeId, binStep, amountX, amountY, amountXInActiveBin, amountYInActiveBin, weights);
|
|
2105
2107
|
}
|
|
2106
|
-
const weights = toWeightCurve(minBinId, maxBinId, activeId);
|
|
2107
|
-
res = toAmountBothSide(activeId, binStep, amountX, amountY, amountXInActiveBin, amountYInActiveBin, weights);
|
|
2108
2108
|
break;
|
|
2109
2109
|
}
|
|
2110
2110
|
case 3 /* BidAsk */: {
|
|
2111
2111
|
if (activeId < minBinId) {
|
|
2112
|
-
const
|
|
2113
|
-
res = toAmountBothSide(activeId, binStep, amountX, amountY, amountXInActiveBin, amountYInActiveBin,
|
|
2114
|
-
}
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2112
|
+
const weights = toWeightAscendingOrder(minBinId, maxBinId);
|
|
2113
|
+
res = toAmountBothSide(activeId, binStep, amountX, amountY, amountXInActiveBin, amountYInActiveBin, weights);
|
|
2114
|
+
} else if (activeId > maxBinId) {
|
|
2115
|
+
const weights = toWeightDecendingOrder(minBinId, maxBinId);
|
|
2116
|
+
res = toAmountBothSide(activeId, binStep, amountX, amountY, amountXInActiveBin, amountYInActiveBin, weights);
|
|
2117
|
+
} else {
|
|
2118
|
+
const weights = toWeightBidAsk(minBinId, maxBinId, activeId);
|
|
2119
|
+
res = toAmountBothSide(activeId, binStep, amountX, amountY, amountXInActiveBin, amountYInActiveBin, weights);
|
|
2118
2120
|
}
|
|
2119
|
-
const weights = toWeightBidAsk(minBinId, maxBinId, activeId);
|
|
2120
|
-
res = toAmountBothSide(activeId, binStep, amountX, amountY, amountXInActiveBin, amountYInActiveBin, weights);
|
|
2121
2121
|
break;
|
|
2122
2122
|
}
|
|
2123
2123
|
default:
|