@morpho-org/blue-sdk 1.7.2 → 1.7.3
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.
|
@@ -22,7 +22,7 @@ var MarketUtils;
|
|
|
22
22
|
market.collateralToken.substring(2).toLowerCase().padStart(64, "0") +
|
|
23
23
|
market.oracle.substring(2).padStart(64, "0") +
|
|
24
24
|
market.irm.substring(2).toLowerCase().padStart(64, "0") +
|
|
25
|
-
market.lltv.toString(16).padStart(64, "0")).toString("hex")}`;
|
|
25
|
+
BigInt(market.lltv).toString(16).padStart(64, "0")).toString("hex")}`;
|
|
26
26
|
}
|
|
27
27
|
MarketUtils.getMarketId = getMarketId;
|
|
28
28
|
/**
|
|
@@ -121,8 +121,11 @@ var AdaptiveCurveIrmLib;
|
|
|
121
121
|
rateAtTarget = BigInt(rateAtTarget);
|
|
122
122
|
if (borrowRate >= rateAtTarget) {
|
|
123
123
|
const maxBorrowRate = MathLib_1.MathLib.wMulDown(rateAtTarget, AdaptiveCurveIrmLib.CURVE_STEEPNESS);
|
|
124
|
+
const diffToMaxBorrowRate = maxBorrowRate - rateAtTarget;
|
|
125
|
+
if (diffToMaxBorrowRate === 0n)
|
|
126
|
+
return MathLib_1.MathLib.WAD;
|
|
124
127
|
return MathLib_1.MathLib.min(MathLib_1.MathLib.WAD, AdaptiveCurveIrmLib.TARGET_UTILIZATION +
|
|
125
|
-
MathLib_1.MathLib.mulDivDown(MathLib_1.MathLib.WAD - AdaptiveCurveIrmLib.TARGET_UTILIZATION, borrowRate - rateAtTarget,
|
|
128
|
+
MathLib_1.MathLib.mulDivDown(MathLib_1.MathLib.WAD - AdaptiveCurveIrmLib.TARGET_UTILIZATION, borrowRate - rateAtTarget, diffToMaxBorrowRate));
|
|
126
129
|
}
|
|
127
130
|
const minBorrowRate = MathLib_1.MathLib.wDivDown(rateAtTarget, AdaptiveCurveIrmLib.CURVE_STEEPNESS);
|
|
128
131
|
return MathLib_1.MathLib.max(0n, MathLib_1.MathLib.mulDivDown(AdaptiveCurveIrmLib.TARGET_UTILIZATION, borrowRate - minBorrowRate, rateAtTarget - minBorrowRate));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morpho-org/blue-sdk",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
4
4
|
"author": "Morpho Association <contact@morpho.org>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"keccak256": "^1.0.6"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@morpho-org/morpho-test": "^1.7.
|
|
20
|
-
"@morpho-org/morpho-ts": "^1.7.
|
|
19
|
+
"@morpho-org/morpho-test": "^1.7.3",
|
|
20
|
+
"@morpho-org/morpho-ts": "^1.7.3",
|
|
21
21
|
"@types/jest": "^29.5.12",
|
|
22
22
|
"@types/node": "^22.1.0",
|
|
23
23
|
"jest": "^29.7.0",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"typescript": "^5.4.5"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@morpho-org/morpho-ts": "^1.7.
|
|
28
|
+
"@morpho-org/morpho-ts": "^1.7.3"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
],
|
|
50
50
|
"preset": "ts-jest"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "9084b3dbc30b38d90bb118f7e503110ba148eb51"
|
|
53
53
|
}
|