impermax-sdk 2.1.274 → 2.1.275

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.
@@ -4,7 +4,6 @@ import OffchainAccountCollateral from "./offchainAccountCollateral";
4
4
  import OffchainAccountBorrowable from "./offchainAccountBorrowable";
5
5
  import { LendingPoolPosition } from "../../offchainTypes";
6
6
  import OffchainLendingPool from "../../lendingPool";
7
- import OffchainLeveragedPosition from "./offchainLeveragedPosition";
8
7
  export default abstract class OffchainAccountLendingPool {
9
8
  protected readonly account: OffchainAccount;
10
9
  protected readonly lendingPool: OffchainLendingPool;
@@ -17,7 +16,6 @@ export default abstract class OffchainAccountLendingPool {
17
16
  protected abstract getNewBorrowableObject(borrowable: Borrowable): OffchainAccountBorrowable;
18
17
  constructor(account: OffchainAccount, lendingPool: OffchainLendingPool);
19
18
  abstract getLendingPoolPosition(): Promise<LendingPoolPosition | undefined>;
20
- abstract getLeveragedAPR(tokenId?: number): Promise<number>;
21
19
  getAccount: () => OffchainAccount;
22
20
  getLendingPool: () => OffchainLendingPool;
23
21
  getBorrowable: (borrowable: Borrowable) => OffchainAccountBorrowable;
@@ -28,7 +26,4 @@ export default abstract class OffchainAccountLendingPool {
28
26
  protected getId: () => any;
29
27
  getSafetyMargin: () => Promise<number>;
30
28
  getLiquidationPenalty: () => Promise<number>;
31
- getLeveragedPositions(): Promise<Array<OffchainLeveragedPosition>>;
32
- getLeveragedPositionsTotalBalanceUSD(): Promise<number>;
33
- getLeveragedPositionsNetAPR(): Promise<number>;
34
29
  }
@@ -22,14 +22,5 @@ class OffchainAccountLendingPool {
22
22
  [types_1.Borrowable.B]: this.getNewBorrowableObject(types_1.Borrowable.B),
23
23
  };
24
24
  }
25
- async getLeveragedPositions() {
26
- return [];
27
- }
28
- async getLeveragedPositionsTotalBalanceUSD() {
29
- return 1;
30
- }
31
- async getLeveragedPositionsNetAPR() {
32
- return 1;
33
- }
34
25
  }
35
26
  exports.default = OffchainAccountLendingPool;
@@ -2,7 +2,6 @@ import OffchainAccount from "../index";
2
2
  import { Borrowable } from "../../../config/types";
3
3
  import { SupplyPosition } from "../../offchainTypes";
4
4
  import OffchainLendingPool from "../../lendingPool";
5
- import OffchainLeveragedPosition from "./offchainLeveragedPosition";
6
5
  import OffchainAccountLendingPool from "./offchainAccountLendingPool";
7
6
  import OffchainAccountCollateralV2 from "./offchainAccountCollateralV2";
8
7
  import OffchainAccountBorrowableV2 from "./offchainAccountBorrowableV2";
@@ -37,8 +36,4 @@ export default class OffchainAccountLendingPoolV2 extends OffchainAccountLending
37
36
  borrowable1: import("../../offchainTypes").BorrowPosition | undefined;
38
37
  };
39
38
  } | undefined>;
40
- getLeveragedAPR(): Promise<number>;
41
- getLeveragedPositions(): Promise<Array<OffchainLeveragedPosition>>;
42
- getLeveragedPositionsTotalBalanceUSD(): Promise<number>;
43
- getLeveragedPositionsNetAPR(): Promise<number>;
44
39
  }
@@ -57,25 +57,5 @@ class OffchainAccountLendingPoolV2 extends offchainAccountLendingPool_1.default
57
57
  },
58
58
  };
59
59
  }
60
- /*--------------------------------------------------------------------------*
61
- * Position APR *
62
- *--------------------------------------------------------------------------*/
63
- // NOTE: Should this be moved directly to position object?
64
- async getLeveragedAPR() {
65
- const baseAPR = await this.getLendingPool().getTotalAPR();
66
- const leverage = (await this.getCollateral().getPositionObject()).getLeverage();
67
- const borrowApr0 = await this.getLendingPool().getBorrowableA().getBorrowAPR();
68
- const borrowApr1 = await this.getLendingPool().getBorrowableB().getBorrowAPR();
69
- return baseAPR * leverage - (borrowApr0 + borrowApr1) / 2 * (leverage - 1);
70
- }
71
- async getLeveragedPositions() {
72
- return [];
73
- }
74
- async getLeveragedPositionsTotalBalanceUSD() {
75
- return 1;
76
- }
77
- async getLeveragedPositionsNetAPR() {
78
- return 1;
79
- }
80
60
  }
81
61
  exports.default = OffchainAccountLendingPoolV2;
@@ -1,7 +1,6 @@
1
1
  import OffchainAccount from "../index";
2
2
  import { Borrowable } from "../../../config/types";
3
3
  import OffchainLendingPool from "../../lendingPool";
4
- import OffchainLeveragedPosition from "./offchainLeveragedPosition";
5
4
  import OffchainAccountLendingPool from "./offchainAccountLendingPool";
6
5
  import OffchainLendingPoolV3 from "../../lendingPool/offchainLendingPoolV3";
7
6
  import OffchainAccountCollateralV3 from "./offchainAccountCollateralV3";
@@ -35,8 +34,4 @@ export default class OffchainAccountLendingPoolV3 extends OffchainAccountLending
35
34
  positions: Record<string, NftlpPosition> | undefined;
36
35
  } | undefined>;
37
36
  getTokenIds(): Promise<(string | undefined)[]>;
38
- getLeveragedAPR(tokenId: number): Promise<number>;
39
- getLeveragedPositions(): Promise<Array<OffchainLeveragedPosition>>;
40
- getLeveragedPositionsTotalBalanceUSD(): Promise<number>;
41
- getLeveragedPositionsNetAPR(): Promise<number>;
42
37
  }
@@ -64,22 +64,5 @@ class OffchainAccountLendingPoolV3 extends offchainAccountLendingPool_1.default
64
64
  const positions = userData[factory]?.positions?.[pairAddress] || [];
65
65
  return positions.map(pos => pos.tokenId);
66
66
  }
67
- /*--------------------------------------------------------------------------*
68
- * Position APR *
69
- *--------------------------------------------------------------------------*/
70
- // TODO: CL APR
71
- // NOTE: Should this be moved directly to position object?
72
- async getLeveragedAPR(tokenId) {
73
- return 0;
74
- }
75
- async getLeveragedPositions() {
76
- return [];
77
- }
78
- async getLeveragedPositionsTotalBalanceUSD() {
79
- return 1;
80
- }
81
- async getLeveragedPositionsNetAPR() {
82
- return 1;
83
- }
84
67
  }
85
68
  exports.default = OffchainAccountLendingPoolV3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "2.1.274",
3
+ "version": "2.1.275",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",