Skip to content

Commit

Permalink
fix: negative apr, type error
Browse files Browse the repository at this point in the history
  • Loading branch information
damnnou committed May 21, 2024
1 parent b24e042 commit 30da727
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/common/Table/poolsColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export const poolsColumns: ColumnDef<Pool>[] = [
<AvgAPR
avgApr={formatPercent.format(row.original.poolAvgApr)}
maxApr={formatPercent.format(row.original.poolMaxApr)}
farmApr={row.original.hasActiveFarming && formatPercent.format(row.original.farmApr)}
farmApr={row.original.hasActiveFarming ? formatPercent.format(row.original.farmApr) : undefined}
>
{formatPercent.format(getValue() as number)}
</AvgAPR>
Expand Down
2 changes: 1 addition & 1 deletion src/components/pools/PoolsList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const PoolsList = () => {

const poolMaxApr = poolsMaxApr && poolsMaxApr[id] ? Number(poolsMaxApr[id].toFixed(2)) : 0;
const poolAvgApr = poolsAvgApr && poolsAvgApr[id] ? Number(poolsAvgApr[id].toFixed(2)) : 0;
const farmApr = activeFarming && farmingsAPR ? farmingsAPR[activeFarming.id] : 0;
const farmApr = activeFarming && farmingsAPR && farmingsAPR[activeFarming.id] > 0 ? farmingsAPR[activeFarming.id] : 0;

const avgApr = farmApr + poolAvgApr;

Expand Down

0 comments on commit 30da727

Please sign in to comment.