@@ -14,7 +14,6 @@ import { AssetSummary } from '../../../src/components/AssetSummary'
1414import { SimpleLineChart } from '../../../src/components/Charts/SimpleLineChart'
1515import { LoanLabel , getLoanLabelStatus } from '../../../src/components/LoanLabel'
1616import { RouterLinkButton } from '../../../src/components/RouterLinkButton'
17- import { Dec } from '../../../src/utils/Decimal'
1817import AssetPerformanceChart from '../../components/Charts/AssetPerformanceChart'
1918import { LabelValueStack } from '../../components/LabelValueStack'
2019import { LayoutSection } from '../../components/LayoutBase/LayoutSection'
@@ -132,16 +131,6 @@ function Loan() {
132131 } )
133132 } , [ borrowerAssetTransactions ] )
134133
135- const sumRealizedProfitFifo = borrowerAssetTransactions ?. reduce (
136- ( sum , tx ) => sum . add ( tx . realizedProfitFifo ?. toDecimal ( ) ?? Dec ( 0 ) ) ,
137- Dec ( 0 )
138- )
139-
140- const unrealizedProfitAtMarketPrice = borrowerAssetTransactions ?. reduce (
141- ( sum , tx ) => sum . add ( tx . unrealizedProfitAtMarketPrice ?. toDecimal ( ) ?? Dec ( 0 ) ) ,
142- Dec ( 0 )
143- )
144-
145134 const currentFace =
146135 loan ?. pricing && 'outstandingQuantity' in loan . pricing
147136 ? loan . pricing . outstandingQuantity . toDecimal ( ) . mul ( loan . pricing . notional . toDecimal ( ) )
@@ -177,11 +166,6 @@ function Loan() {
177166 return 0
178167 }
179168
180- const getValueProfit = ( ) => {
181- if ( loanStatus === 'Closed' || loanStatus === 'Repaid' ) return sumRealizedProfitFifo ?? 0
182- else return unrealizedProfitAtMarketPrice ?? 0
183- }
184-
185169 if ( metadataIsLoading ) return
186170
187171 return (
@@ -206,13 +190,6 @@ function Loan() {
206190 value : `${ formatBalance ( getCurrentPrice ( ) , undefined , 2 , 2 ) } ` ,
207191 heading : false ,
208192 } ,
209- {
210- label : `${ loanStatus === 'Closed' || loanStatus === 'Repaid' ? 'Realized P&L' : 'Unrealized P&L' } (${
211- pool . currency . symbol ?? 'USD'
212- } )`,
213- value : `${ formatBalance ( getValueProfit ( ) , undefined , 2 , 2 ) } ` ,
214- heading : false ,
215- } ,
216193 ]
217194 : [
218195 {
@@ -333,7 +310,6 @@ function Loan() {
333310 pricing = { loan . pricing as PricingInfo }
334311 maturityDate = { loan . pricing . maturityDate ? new Date ( loan . pricing . maturityDate ) : undefined }
335312 originationDate = { originationDate ? new Date ( originationDate ) : undefined }
336- loanStatus = { loanStatus ?? '' }
337313 />
338314 </ Stack >
339315 </ Grid >
0 commit comments