Skip to content

Commit 4f9aca8

Browse files
committed
fix: health factor for empty wallets
1 parent 085767b commit 4f9aca8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apps/indexer/src/app/routes/_chain/routes.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,10 @@ export default async function (fastify: ZodFastifyInstance) {
416416
positions: userPositions,
417417
summary: {
418418
netApy: netApy.toFixed(USD_DECIMALS),
419-
healthFactor: healthFactor.toFixed(USD_DECIMALS),
419+
healthFactor:
420+
borrowBalance.eq(0) && supplyBalance.eq(0)
421+
? '0'
422+
: healthFactor.toFixed(USD_DECIMALS),
420423
collateralRatio: collateralRatio.toFixed(USD_DECIMALS),
421424
borrowPower: borrowPower.toFixed(USD_DECIMALS),
422425
borrowPowerUsed: borrowPowerUsed.toFixed(USD_DECIMALS),

0 commit comments

Comments
 (0)