@defisaver/positions-sdk 2.1.40 → 2.1.42
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.
- package/cjs/savings/morphoVaults/options.js +1 -1
- package/cjs/spark/index.js +7 -5
- package/cjs/types/spark.d.ts +1 -0
- package/esm/savings/morphoVaults/options.js +1 -1
- package/esm/spark/index.js +7 -5
- package/esm/types/spark.d.ts +1 -0
- package/package.json +1 -1
- package/src/savings/morphoVaults/options.ts +1 -1
- package/src/spark/index.ts +7 -5
- package/src/types/spark.ts +1 -0
|
@@ -102,7 +102,7 @@ exports.MORPHO_VAULT_STEAKHOUSE_USDT = {
|
|
|
102
102
|
exports.MORPHO_VAULT_STEAKHOUSE_USDC = {
|
|
103
103
|
type: types_1.MorphoVaultType.MorphoVaultSteakhouseUSDC,
|
|
104
104
|
name: 'Steakhouse USDC',
|
|
105
|
-
address: '
|
|
105
|
+
address: '0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB',
|
|
106
106
|
asset: 'USDC',
|
|
107
107
|
deploymentBlock: 18928285,
|
|
108
108
|
isLegacy: false,
|
package/cjs/spark/index.js
CHANGED
|
@@ -78,21 +78,22 @@ const _getSparkMarketsData = (provider, network, selectedMarket) => __awaiter(vo
|
|
|
78
78
|
if (new decimal_js_1.default(marketLiquidity).lt(0)) {
|
|
79
79
|
marketLiquidity = '0';
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
const emodeCategoryId = +market.emodeCategory.toString();
|
|
82
|
+
eModeCategoriesData[emodeCategoryId] = {
|
|
83
|
+
id: emodeCategoryId,
|
|
83
84
|
label: market.label,
|
|
84
85
|
liquidationBonus: new decimal_js_1.default(market.liquidationBonus).div(10000).toString(),
|
|
85
86
|
liquidationRatio: new decimal_js_1.default(market.liquidationThreshold).div(10000).toString(),
|
|
86
87
|
collateralFactor: new decimal_js_1.default(market.ltv).div(10000).toString(),
|
|
87
|
-
collateralAssets: eModeCategoriesData[
|
|
88
|
-
borrowAssets: eModeCategoriesData[
|
|
88
|
+
collateralAssets: eModeCategoriesData[emodeCategoryId] ? [...eModeCategoriesData[emodeCategoryId].collateralAssets, selectedMarket.assets[i]] : [selectedMarket.assets[i]],
|
|
89
|
+
borrowAssets: eModeCategoriesData[emodeCategoryId] ? [...eModeCategoriesData[emodeCategoryId].borrowAssets, selectedMarket.assets[i]] : [selectedMarket.assets[i]],
|
|
89
90
|
};
|
|
90
91
|
return ({
|
|
91
92
|
symbol: selectedMarket.assets[i],
|
|
92
93
|
isIsolated: new decimal_js_1.default(market.debtCeilingForIsolationMode.toString()).gt(0),
|
|
93
94
|
debtCeilingForIsolationMode: new decimal_js_1.default(market.debtCeilingForIsolationMode.toString()).div(100).toString(),
|
|
94
95
|
isSiloed: market.isSiloedForBorrowing,
|
|
95
|
-
eModeCategory:
|
|
96
|
+
eModeCategory: emodeCategoryId,
|
|
96
97
|
isolationModeTotalDebt: new decimal_js_1.default(market.isolationModeTotalDebt.toString()).div(100).toString(),
|
|
97
98
|
assetId: Number(market.assetId),
|
|
98
99
|
underlyingTokenAddress: market.underlyingTokenAddress,
|
|
@@ -100,6 +101,7 @@ const _getSparkMarketsData = (provider, network, selectedMarket) => __awaiter(vo
|
|
|
100
101
|
borrowRate: (0, moneymarket_1.aprToApy)(new decimal_js_1.default(market.borrowRateVariable.toString()).div(1e25).toString()),
|
|
101
102
|
borrowRateStable: (0, moneymarket_1.aprToApy)(new decimal_js_1.default(market.borrowRateStable.toString()).div(1e25).toString()),
|
|
102
103
|
collateralFactor: new decimal_js_1.default(market.collateralFactor.toString()).div(10000).toString(),
|
|
104
|
+
liquidationBonus: eModeCategoriesData[emodeCategoryId].liquidationBonus,
|
|
103
105
|
liquidationRatio: new decimal_js_1.default(market.liquidationRatio.toString()).div(10000).toString(),
|
|
104
106
|
marketLiquidity,
|
|
105
107
|
utilization: new decimal_js_1.default(market.totalBorrow.toString()).times(100).div(new decimal_js_1.default(market.totalSupply.toString())).toString(),
|
package/cjs/types/spark.d.ts
CHANGED
|
@@ -99,7 +99,7 @@ export const MORPHO_VAULT_STEAKHOUSE_USDT = {
|
|
|
99
99
|
export const MORPHO_VAULT_STEAKHOUSE_USDC = {
|
|
100
100
|
type: MorphoVaultType.MorphoVaultSteakhouseUSDC,
|
|
101
101
|
name: 'Steakhouse USDC',
|
|
102
|
-
address: '
|
|
102
|
+
address: '0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB',
|
|
103
103
|
asset: 'USDC',
|
|
104
104
|
deploymentBlock: 18928285,
|
|
105
105
|
isLegacy: false,
|
package/esm/spark/index.js
CHANGED
|
@@ -71,21 +71,22 @@ export const _getSparkMarketsData = (provider, network, selectedMarket) => __awa
|
|
|
71
71
|
if (new Dec(marketLiquidity).lt(0)) {
|
|
72
72
|
marketLiquidity = '0';
|
|
73
73
|
}
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
const emodeCategoryId = +market.emodeCategory.toString();
|
|
75
|
+
eModeCategoriesData[emodeCategoryId] = {
|
|
76
|
+
id: emodeCategoryId,
|
|
76
77
|
label: market.label,
|
|
77
78
|
liquidationBonus: new Dec(market.liquidationBonus).div(10000).toString(),
|
|
78
79
|
liquidationRatio: new Dec(market.liquidationThreshold).div(10000).toString(),
|
|
79
80
|
collateralFactor: new Dec(market.ltv).div(10000).toString(),
|
|
80
|
-
collateralAssets: eModeCategoriesData[
|
|
81
|
-
borrowAssets: eModeCategoriesData[
|
|
81
|
+
collateralAssets: eModeCategoriesData[emodeCategoryId] ? [...eModeCategoriesData[emodeCategoryId].collateralAssets, selectedMarket.assets[i]] : [selectedMarket.assets[i]],
|
|
82
|
+
borrowAssets: eModeCategoriesData[emodeCategoryId] ? [...eModeCategoriesData[emodeCategoryId].borrowAssets, selectedMarket.assets[i]] : [selectedMarket.assets[i]],
|
|
82
83
|
};
|
|
83
84
|
return ({
|
|
84
85
|
symbol: selectedMarket.assets[i],
|
|
85
86
|
isIsolated: new Dec(market.debtCeilingForIsolationMode.toString()).gt(0),
|
|
86
87
|
debtCeilingForIsolationMode: new Dec(market.debtCeilingForIsolationMode.toString()).div(100).toString(),
|
|
87
88
|
isSiloed: market.isSiloedForBorrowing,
|
|
88
|
-
eModeCategory:
|
|
89
|
+
eModeCategory: emodeCategoryId,
|
|
89
90
|
isolationModeTotalDebt: new Dec(market.isolationModeTotalDebt.toString()).div(100).toString(),
|
|
90
91
|
assetId: Number(market.assetId),
|
|
91
92
|
underlyingTokenAddress: market.underlyingTokenAddress,
|
|
@@ -93,6 +94,7 @@ export const _getSparkMarketsData = (provider, network, selectedMarket) => __awa
|
|
|
93
94
|
borrowRate: aprToApy(new Dec(market.borrowRateVariable.toString()).div(1e25).toString()),
|
|
94
95
|
borrowRateStable: aprToApy(new Dec(market.borrowRateStable.toString()).div(1e25).toString()),
|
|
95
96
|
collateralFactor: new Dec(market.collateralFactor.toString()).div(10000).toString(),
|
|
97
|
+
liquidationBonus: eModeCategoriesData[emodeCategoryId].liquidationBonus,
|
|
96
98
|
liquidationRatio: new Dec(market.liquidationRatio.toString()).div(10000).toString(),
|
|
97
99
|
marketLiquidity,
|
|
98
100
|
utilization: new Dec(market.totalBorrow.toString()).times(100).div(new Dec(market.totalSupply.toString())).toString(),
|
package/esm/types/spark.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -113,7 +113,7 @@ export const MORPHO_VAULT_STEAKHOUSE_USDT: MorphoVault = {
|
|
|
113
113
|
export const MORPHO_VAULT_STEAKHOUSE_USDC: MorphoVault = {
|
|
114
114
|
type: MorphoVaultType.MorphoVaultSteakhouseUSDC,
|
|
115
115
|
name: 'Steakhouse USDC',
|
|
116
|
-
address: '
|
|
116
|
+
address: '0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB',
|
|
117
117
|
asset: 'USDC',
|
|
118
118
|
deploymentBlock: 18928285,
|
|
119
119
|
isLegacy: false,
|
package/src/spark/index.ts
CHANGED
|
@@ -98,14 +98,15 @@ export const _getSparkMarketsData = async (provider: Client, network: NetworkNum
|
|
|
98
98
|
marketLiquidity = '0';
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
const emodeCategoryId = +market.emodeCategory.toString();
|
|
102
|
+
eModeCategoriesData[emodeCategoryId] = {
|
|
103
|
+
id: emodeCategoryId,
|
|
103
104
|
label: market.label,
|
|
104
105
|
liquidationBonus: new Dec(market.liquidationBonus).div(10000).toString(),
|
|
105
106
|
liquidationRatio: new Dec(market.liquidationThreshold).div(10000).toString(),
|
|
106
107
|
collateralFactor: new Dec(market.ltv).div(10000).toString(),
|
|
107
|
-
collateralAssets: eModeCategoriesData[
|
|
108
|
-
borrowAssets: eModeCategoriesData[
|
|
108
|
+
collateralAssets: eModeCategoriesData[emodeCategoryId] ? [...eModeCategoriesData[emodeCategoryId].collateralAssets, selectedMarket.assets[i]] : [selectedMarket.assets[i]],
|
|
109
|
+
borrowAssets: eModeCategoriesData[emodeCategoryId] ? [...eModeCategoriesData[emodeCategoryId].borrowAssets, selectedMarket.assets[i]] : [selectedMarket.assets[i]],
|
|
109
110
|
};
|
|
110
111
|
|
|
111
112
|
return ({
|
|
@@ -113,7 +114,7 @@ export const _getSparkMarketsData = async (provider: Client, network: NetworkNum
|
|
|
113
114
|
isIsolated: new Dec(market.debtCeilingForIsolationMode.toString()).gt(0),
|
|
114
115
|
debtCeilingForIsolationMode: new Dec(market.debtCeilingForIsolationMode.toString()).div(100).toString(),
|
|
115
116
|
isSiloed: market.isSiloedForBorrowing,
|
|
116
|
-
eModeCategory:
|
|
117
|
+
eModeCategory: emodeCategoryId,
|
|
117
118
|
isolationModeTotalDebt: new Dec(market.isolationModeTotalDebt.toString()).div(100).toString(),
|
|
118
119
|
assetId: Number(market.assetId),
|
|
119
120
|
underlyingTokenAddress: market.underlyingTokenAddress,
|
|
@@ -121,6 +122,7 @@ export const _getSparkMarketsData = async (provider: Client, network: NetworkNum
|
|
|
121
122
|
borrowRate: aprToApy(new Dec(market.borrowRateVariable.toString()).div(1e25).toString()),
|
|
122
123
|
borrowRateStable: aprToApy(new Dec(market.borrowRateStable.toString()).div(1e25).toString()),
|
|
123
124
|
collateralFactor: new Dec(market.collateralFactor.toString()).div(10000).toString(),
|
|
125
|
+
liquidationBonus: eModeCategoriesData[emodeCategoryId].liquidationBonus,
|
|
124
126
|
liquidationRatio: new Dec(market.liquidationRatio.toString()).div(10000).toString(),
|
|
125
127
|
marketLiquidity,
|
|
126
128
|
utilization: new Dec(market.totalBorrow.toString()).times(100).div(new Dec(market.totalSupply.toString())).toString(),
|