impermax-sdk 2.1.327 → 2.1.329
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.
|
@@ -35,7 +35,7 @@ class BorrowablePosition {
|
|
|
35
35
|
this.checkLock();
|
|
36
36
|
if (!relative)
|
|
37
37
|
this.reset();
|
|
38
|
-
this.borrowable.supply(amount);
|
|
38
|
+
this.borrowable.supply(amount, relative);
|
|
39
39
|
this.amount += amount;
|
|
40
40
|
}
|
|
41
41
|
withdraw(amount, relative = false) {
|
|
@@ -44,7 +44,7 @@ class BorrowablePosition {
|
|
|
44
44
|
this.reset();
|
|
45
45
|
if (amount > this.getAvailableToWithdraw())
|
|
46
46
|
throw new Error("Trying to withdraw more than available to withdraw");
|
|
47
|
-
this.borrowable.withdraw(amount);
|
|
47
|
+
this.borrowable.withdraw(amount, relative);
|
|
48
48
|
this.amount -= amount;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -40,7 +40,7 @@ class LendingVaultEntity {
|
|
|
40
40
|
for (let position of this.positions) {
|
|
41
41
|
acc += position.amount * position.borrowable.getSupplyRate();
|
|
42
42
|
}
|
|
43
|
-
return acc / this.getTotalSupply();
|
|
43
|
+
return acc / this.getTotalSupply() * (1 - this.reserveFactor);
|
|
44
44
|
}
|
|
45
45
|
getSupplyAPR() {
|
|
46
46
|
return (0, index_1.toAPR)(this.getSupplyRate());
|