@haven-fi/solauto-sdk 1.0.125 → 1.0.126

Sign up to get free protection for your applications and to get access to all the features.
@@ -417,15 +417,15 @@ class SolautoMarginfiClient extends solautoClient_1.SolautoClient {
417
417
  }
418
418
  const freshState = await (0, marginfiUtils_1.getMarginfiAccountPositionState)(this.umi, this.marginfiAccountPk, this.supplyMint, this.debtMint, this.livePositionUpdates);
419
419
  if (freshState) {
420
+ this.log("Fresh state", freshState);
420
421
  const supplyPrice = constants_1.PRICES[(freshState?.supply.mint ?? web3_js_1.PublicKey.default).toString()].price;
421
422
  const debtPrice = constants_1.PRICES[(freshState?.debt.mint ?? web3_js_1.PublicKey.default).toString()].price;
422
- console.log("Supply price: ", supplyPrice);
423
- console.log("Debt price: ", debtPrice);
424
- console.log("Fresh state", freshState);
425
- console.log("Liq threshold bps:", freshState.liqUtilizationRateBps);
426
- console.log("Liq utilization rate bps:", freshState.liqUtilizationRateBps);
427
- console.log("Supply USD:", (0, numberUtils_1.fromBaseUnit)(freshState.supply.amountUsed.baseUnit, freshState.supply.decimals) * supplyPrice);
428
- console.log("Debt USD:", (0, numberUtils_1.fromBaseUnit)(freshState.debt.amountUsed.baseUnit, freshState.supply.decimals) * debtPrice);
423
+ this.log("Supply price: ", supplyPrice);
424
+ this.log("Debt price: ", debtPrice);
425
+ this.log("Liq threshold bps:", freshState.liqThresholdBps);
426
+ this.log("Liq utilization rate bps:", freshState.liqUtilizationRateBps);
427
+ this.log("Supply USD:", (0, numberUtils_1.fromBaseUnit)(freshState.supply.amountUsed.baseUnit, freshState.supply.decimals) * supplyPrice);
428
+ this.log("Debt USD:", (0, numberUtils_1.fromBaseUnit)(freshState.debt.amountUsed.baseUnit, freshState.debt.decimals) * debtPrice);
429
429
  }
430
430
  return freshState;
431
431
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.125",
3
+ "version": "1.0.126",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "description": "Typescript SDK for the Solauto program on the Solana blockchain",
@@ -629,15 +629,15 @@ export class SolautoMarginfiClient extends SolautoClient {
629
629
  );
630
630
 
631
631
  if (freshState) {
632
+ this.log("Fresh state", freshState);
632
633
  const supplyPrice = PRICES[(freshState?.supply.mint ?? PublicKey.default).toString()].price;
633
634
  const debtPrice = PRICES[(freshState?.debt.mint ?? PublicKey.default).toString()].price;
634
- console.log("Supply price: ", supplyPrice);
635
- console.log("Debt price: ", debtPrice);
636
- console.log("Fresh state", freshState);
637
- console.log("Liq threshold bps:", freshState.liqUtilizationRateBps);
638
- console.log("Liq utilization rate bps:", freshState.liqUtilizationRateBps);
639
- console.log("Supply USD:", fromBaseUnit(freshState.supply.amountUsed.baseUnit, freshState.supply.decimals) * supplyPrice);
640
- console.log("Debt USD:", fromBaseUnit(freshState.debt.amountUsed.baseUnit, freshState.supply.decimals) * debtPrice);
635
+ this.log("Supply price: ", supplyPrice);
636
+ this.log("Debt price: ", debtPrice);
637
+ this.log("Liq threshold bps:", freshState.liqThresholdBps);
638
+ this.log("Liq utilization rate bps:", freshState.liqUtilizationRateBps);
639
+ this.log("Supply USD:", fromBaseUnit(freshState.supply.amountUsed.baseUnit, freshState.supply.decimals) * supplyPrice);
640
+ this.log("Debt USD:", fromBaseUnit(freshState.debt.amountUsed.baseUnit, freshState.debt.decimals) * debtPrice);
641
641
  }
642
642
 
643
643
  return freshState;