Skip to content

Commit

Permalink
fix: summary card value bug
Browse files Browse the repository at this point in the history
  • Loading branch information
andyv09 committed Aug 12, 2024
1 parent 53f47e1 commit 74052db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
8 changes: 0 additions & 8 deletions apps/frontend/src/hooks/useCollateralUtilization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,11 @@ export const useCollateralUtilization = (
);
const balance = BN.formatUnits(v, token.decimals);
const dollBalance = getTokenPrice(assetId).times(balance);
console.log('token', token.name);
console.log('dollBalance', dollBalance.toFixed(2));
console.log('liquidationFactor', liquidationFactor.toFixed(2));
console.log('balance', balance.toFixed(2));
console.log('liquidationFactor', liquidationFactor.toFixed(2));
const trueDollBalance = dollBalance.times(liquidationFactor);
console.log('trueDollBalance', trueDollBalance.toFixed(2));
return acc.plus(trueDollBalance);
}, BN.ZERO);
}, [collateralBalances, assetsConfigs]);

console.log('trueCollateralsValue', trueCollateralsValue.toFixed(2));

const borrowedBalance = useMemo(() => {
if (userSupplyBorrow == null) return BN.ZERO;
return userSupplyBorrow[1];
Expand Down
4 changes: 2 additions & 2 deletions apps/frontend/src/screens/Dashboard/SummaryCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ const SummaryCard: React.FC<IProps> = () => {
collateralConfigurations![
assetId
].borrow_collateral_factor.toString(),
4
18
);
let balance = v;
if (assetId === dashboardStore.actionTokenAssetId) {
Expand Down Expand Up @@ -326,7 +326,7 @@ const SummaryCard: React.FC<IProps> = () => {
collateralConfigurations![
assetId
].borrow_collateral_factor.toString(),
4
18
);
let balance = v;
if (assetId === dashboardStore.actionTokenAssetId) {
Expand Down

0 comments on commit 74052db

Please sign in to comment.