impermax-sdk 2.1.528 → 2.1.529
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.
|
@@ -27,7 +27,6 @@ class SolidlyStablePosition extends genericPosition_1.default {
|
|
|
27
27
|
this.liquidity = Math.max(liquidity, 0);
|
|
28
28
|
}
|
|
29
29
|
getRealXRealYGivenLiquidityAndPrice(liquidity, price) {
|
|
30
|
-
console.log("getRealXRealYGivenLiquidityAndPrice", liquidity, price);
|
|
31
30
|
if (!this.liquidityCache[liquidity])
|
|
32
31
|
this.liquidityCache[liquidity] = {};
|
|
33
32
|
const cached = this.liquidityCache[liquidity][price];
|
|
@@ -42,7 +41,6 @@ class SolidlyStablePosition extends genericPosition_1.default {
|
|
|
42
41
|
// binary search for ratio
|
|
43
42
|
for (let i = 0; i < 1000; i++) {
|
|
44
43
|
const priceTmp = (0, lliquidity_math_1.solidlyStable_getPriceFromReserves)(1, ratio);
|
|
45
|
-
console.log("prices", price, priceAbs, priceTmp);
|
|
46
44
|
if (Math.abs((priceTmp - 1) - (priceAbs - 1)) < 1e-6)
|
|
47
45
|
break;
|
|
48
46
|
if (priceTmp > price) {
|
|
@@ -82,7 +80,6 @@ class SolidlyStablePosition extends genericPosition_1.default {
|
|
|
82
80
|
getOptimalLiquidity(amountX, amountY) {
|
|
83
81
|
const sampleX = this.getRealXGivenLiquidity(1);
|
|
84
82
|
const sampleY = this.getRealYGivenLiquidity(1);
|
|
85
|
-
console.log("getOptimalLiquidity", amountX, amountY, sampleX, sampleY);
|
|
86
83
|
if (Math.abs(amountX) / sampleX > Math.abs(amountY) / sampleY)
|
|
87
84
|
amountX = amountY / sampleY * sampleX;
|
|
88
85
|
else
|