@defisaver/positions-sdk 1.0.11-fluid-dev7 → 1.0.11-fluid-dev9

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.
@@ -206,6 +206,7 @@ const parseT1MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
206
206
  liquidationMaxLimit,
207
207
  borrowRate,
208
208
  supplyRate,
209
+ oraclePrice,
209
210
  };
210
211
  return {
211
212
  assetsData,
@@ -281,6 +282,7 @@ const parseT2MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
281
282
  const totalSupplySharesInVault = (0, tokens_1.assetAmountInEth)(data.totalSupplyVault);
282
283
  const collSharePrice = new decimal_js_1.default(oraclePrice).mul(prices[debtAsset.address]).toString();
283
284
  const totalSupplyVaultUsd = new decimal_js_1.default(totalSupplySharesInVault).mul(collSharePrice).toString();
285
+ const maxSupplySharesUsd = new decimal_js_1.default(maxSupplyShares).mul(collSharePrice).toString();
284
286
  const withdrawableUSD = new decimal_js_1.default(withdrawableShares).mul(collSharePrice).toString();
285
287
  const marketData = {
286
288
  vaultId: +data.vaultId,
@@ -322,7 +324,9 @@ const parseT2MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
322
324
  withdrawable: withdrawableShares,
323
325
  widthdrawableDex: new decimal_js_1.default(maxSupplyShares).minus(totalSupplyShares).toString(),
324
326
  maxSupplyShares,
327
+ maxSupplySharesUsd,
325
328
  collDexFee: supplyDexFee,
329
+ oraclePrice,
326
330
  };
327
331
  return {
328
332
  assetsData,
@@ -438,6 +442,7 @@ const parseT3MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
438
442
  maxBorrowSharesUsd,
439
443
  borrowDexFee,
440
444
  debtSharePrice,
445
+ oraclePrice,
441
446
  };
442
447
  return {
443
448
  assetsData,
@@ -589,6 +594,7 @@ const parseT4MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
589
594
  collDexFee: supplyDexFee,
590
595
  collSharePrice,
591
596
  debtSharePrice,
597
+ oraclePrice,
592
598
  };
593
599
  return {
594
600
  assetsData,
@@ -240,6 +240,7 @@ export interface InnerFluidMarketData {
240
240
  supplyRate: string;
241
241
  borrowRate: string;
242
242
  liquidationMaxLimit: string;
243
+ oraclePrice: string;
243
244
  collSharePrice?: string;
244
245
  maxSupplyShares?: string;
245
246
  maxSupplySharesUsd?: string;
@@ -200,6 +200,7 @@ const parseT1MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
200
200
  liquidationMaxLimit,
201
201
  borrowRate,
202
202
  supplyRate,
203
+ oraclePrice,
203
204
  };
204
205
  return {
205
206
  assetsData,
@@ -275,6 +276,7 @@ const parseT2MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
275
276
  const totalSupplySharesInVault = assetAmountInEth(data.totalSupplyVault);
276
277
  const collSharePrice = new Dec(oraclePrice).mul(prices[debtAsset.address]).toString();
277
278
  const totalSupplyVaultUsd = new Dec(totalSupplySharesInVault).mul(collSharePrice).toString();
279
+ const maxSupplySharesUsd = new Dec(maxSupplyShares).mul(collSharePrice).toString();
278
280
  const withdrawableUSD = new Dec(withdrawableShares).mul(collSharePrice).toString();
279
281
  const marketData = {
280
282
  vaultId: +data.vaultId,
@@ -316,7 +318,9 @@ const parseT2MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
316
318
  withdrawable: withdrawableShares,
317
319
  widthdrawableDex: new Dec(maxSupplyShares).minus(totalSupplyShares).toString(),
318
320
  maxSupplyShares,
321
+ maxSupplySharesUsd,
319
322
  collDexFee: supplyDexFee,
323
+ oraclePrice,
320
324
  };
321
325
  return {
322
326
  assetsData,
@@ -432,6 +436,7 @@ const parseT3MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
432
436
  maxBorrowSharesUsd,
433
437
  borrowDexFee,
434
438
  debtSharePrice,
439
+ oraclePrice,
435
440
  };
436
441
  return {
437
442
  assetsData,
@@ -583,6 +588,7 @@ const parseT4MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
583
588
  collDexFee: supplyDexFee,
584
589
  collSharePrice,
585
590
  debtSharePrice,
591
+ oraclePrice,
586
592
  };
587
593
  return {
588
594
  assetsData,
@@ -240,6 +240,7 @@ export interface InnerFluidMarketData {
240
240
  supplyRate: string;
241
241
  borrowRate: string;
242
242
  liquidationMaxLimit: string;
243
+ oraclePrice: string;
243
244
  collSharePrice?: string;
244
245
  maxSupplyShares?: string;
245
246
  maxSupplySharesUsd?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/positions-sdk",
3
- "version": "1.0.11-fluid-dev7",
3
+ "version": "1.0.11-fluid-dev9",
4
4
  "description": "",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
@@ -250,6 +250,7 @@ const parseT1MarketData = async (web3: Web3, data: FluidView.VaultDataStructOutp
250
250
  liquidationMaxLimit,
251
251
  borrowRate,
252
252
  supplyRate,
253
+ oraclePrice,
253
254
  };
254
255
 
255
256
  return {
@@ -360,6 +361,8 @@ const parseT2MarketData = async (web3: Web3, data: FluidView.VaultDataStructOutp
360
361
  const totalSupplySharesInVault = assetAmountInEth(data.totalSupplyVault);
361
362
  const collSharePrice = new Dec(oraclePrice).mul(prices[debtAsset.address]).toString();
362
363
  const totalSupplyVaultUsd = new Dec(totalSupplySharesInVault).mul(collSharePrice).toString();
364
+ const maxSupplySharesUsd = new Dec(maxSupplyShares).mul(collSharePrice).toString();
365
+
363
366
  const withdrawableUSD = new Dec(withdrawableShares).mul(collSharePrice).toString();
364
367
 
365
368
  const marketData = {
@@ -402,7 +405,9 @@ const parseT2MarketData = async (web3: Web3, data: FluidView.VaultDataStructOutp
402
405
  withdrawable: withdrawableShares,
403
406
  widthdrawableDex: new Dec(maxSupplyShares).minus(totalSupplyShares).toString(),
404
407
  maxSupplyShares,
408
+ maxSupplySharesUsd,
405
409
  collDexFee: supplyDexFee,
410
+ oraclePrice,
406
411
  };
407
412
 
408
413
  return {
@@ -557,6 +562,7 @@ const parseT3MarketData = async (web3: Web3, data: FluidView.VaultDataStructOutp
557
562
  maxBorrowSharesUsd,
558
563
  borrowDexFee,
559
564
  debtSharePrice,
565
+ oraclePrice,
560
566
  };
561
567
 
562
568
  return {
@@ -768,6 +774,7 @@ const parseT4MarketData = async (web3: Web3, data: FluidView.VaultDataStructOutp
768
774
  collDexFee: supplyDexFee,
769
775
  collSharePrice,
770
776
  debtSharePrice,
777
+ oraclePrice,
771
778
  };
772
779
 
773
780
  return {
@@ -251,6 +251,7 @@ export interface InnerFluidMarketData {
251
251
  supplyRate: string,
252
252
  borrowRate: string,
253
253
  liquidationMaxLimit: string,
254
+ oraclePrice: string,
254
255
  // T2 and T4 vaults
255
256
  collSharePrice?: string,
256
257
  maxSupplyShares?: string,