@defisaver/positions-sdk 0.0.166-dev3-liquity-v2 → 0.0.166-dev4-liquity-v2

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.
@@ -82,6 +82,7 @@ const getLiquityV2TroveData = (web3, network, { selectedMarket, assetsData, mark
82
82
  borrowedUsd: '0',
83
83
  isBorrowed: false,
84
84
  isSupplied: true,
85
+ collateral: true,
85
86
  };
86
87
  const collRatio = new decimal_js_1.default(data.TCRatio).div(1e16).toString();
87
88
  const interestRate = new decimal_js_1.default(data.annualInterestRate).div(1e16).toString();
@@ -27,7 +27,7 @@ const calcLeverageLiqPrice = (leverageType, assetPrice, borrowedUsd, borrowLimit
27
27
  exports.calcLeverageLiqPrice = calcLeverageLiqPrice;
28
28
  const calculateBorrowingAssetLimit = (assetBorrowedUsd, borrowLimitUsd) => new decimal_js_1.default(assetBorrowedUsd).div(borrowLimitUsd).times(100).toString();
29
29
  exports.calculateBorrowingAssetLimit = calculateBorrowingAssetLimit;
30
- exports.STABLE_ASSETS = ['DAI', 'USDC', 'USDT', 'TUSD', 'USDP', 'GUSD', 'BUSD', 'SUSD', 'FRAX', 'LUSD', 'USDC.e', 'GHO', 'sDAI', 'crvUSD'];
30
+ exports.STABLE_ASSETS = ['DAI', 'USDC', 'USDT', 'TUSD', 'USDP', 'GUSD', 'BUSD', 'SUSD', 'FRAX', 'LUSD', 'USDC.e', 'GHO', 'sDAI', 'crvUSD', 'BOLD'];
31
31
  const isLeveragedPos = (usedAssets, dustLimit = 5) => {
32
32
  let borrowUnstable = 0;
33
33
  let supplyStable = 0;
@@ -39,6 +39,7 @@ export interface LiquityV2UsedAsset {
39
39
  symbol: string;
40
40
  address: string;
41
41
  price: string;
42
+ collateral?: boolean;
42
43
  supplied: string;
43
44
  suppliedUsd: string;
44
45
  borrowed: string;
@@ -75,6 +75,7 @@ export const getLiquityV2TroveData = (web3, network, { selectedMarket, assetsDat
75
75
  borrowedUsd: '0',
76
76
  isBorrowed: false,
77
77
  isSupplied: true,
78
+ collateral: true,
78
79
  };
79
80
  const collRatio = new Dec(data.TCRatio).div(1e16).toString();
80
81
  const interestRate = new Dec(data.annualInterestRate).div(1e16).toString();
@@ -16,7 +16,7 @@ export const calcLeverageLiqPrice = (leverageType, assetPrice, borrowedUsd, borr
16
16
  return '0';
17
17
  };
18
18
  export const calculateBorrowingAssetLimit = (assetBorrowedUsd, borrowLimitUsd) => new Dec(assetBorrowedUsd).div(borrowLimitUsd).times(100).toString();
19
- export const STABLE_ASSETS = ['DAI', 'USDC', 'USDT', 'TUSD', 'USDP', 'GUSD', 'BUSD', 'SUSD', 'FRAX', 'LUSD', 'USDC.e', 'GHO', 'sDAI', 'crvUSD'];
19
+ export const STABLE_ASSETS = ['DAI', 'USDC', 'USDT', 'TUSD', 'USDP', 'GUSD', 'BUSD', 'SUSD', 'FRAX', 'LUSD', 'USDC.e', 'GHO', 'sDAI', 'crvUSD', 'BOLD'];
20
20
  export const isLeveragedPos = (usedAssets, dustLimit = 5) => {
21
21
  let borrowUnstable = 0;
22
22
  let supplyStable = 0;
@@ -39,6 +39,7 @@ export interface LiquityV2UsedAsset {
39
39
  symbol: string;
40
40
  address: string;
41
41
  price: string;
42
+ collateral?: boolean;
42
43
  supplied: string;
43
44
  suppliedUsd: string;
44
45
  borrowed: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/positions-sdk",
3
- "version": "0.0.166-dev3-liquity-v2",
3
+ "version": "0.0.166-dev4-liquity-v2",
4
4
  "description": "",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
@@ -93,6 +93,7 @@ export const getLiquityV2TroveData = async (
93
93
  borrowedUsd: '0',
94
94
  isBorrowed: false,
95
95
  isSupplied: true,
96
+ collateral: true,
96
97
  };
97
98
 
98
99
  const collRatio = new Dec(data.TCRatio).div(1e16).toString();
@@ -20,7 +20,7 @@ export const calcLeverageLiqPrice = (leverageType: string, assetPrice: string, b
20
20
 
21
21
  export const calculateBorrowingAssetLimit = (assetBorrowedUsd: string, borrowLimitUsd: string) => new Dec(assetBorrowedUsd).div(borrowLimitUsd).times(100).toString();
22
22
 
23
- export const STABLE_ASSETS = ['DAI', 'USDC', 'USDT', 'TUSD', 'USDP', 'GUSD', 'BUSD', 'SUSD', 'FRAX', 'LUSD', 'USDC.e', 'GHO', 'sDAI', 'crvUSD'];
23
+ export const STABLE_ASSETS = ['DAI', 'USDC', 'USDT', 'TUSD', 'USDP', 'GUSD', 'BUSD', 'SUSD', 'FRAX', 'LUSD', 'USDC.e', 'GHO', 'sDAI', 'crvUSD', 'BOLD'];
24
24
 
25
25
  export const isLeveragedPos = (usedAssets: MMUsedAssets, dustLimit = 5) => {
26
26
  let borrowUnstable = 0;
@@ -44,6 +44,7 @@ export interface LiquityV2UsedAsset {
44
44
  symbol: string,
45
45
  address: string,
46
46
  price: string,
47
+ collateral?: boolean,
47
48
  supplied: string,
48
49
  suppliedUsd: string,
49
50
  borrowed: string,