@defisaver/positions-sdk 0.0.72 → 0.0.73

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.
@@ -85,7 +85,7 @@ function getMorphoBlueMarketData(web3, network, selectedMarket, mainnetWeb3) {
85
85
  assetsData[(0, utils_1.wethToEth)(loanTokenInfo.symbol)] = {
86
86
  symbol: (0, utils_1.wethToEth)(loanTokenInfo.symbol),
87
87
  address: loanToken,
88
- price: new decimal_js_1.default(loanTokenPrice).div(1e8).toString(),
88
+ price: loanTokenInfo.symbol === 'USDA' ? '1' : new decimal_js_1.default(loanTokenPrice).div(1e8).toString(),
89
89
  supplyRate: new decimal_js_1.default(supplyRate).div(constants_1.WAD).mul(100).toString(),
90
90
  borrowRate: new decimal_js_1.default(compoundedBorrowRate).div(constants_1.WAD).mul(100).toString(),
91
91
  totalSupply: new decimal_js_1.default(marketInfo.totalSupplyAssets).div(scale).toString(),
@@ -96,7 +96,7 @@ function getMorphoBlueMarketData(web3, network, selectedMarket, mainnetWeb3) {
96
96
  assetsData[(0, utils_1.wethToEth)(collateralTokenInfo.symbol)] = {
97
97
  symbol: (0, utils_1.wethToEth)(collateralTokenInfo.symbol),
98
98
  address: collateralToken,
99
- price: new decimal_js_1.default(loanTokenPrice).div(1e8).mul(oracleRate).toString(),
99
+ price: new decimal_js_1.default(assetsData[(0, utils_1.wethToEth)(loanTokenInfo.symbol)].price).mul(oracleRate).toString(),
100
100
  supplyRate: '0',
101
101
  borrowRate: '0',
102
102
  canBeSupplied: true,
@@ -79,7 +79,7 @@ export function getMorphoBlueMarketData(web3, network, selectedMarket, mainnetWe
79
79
  assetsData[wethToEth(loanTokenInfo.symbol)] = {
80
80
  symbol: wethToEth(loanTokenInfo.symbol),
81
81
  address: loanToken,
82
- price: new Dec(loanTokenPrice).div(1e8).toString(),
82
+ price: loanTokenInfo.symbol === 'USDA' ? '1' : new Dec(loanTokenPrice).div(1e8).toString(),
83
83
  supplyRate: new Dec(supplyRate).div(WAD).mul(100).toString(),
84
84
  borrowRate: new Dec(compoundedBorrowRate).div(WAD).mul(100).toString(),
85
85
  totalSupply: new Dec(marketInfo.totalSupplyAssets).div(scale).toString(),
@@ -90,7 +90,7 @@ export function getMorphoBlueMarketData(web3, network, selectedMarket, mainnetWe
90
90
  assetsData[wethToEth(collateralTokenInfo.symbol)] = {
91
91
  symbol: wethToEth(collateralTokenInfo.symbol),
92
92
  address: collateralToken,
93
- price: new Dec(loanTokenPrice).div(1e8).mul(oracleRate).toString(),
93
+ price: new Dec(assetsData[wethToEth(loanTokenInfo.symbol)].price).mul(oracleRate).toString(),
94
94
  supplyRate: '0',
95
95
  borrowRate: '0',
96
96
  canBeSupplied: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/positions-sdk",
3
- "version": "0.0.72",
3
+ "version": "0.0.73",
4
4
  "description": "",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
@@ -93,7 +93,7 @@ export async function getMorphoBlueMarketData(web3: Web3, network: NetworkNumber
93
93
  assetsData[wethToEth(loanTokenInfo.symbol)] = {
94
94
  symbol: wethToEth(loanTokenInfo.symbol),
95
95
  address: loanToken,
96
- price: new Dec(loanTokenPrice).div(1e8).toString(),
96
+ price: loanTokenInfo.symbol === 'USDA' ? '1' : new Dec(loanTokenPrice).div(1e8).toString(),
97
97
  supplyRate: new Dec(supplyRate).div(WAD).mul(100).toString(),
98
98
  borrowRate: new Dec(compoundedBorrowRate).div(WAD).mul(100).toString(),
99
99
  totalSupply: new Dec(marketInfo.totalSupplyAssets).div(scale).toString(),
@@ -105,7 +105,7 @@ export async function getMorphoBlueMarketData(web3: Web3, network: NetworkNumber
105
105
  assetsData[wethToEth(collateralTokenInfo.symbol)] = {
106
106
  symbol: wethToEth(collateralTokenInfo.symbol),
107
107
  address: collateralToken,
108
- price: new Dec(loanTokenPrice).div(1e8).mul(oracleRate).toString(),
108
+ price: new Dec(assetsData[wethToEth(loanTokenInfo.symbol)].price).mul(oracleRate).toString(),
109
109
  supplyRate: '0',
110
110
  borrowRate: '0',
111
111
  canBeSupplied: true,