@crypticdot/defituna-client 3.1.14 → 3.1.15
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 +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10429,7 +10429,7 @@ function getDecreaseSpotPositionQuote(args) {
|
|
|
10429
10429
|
const increaseAmount = decreaseAmountInPositionToken - positionAmount;
|
|
10430
10430
|
if (positionToken == collateralToken) {
|
|
10431
10431
|
estimatedAmount = BigInt(Math.floor(Number(increaseAmount) * positionToOppositeTokenPrice));
|
|
10432
|
-
borrow = BigInt(Math.floor(Number(increaseAmount) * (leverage - 1)
|
|
10432
|
+
borrow = BigInt(Math.floor(Number(increaseAmount) * (leverage - 1) / leverage));
|
|
10433
10433
|
const borrowWithFeesApplied = (0, import_fusionamm_core4.tryApplySwapFee)(applyTunaProtocolFee(borrow, protocolFeeRate), fusionPool.feeRate);
|
|
10434
10434
|
collateral = increaseAmount - borrowWithFeesApplied;
|
|
10435
10435
|
if (positionDebt > 0) {
|
package/dist/index.mjs
CHANGED
|
@@ -10599,7 +10599,7 @@ function getDecreaseSpotPositionQuote(args) {
|
|
|
10599
10599
|
const increaseAmount = decreaseAmountInPositionToken - positionAmount;
|
|
10600
10600
|
if (positionToken == collateralToken) {
|
|
10601
10601
|
estimatedAmount = BigInt(Math.floor(Number(increaseAmount) * positionToOppositeTokenPrice));
|
|
10602
|
-
borrow = BigInt(Math.floor(Number(increaseAmount) * (leverage - 1)
|
|
10602
|
+
borrow = BigInt(Math.floor(Number(increaseAmount) * (leverage - 1) / leverage));
|
|
10603
10603
|
const borrowWithFeesApplied = tryApplySwapFee2(applyTunaProtocolFee(borrow, protocolFeeRate), fusionPool.feeRate);
|
|
10604
10604
|
collateral = increaseAmount - borrowWithFeesApplied;
|
|
10605
10605
|
if (positionDebt > 0) {
|
package/package.json
CHANGED