@carrot-protocol/clend-rpc 0.1.31-fix-ef-dev-612acf5 → 0.1.31
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/rpc.js +3 -3
- package/package.json +1 -1
package/dist/rpc.js
CHANGED
|
@@ -1443,7 +1443,7 @@ class ClendClient {
|
|
|
1443
1443
|
const { debtToRepayUi, totalCollateralToWithdrawUi } = (0, clend_common_1.computeWithdrawLeverageAmounts)(collateralAmountUI, estimatedCurrentDebtUi, desiredNetWithdrawUi, collateralPrice, debtPrice);
|
|
1444
1444
|
collateralToWithdraw = (0, clend_common_1.uiToAmount)(totalCollateralToWithdrawUi, collateralDecimals);
|
|
1445
1445
|
const baseDebtToRepay = (0, clend_common_1.uiToAmount)(debtToRepayUi, debtDecimals);
|
|
1446
|
-
const timeBufferSec =
|
|
1446
|
+
const timeBufferSec = 30;
|
|
1447
1447
|
debtToRepay = (0, clend_common_1.addInterestAccrualBuffer)(baseDebtToRepay, debtBankData.borrowApy, timeBufferSec);
|
|
1448
1448
|
if (collateralToWithdraw.gt(collateralAmount)) {
|
|
1449
1449
|
throw new Error("Total required collateral for withdrawal exceeds the available balance.");
|
|
@@ -1633,7 +1633,7 @@ class ClendClient {
|
|
|
1633
1633
|
collateralToWithdraw = (0, clend_common_1.uiToAmount)(totalCollateralToWithdrawUi, collateralDecimals);
|
|
1634
1634
|
// 5. Calculate the base debt to repay and add a buffer for interest accrual
|
|
1635
1635
|
const baseDebtToRepay = (0, clend_common_1.uiToAmount)(debtToRepayUi, debtDecimals);
|
|
1636
|
-
const timeBufferSec =
|
|
1636
|
+
const timeBufferSec = 30;
|
|
1637
1637
|
debtToRepay = (0, clend_common_1.addInterestAccrualBuffer)(baseDebtToRepay, debtBankData.borrowApy, timeBufferSec);
|
|
1638
1638
|
// 6. Final sanity check
|
|
1639
1639
|
if (collateralToWithdraw.gt(collateralAmount)) {
|
|
@@ -1785,7 +1785,7 @@ class ClendClient {
|
|
|
1785
1785
|
else {
|
|
1786
1786
|
// 1. Convert ideal UI delta (amount to repay) to BN
|
|
1787
1787
|
const baseDebtToRepay = (0, clend_common_1.uiToAmount)(idealDebtDeltaUi, debtDecimals);
|
|
1788
|
-
const timeBufferSec =
|
|
1788
|
+
const timeBufferSec = 30;
|
|
1789
1789
|
// 2. Add future interest buffer using addInterestAccrualBuffer
|
|
1790
1790
|
const finalDebtToRepayTargetBN = (0, clend_common_1.addInterestAccrualBuffer)(
|
|
1791
1791
|
// Using user's function name
|