@carrot-protocol/clend-vaults-rpc 0.0.33-return-execution-data-dev-7bf4608 → 0.0.33-return-execution-data-dev-fb1bdf1
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 +2 -2
- package/package.json +1 -1
package/dist/rpc.js
CHANGED
|
@@ -722,9 +722,9 @@ class ClendVaultsClient {
|
|
|
722
722
|
const clendGroup = clendAccountState.group;
|
|
723
723
|
// --- Helper to clamp borrow amount based on liquidity ---
|
|
724
724
|
const clampBorrowAmount = (idealBorrowAmount, bankData, decimals) => {
|
|
725
|
-
const targetUtilFactor = 0.9; //
|
|
725
|
+
const targetUtilFactor = 0.9; // 90% utilization cap
|
|
726
726
|
const availableSupplyBN = bankData.availableSupply;
|
|
727
|
-
// Calculate max safe borrow: availableSupply * 0.
|
|
727
|
+
// Calculate max safe borrow: availableSupply * 0.90
|
|
728
728
|
// Using floating point for the factor multiplication, then back to BN
|
|
729
729
|
const availableSupplyUi = (0, math_1.amountToUi)(availableSupplyBN, decimals);
|
|
730
730
|
const maxSafeBorrowUi = availableSupplyUi * targetUtilFactor;
|
package/package.json
CHANGED