@strkfarm/sdk 1.1.52 → 1.1.53
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.
|
@@ -95174,16 +95174,12 @@ spurious results.`);
|
|
|
95174
95174
|
logger2.verbose(`${this.getTag()}::getModifyLeverCall leverSwap: ${JSON.stringify(leverSwap)}`);
|
|
95175
95175
|
let minLSTReceived = params.debtAmount.dividedBy(lstDexPriceInUnderlying).multipliedBy(1 - MAX_SLIPPAGE);
|
|
95176
95176
|
const minLSTReceivedAsPerTruePrice = params.debtAmount.dividedBy(lstTrueExchangeRate);
|
|
95177
|
-
|
|
95178
|
-
minLSTReceived = minLSTReceivedAsPerTruePrice;
|
|
95179
|
-
}
|
|
95177
|
+
minLSTReceived = minLSTReceivedAsPerTruePrice;
|
|
95180
95178
|
logger2.verbose(`${this.getTag()}::getModifyLeverCall minLSTReceivedAsPerTruePrice: ${minLSTReceivedAsPerTruePrice}, minLSTReceived: ${minLSTReceived}`);
|
|
95181
95179
|
let maxUsedCollateral = params.debtAmount.abs().dividedBy(lstDexPriceInUnderlying).multipliedBy(1 + MAX_SLIPPAGE);
|
|
95182
95180
|
const maxUsedCollateralInLST = params.debtAmount.abs().dividedBy(lstTrueExchangeRate).multipliedBy(1.005);
|
|
95183
95181
|
logger2.verbose(`${this.getTag()}::getModifyLeverCall maxUsedCollateralInLST: ${maxUsedCollateralInLST}, maxUsedCollateral: ${maxUsedCollateral}`);
|
|
95184
|
-
|
|
95185
|
-
maxUsedCollateral = maxUsedCollateralInLST;
|
|
95186
|
-
}
|
|
95182
|
+
maxUsedCollateral = maxUsedCollateralInLST;
|
|
95187
95183
|
const STEP2_ID = "switch_delegation_on" /* SWITCH_DELEGATION_ON */;
|
|
95188
95184
|
const manage2Info = this.getProofs(STEP2_ID);
|
|
95189
95185
|
const manageCall2 = manage2Info.callConstructor({
|
package/dist/index.browser.mjs
CHANGED
|
@@ -31267,16 +31267,12 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
|
|
|
31267
31267
|
logger.verbose(`${this.getTag()}::getModifyLeverCall leverSwap: ${JSON.stringify(leverSwap)}`);
|
|
31268
31268
|
let minLSTReceived = params.debtAmount.dividedBy(lstDexPriceInUnderlying).multipliedBy(1 - MAX_SLIPPAGE);
|
|
31269
31269
|
const minLSTReceivedAsPerTruePrice = params.debtAmount.dividedBy(lstTrueExchangeRate);
|
|
31270
|
-
|
|
31271
|
-
minLSTReceived = minLSTReceivedAsPerTruePrice;
|
|
31272
|
-
}
|
|
31270
|
+
minLSTReceived = minLSTReceivedAsPerTruePrice;
|
|
31273
31271
|
logger.verbose(`${this.getTag()}::getModifyLeverCall minLSTReceivedAsPerTruePrice: ${minLSTReceivedAsPerTruePrice}, minLSTReceived: ${minLSTReceived}`);
|
|
31274
31272
|
let maxUsedCollateral = params.debtAmount.abs().dividedBy(lstDexPriceInUnderlying).multipliedBy(1 + MAX_SLIPPAGE);
|
|
31275
31273
|
const maxUsedCollateralInLST = params.debtAmount.abs().dividedBy(lstTrueExchangeRate).multipliedBy(1.005);
|
|
31276
31274
|
logger.verbose(`${this.getTag()}::getModifyLeverCall maxUsedCollateralInLST: ${maxUsedCollateralInLST}, maxUsedCollateral: ${maxUsedCollateral}`);
|
|
31277
|
-
|
|
31278
|
-
maxUsedCollateral = maxUsedCollateralInLST;
|
|
31279
|
-
}
|
|
31275
|
+
maxUsedCollateral = maxUsedCollateralInLST;
|
|
31280
31276
|
const STEP2_ID = "switch_delegation_on" /* SWITCH_DELEGATION_ON */;
|
|
31281
31277
|
const manage2Info = this.getProofs(STEP2_ID);
|
|
31282
31278
|
const manageCall2 = manage2Info.callConstructor({
|
package/dist/index.js
CHANGED
|
@@ -31267,16 +31267,12 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
|
|
|
31267
31267
|
logger.verbose(`${this.getTag()}::getModifyLeverCall leverSwap: ${JSON.stringify(leverSwap)}`);
|
|
31268
31268
|
let minLSTReceived = params.debtAmount.dividedBy(lstDexPriceInUnderlying).multipliedBy(1 - MAX_SLIPPAGE);
|
|
31269
31269
|
const minLSTReceivedAsPerTruePrice = params.debtAmount.dividedBy(lstTrueExchangeRate);
|
|
31270
|
-
|
|
31271
|
-
minLSTReceived = minLSTReceivedAsPerTruePrice;
|
|
31272
|
-
}
|
|
31270
|
+
minLSTReceived = minLSTReceivedAsPerTruePrice;
|
|
31273
31271
|
logger.verbose(`${this.getTag()}::getModifyLeverCall minLSTReceivedAsPerTruePrice: ${minLSTReceivedAsPerTruePrice}, minLSTReceived: ${minLSTReceived}`);
|
|
31274
31272
|
let maxUsedCollateral = params.debtAmount.abs().dividedBy(lstDexPriceInUnderlying).multipliedBy(1 + MAX_SLIPPAGE);
|
|
31275
31273
|
const maxUsedCollateralInLST = params.debtAmount.abs().dividedBy(lstTrueExchangeRate).multipliedBy(1.005);
|
|
31276
31274
|
logger.verbose(`${this.getTag()}::getModifyLeverCall maxUsedCollateralInLST: ${maxUsedCollateralInLST}, maxUsedCollateral: ${maxUsedCollateral}`);
|
|
31277
|
-
|
|
31278
|
-
maxUsedCollateral = maxUsedCollateralInLST;
|
|
31279
|
-
}
|
|
31275
|
+
maxUsedCollateral = maxUsedCollateralInLST;
|
|
31280
31276
|
const STEP2_ID = "switch_delegation_on" /* SWITCH_DELEGATION_ON */;
|
|
31281
31277
|
const manage2Info = this.getProofs(STEP2_ID);
|
|
31282
31278
|
const manageCall2 = manage2Info.callConstructor({
|
package/dist/index.mjs
CHANGED
|
@@ -31165,16 +31165,12 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
|
|
|
31165
31165
|
logger.verbose(`${this.getTag()}::getModifyLeverCall leverSwap: ${JSON.stringify(leverSwap)}`);
|
|
31166
31166
|
let minLSTReceived = params.debtAmount.dividedBy(lstDexPriceInUnderlying).multipliedBy(1 - MAX_SLIPPAGE);
|
|
31167
31167
|
const minLSTReceivedAsPerTruePrice = params.debtAmount.dividedBy(lstTrueExchangeRate);
|
|
31168
|
-
|
|
31169
|
-
minLSTReceived = minLSTReceivedAsPerTruePrice;
|
|
31170
|
-
}
|
|
31168
|
+
minLSTReceived = minLSTReceivedAsPerTruePrice;
|
|
31171
31169
|
logger.verbose(`${this.getTag()}::getModifyLeverCall minLSTReceivedAsPerTruePrice: ${minLSTReceivedAsPerTruePrice}, minLSTReceived: ${minLSTReceived}`);
|
|
31172
31170
|
let maxUsedCollateral = params.debtAmount.abs().dividedBy(lstDexPriceInUnderlying).multipliedBy(1 + MAX_SLIPPAGE);
|
|
31173
31171
|
const maxUsedCollateralInLST = params.debtAmount.abs().dividedBy(lstTrueExchangeRate).multipliedBy(1.005);
|
|
31174
31172
|
logger.verbose(`${this.getTag()}::getModifyLeverCall maxUsedCollateralInLST: ${maxUsedCollateralInLST}, maxUsedCollateral: ${maxUsedCollateral}`);
|
|
31175
|
-
|
|
31176
|
-
maxUsedCollateral = maxUsedCollateralInLST;
|
|
31177
|
-
}
|
|
31173
|
+
maxUsedCollateral = maxUsedCollateralInLST;
|
|
31178
31174
|
const STEP2_ID = "switch_delegation_on" /* SWITCH_DELEGATION_ON */;
|
|
31179
31175
|
const manage2Info = this.getProofs(STEP2_ID);
|
|
31180
31176
|
const manageCall2 = manage2Info.callConstructor({
|
package/package.json
CHANGED
|
@@ -726,18 +726,20 @@ export class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTSt
|
|
|
726
726
|
// is Deposit
|
|
727
727
|
let minLSTReceived = params.debtAmount.dividedBy(lstDexPriceInUnderlying).multipliedBy(1 - MAX_SLIPPAGE); // used for increase
|
|
728
728
|
const minLSTReceivedAsPerTruePrice = params.debtAmount.dividedBy(lstTrueExchangeRate); // execution output to be <= True LST price
|
|
729
|
-
if (minLSTReceived < minLSTReceivedAsPerTruePrice) {
|
|
730
|
-
|
|
731
|
-
}
|
|
729
|
+
// if (minLSTReceived < minLSTReceivedAsPerTruePrice) {
|
|
730
|
+
// minLSTReceived = minLSTReceivedAsPerTruePrice; // the execution shouldn't be bad than True price logi
|
|
731
|
+
// }
|
|
732
|
+
minLSTReceived = minLSTReceivedAsPerTruePrice; // in any case, we are ok with this, bcz the BTC LST spread shouldnt be high
|
|
732
733
|
logger.verbose(`${this.getTag()}::getModifyLeverCall minLSTReceivedAsPerTruePrice: ${minLSTReceivedAsPerTruePrice}, minLSTReceived: ${minLSTReceived}`);
|
|
733
734
|
|
|
734
735
|
// is withdraw
|
|
735
736
|
let maxUsedCollateral = params.debtAmount.abs().dividedBy(lstDexPriceInUnderlying).multipliedBy(1 + MAX_SLIPPAGE); // +ve for exact amount out, used for decrease
|
|
736
737
|
const maxUsedCollateralInLST = params.debtAmount.abs().dividedBy(lstTrueExchangeRate).multipliedBy(1.005); // 0.5% slippage, worst case based on true price
|
|
737
738
|
logger.verbose(`${this.getTag()}::getModifyLeverCall maxUsedCollateralInLST: ${maxUsedCollateralInLST}, maxUsedCollateral: ${maxUsedCollateral}`);
|
|
738
|
-
if (maxUsedCollateralInLST > maxUsedCollateral) {
|
|
739
|
-
|
|
740
|
-
}
|
|
739
|
+
// if (maxUsedCollateralInLST > maxUsedCollateral) {
|
|
740
|
+
// maxUsedCollateral = maxUsedCollateralInLST;
|
|
741
|
+
// }
|
|
742
|
+
maxUsedCollateral = maxUsedCollateralInLST; // in any case, we are ok with this, bcz the BTC LST spread shouldnt be high
|
|
741
743
|
|
|
742
744
|
const STEP2_ID = LST_MULTIPLIER_MANAGE_IDS.SWITCH_DELEGATION_ON;
|
|
743
745
|
const manage2Info = this.getProofs<VesuModifyDelegationCallParams>(STEP2_ID);
|