@haven-fi/solauto-sdk 1.0.645 → 1.0.647
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.
@@ -90,7 +90,7 @@ function swapThenDeposit(client, depositMint, depositAmountBaseUnit) {
|
|
90
90
|
outputMint: client.pos.supplyMint,
|
91
91
|
amount: depositAmountBaseUnit,
|
92
92
|
exactIn: true,
|
93
|
-
slippageBps: memeSwap ?
|
93
|
+
slippageBps: memeSwap ? 250 : 100,
|
94
94
|
};
|
95
95
|
const jupSwapManager = new services_1.JupSwapManager(client.signer);
|
96
96
|
const { setupIx, swapIx, cleanupIx, lookupTableAddresses } = await jupSwapManager.getJupSwapTxData({
|
@@ -120,7 +120,7 @@ function getMaxLiqUtilizationRateBps(maxLtvBps, liqThresholdBps, offsetFromMaxLt
|
|
120
120
|
1); // -1 to account for any rounding issues
|
121
121
|
}
|
122
122
|
function maxRepayFromBps(maxLtvBps, liqThresholdBps) {
|
123
|
-
return Math.min(
|
123
|
+
return Math.min(8750, getMaxLiqUtilizationRateBps(maxLtvBps, liqThresholdBps - 1000, constants_1.OFFSET_FROM_MAX_LTV));
|
124
124
|
}
|
125
125
|
function maxRepayToBps(maxLtvBps, liqThresholdBps) {
|
126
126
|
return Math.min(maxRepayFromBps(maxLtvBps, liqThresholdBps) - constants_1.MIN_REPAY_GAP_BPS, getMaxLiqUtilizationRateBps(maxLtvBps, liqThresholdBps, constants_1.OFFSET_FROM_MAX_LTV));
|
package/package.json
CHANGED
@@ -145,7 +145,7 @@ export function swapThenDeposit(
|
|
145
145
|
outputMint: client.pos.supplyMint,
|
146
146
|
amount: depositAmountBaseUnit,
|
147
147
|
exactIn: true,
|
148
|
-
slippageBps: memeSwap ?
|
148
|
+
slippageBps: memeSwap ? 250 : 100,
|
149
149
|
};
|
150
150
|
const jupSwapManager = new JupSwapManager(client.signer);
|
151
151
|
const { setupIx, swapIx, cleanupIx, lookupTableAddresses } =
|
package/src/utils/numberUtils.ts
CHANGED
@@ -168,7 +168,7 @@ export function getMaxLiqUtilizationRateBps(
|
|
168
168
|
|
169
169
|
export function maxRepayFromBps(maxLtvBps: number, liqThresholdBps: number) {
|
170
170
|
return Math.min(
|
171
|
-
|
171
|
+
8750,
|
172
172
|
getMaxLiqUtilizationRateBps(maxLtvBps, liqThresholdBps - 1000, OFFSET_FROM_MAX_LTV)
|
173
173
|
);
|
174
174
|
}
|