impermax-sdk 2.1.340 → 2.1.342

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.
@@ -54,7 +54,7 @@ async function fetchBorrowersList() {
54
54
  return null;
55
55
  }
56
56
  return i.user.id;
57
- });
57
+ }).filter(a => a);
58
58
  });
59
59
  return borrowers;
60
60
  }
@@ -21,4 +21,5 @@ export default class OffchainLendingPoolV3 extends OffchainLendingPool {
21
21
  getNftlp: () => import("./nftlp").OffchainNftlp;
22
22
  getTotalAPR(): Promise<number>;
23
23
  getAmm(): Promise<Amms | null>;
24
+ getShownLeverage(): Promise<number>;
24
25
  }
@@ -35,5 +35,16 @@ class OffchainLendingPoolV3 extends offchainLendingPool_1.default {
35
35
  const nftlpData = await this.getNftlp().getNftlpData();
36
36
  return (0, amms_1.getAmmByFactory)(this.offchain.network, nftlpData.dexFactory);
37
37
  }
38
+ //Shown Leverage
39
+ async getShownLeverage() {
40
+ const safetyMargin = await this.getSafetyMargin();
41
+ if (safetyMargin < 1.25)
42
+ return 10;
43
+ if (safetyMargin < 1.51)
44
+ return 5;
45
+ if (safetyMargin < 2.01)
46
+ return 3;
47
+ return 3;
48
+ }
38
49
  }
39
50
  exports.default = OffchainLendingPoolV3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "2.1.340",
3
+ "version": "2.1.342",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",