@haven-fi/solauto-sdk 1.0.125 → 1.0.126
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.
@@ -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
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
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
@@ -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
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
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;
|