diff --git a/centrifuge-app/src/components/PoolsTokensShared.tsx b/centrifuge-app/src/components/PoolsTokensShared.tsx index e6af59d340..3696f271bc 100644 --- a/centrifuge-app/src/components/PoolsTokensShared.tsx +++ b/centrifuge-app/src/components/PoolsTokensShared.tsx @@ -29,7 +29,9 @@ export function PoolsTokensShared({ title, children }: PoolsTokensSharedProps) { - + + + diff --git a/centrifuge-app/src/components/PortfolioCta/index.tsx b/centrifuge-app/src/components/PortfolioCta/index.tsx index e15171bced..aa17caabbb 100644 --- a/centrifuge-app/src/components/PortfolioCta/index.tsx +++ b/centrifuge-app/src/components/PortfolioCta/index.tsx @@ -1,4 +1,3 @@ -import { ActiveLoan } from '@centrifuge/centrifuge-js' import { useBalances, useCentrifugeConsts, useWallet } from '@centrifuge/centrifuge-react' import { Box, Button, Shelf, Stack, Text } from '@centrifuge/fabric' import * as React from 'react' @@ -8,7 +7,6 @@ import { Dec } from '../../utils/Decimal' import { formatBalance, formatBalanceAbbreviated } from '../../utils/formatting' import { useAddress } from '../../utils/useAddress' import { useListedPools } from '../../utils/useListedPools' -import { useLoansAcrossPools } from '../../utils/useLoans' import { useDebugFlags } from '../DebugFlags' import { useComputeLiquidityRewards } from '../LiquidityRewards/hooks' import { Cubes } from './Cubes' @@ -33,13 +31,6 @@ export function PortfolioCta() { }) ?? [] const investedValue = [...currencies, ...tranches].reduce((a, b) => a.add(b), Dec(0)) - const pools = balances?.tranches.map(({ poolId }) => poolId) ?? [] - const loans = useLoansAcrossPools(pools) ?? [] - const activeLoans = loans?.filter(({ status }) => status === 'Active') as ActiveLoan[] - const accruedInterest = activeLoans - .map(({ outstandingInterest }) => outstandingInterest.toDecimal()) - .reduce((a, b) => a.add(b), Dec(0)) - const terms = [ { title: 'Portfolio value', @@ -47,10 +38,6 @@ export function PortfolioCta() { ? formatBalanceAbbreviated(investedValue, config.baseCurrency) : formatBalance(investedValue, config.baseCurrency), }, - { - title: 'Accrued interest', - value: formatBalance(accruedInterest, config.baseCurrency), - }, { title: 'CFG rewards', value: formatBalance(rewards, consts.chainSymbol, 2), diff --git a/centrifuge-app/src/utils/useLoans.ts b/centrifuge-app/src/utils/useLoans.ts index dcda26edc1..70d7748116 100644 --- a/centrifuge-app/src/utils/useLoans.ts +++ b/centrifuge-app/src/utils/useLoans.ts @@ -1,6 +1,4 @@ import { useCentrifugeQuery } from '@centrifuge/centrifuge-react' -import { combineLatest } from 'rxjs' -import { map } from 'rxjs/operators' import { Dec } from './Decimal' import { useTinlakeLoans } from './tinlake/useTinlakePools' @@ -16,19 +14,6 @@ export function useLoans(poolId: string) { return isTinlakePool ? tinlakeLoans : centLoans } -export function useLoansAcrossPools(poolIds?: string[]) { - const [result] = useCentrifugeQuery( - ['loansAcrossPools', poolIds], - (cent) => combineLatest(poolIds!.map((poolId) => cent.pools.getLoans([poolId]))).pipe(map((loans) => loans.flat())), - { - suspense: true, - enabled: poolIds && poolIds.length > 0, - } - ) - - return result -} - export function useLoan(poolId: string, assetId: string) { const loans = useLoans(poolId)