diff --git a/centrifuge-app/src/components/Report/PoolBalance.tsx b/centrifuge-app/src/components/Report/PoolBalance.tsx index 74c397f7c..ca9938ba0 100644 --- a/centrifuge-app/src/components/Report/PoolBalance.tsx +++ b/centrifuge-app/src/components/Report/PoolBalance.tsx @@ -2,7 +2,7 @@ import { Pool } from '@centrifuge/centrifuge-js/dist/modules/pools' import { Text } from '@centrifuge/fabric' import * as React from 'react' import { formatDate } from '../../utils/date' -import { formatBalance, formatPercentage } from '../../utils/formatting' +import { formatBalance } from '../../utils/formatting' import { getCSVDownloadUrl } from '../../utils/getCSVDownloadUrl' import { useDailyPoolStates, useMonthlyPoolStates } from '../../utils/usePools' import { DataTable } from '../DataTable' @@ -81,25 +81,17 @@ export function PoolBalance({ pool }: { pool: Pool }) { heading: false, }, { - name: 'NAV change', - value: - poolStates?.map((state, i) => { - if (i === 0) return '' - const prev = poolStates[i - 1].poolValue.toFloat() - const cur = state.poolValue.toFloat() - const change = (cur / prev - 1) * 100 - return change < 0 ? change : `+${change}` - }) || [], - heading: false, - formatter: (v: any) => `${v < 0 ? '' : '+'}${formatPercentage(v, true, {}, 2)}`, - }, - { - name: 'Asset value', + name: '+ Asset value', value: poolStates?.map((state) => state.poolValue.toFloat() - state.poolState.totalReserve.toFloat()) || [], heading: false, }, + // { + // name: '+ Offchain cash', + // value: poolStates?.map((state) => state.poolState.cashAssetValue.toFloat()) || [], + // heading: false, + // }, { - name: 'Onchain reserve', + name: '+ Onchain reserve', value: poolStates?.map((state) => state.poolState.totalReserve.toFloat()) || [], heading: false, }, diff --git a/centrifuge-js/src/modules/pools.ts b/centrifuge-js/src/modules/pools.ts index 82470dfa5..df3fc867e 100644 --- a/centrifuge-js/src/modules/pools.ts +++ b/centrifuge-js/src/modules/pools.ts @@ -567,6 +567,7 @@ export type DailyTrancheState = { export type DailyPoolState = { poolState: { portfolioValuation: CurrencyBalance + cashAssetValue: CurrencyBalance totalReserve: CurrencyBalance } poolValue: CurrencyBalance @@ -2215,6 +2216,7 @@ export function getPoolsModule(inst: Centrifuge) { timestamp totalReserve portfolioValuation + cashAssetValue blockNumber sumPoolFeesChargedAmountByPeriod sumPoolFeesAccruedAmountByPeriod @@ -2400,6 +2402,7 @@ export function getPoolsModule(inst: Centrifuge) { const poolState = { id: state.id, portfolioValuation: new CurrencyBalance(state.portfolioValuation, poolCurrency.decimals), + cashAssetValue: new CurrencyBalance(state.cashAssetValue, poolCurrency.decimals), totalReserve: new CurrencyBalance(state.totalReserve, poolCurrency.decimals), sumPoolFeesChargedAmountByPeriod: new CurrencyBalance( state.sumPoolFeesChargedAmountByPeriod ?? 0, diff --git a/centrifuge-js/src/types/subquery.ts b/centrifuge-js/src/types/subquery.ts index 90fd7af9b..ad2bb391d 100644 --- a/centrifuge-js/src/types/subquery.ts +++ b/centrifuge-js/src/types/subquery.ts @@ -6,6 +6,7 @@ export type SubqueryPoolSnapshot = { value: string portfolioValuation: number totalReserve: number + cashAssetValue: number sumPoolFeesChargedAmountByPeriod: string | null sumPoolFeesAccruedAmountByPeriod: string | null sumBorrowedAmountByPeriod: string