Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
fix(raft): Early return if there's no balances (#2787)
Browse files Browse the repository at this point in the history
  • Loading branch information
wpoulin committed Jun 30, 2023
1 parent 195e87a commit 4965dec
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/apps/raft/ethereum/raft.position-presenter.ts
Expand Up @@ -29,6 +29,8 @@ export class EthereumRaftPositionPresenter extends PositionPresenterTemplate {
const minCRatio = balance?.dataProps?.minCRatio;
if (!minCRatio) return [];

if (!balances.some(balance => balance.balanceUSD < 0)) return [];

const collateral = balance?.tokens[0];
const collateralUSD = collateral?.balanceUSD ?? 0;
const debt = Math.abs(balance?.tokens[1]?.balanceUSD ?? 0);
Expand Down

0 comments on commit 4965dec

Please sign in to comment.