impermax-sdk 2.1.356 → 2.1.358
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.
|
@@ -19,7 +19,7 @@ const LlamaChains = {
|
|
|
19
19
|
[types_1.Networks.Base]: "base",
|
|
20
20
|
[types_1.Networks.Mantle]: "mantle",
|
|
21
21
|
[types_1.Networks.Scroll]: "scroll",
|
|
22
|
-
[types_1.Networks.Optimism]: "
|
|
22
|
+
[types_1.Networks.Optimism]: "op mainnet",
|
|
23
23
|
[types_1.Networks.Real]: "re.al",
|
|
24
24
|
[types_1.Networks.Blast]: "blast",
|
|
25
25
|
[types_1.Networks.Sonic]: "sonic",
|
|
@@ -45,6 +45,16 @@ class LendingVaultEntity {
|
|
|
45
45
|
getSupplyAPR() {
|
|
46
46
|
return (0, index_1.toAPR)(this.getSupplyRate());
|
|
47
47
|
}
|
|
48
|
+
getUtilizationRate() {
|
|
49
|
+
let weightedUtil = 0;
|
|
50
|
+
let totalAllocated = 0;
|
|
51
|
+
// Weighted utilization rate / total deposited
|
|
52
|
+
for (let position of this.positions) {
|
|
53
|
+
weightedUtil += position.amount * position.borrowable.getUtilizationRate();
|
|
54
|
+
totalAllocated += position.amount;
|
|
55
|
+
}
|
|
56
|
+
return totalAllocated > 0 ? weightedUtil / totalAllocated : 0;
|
|
57
|
+
}
|
|
48
58
|
/**
|
|
49
59
|
* PUBLIC SETTERS
|
|
50
60
|
*/
|