Skip to content

Commit

Permalink
Temporal fix - hard coded apy for DYF
Browse files Browse the repository at this point in the history
  • Loading branch information
kattylucy committed Oct 15, 2024
1 parent ffef03a commit 8d23257
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions centrifuge-app/src/components/Charts/PoolPerformanceChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function PoolPerformanceChart() {
nav: todayAssetValue,
juniorTokenPrice: tranchePrices.juniorTokenPrice ?? 0,
seniorTokenPrice: tranchePrices.seniorTokenPrice ?? null,
juniorAPY: todayJuniorApy ?? 0,
juniorAPY: pool.id === '1655476167' ? 15 : todayJuniorApy,
seniorAPY: todaySeniorApy,
}
}
Expand All @@ -181,7 +181,7 @@ function PoolPerformanceChart() {
nav: todayAssetValue,
price: todayPrice,
currency: pool.currency.symbol,
juniorAPY: todayJuniorApy,
juniorAPY: pool.id === '1655476167' ? 15 : todayJuniorApy,
seniorAPY: todaySeniorApy,
...trancheTodayPrice,
}
Expand Down
1 change: 1 addition & 0 deletions centrifuge-app/src/components/PoolCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export function PoolCard({

const calculateApy = (tranche: TrancheWithCurrency) => {

Check warning on line 138 in centrifuge-app/src/components/PoolCard/index.tsx

View workflow job for this annotation

GitHub Actions / ff-prod / build-app

The 'calculateApy' function makes the dependencies of useMemo Hook (at line 177) change on every render. Move it inside the useMemo callback. Alternatively, wrap the definition of 'calculateApy' in its own useCallback() Hook

Check warning on line 138 in centrifuge-app/src/components/PoolCard/index.tsx

View workflow job for this annotation

GitHub Actions / build-app

The 'calculateApy' function makes the dependencies of useMemo Hook (at line 177) change on every render. Move it inside the useMemo callback. Alternatively, wrap the definition of 'calculateApy' in its own useCallback() Hook
const daysSinceCreation = createdAt ? daysBetween(createdAt, new Date()) : 0
if (poolId === '1655476167') return '15%'
if (daysSinceCreation > 30 && tranche.yield30DaysAnnualized)
return formatPercentage(tranche.yield30DaysAnnualized, true, {}, 1)
if (tranche.interestRatePerSec) {
Expand Down
2 changes: 2 additions & 0 deletions centrifuge-app/src/components/PoolOverview/KeyMetrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ export const KeyMetrics = ({ poolId }: Props) => {
metric: '30-day APY',
value: tinlakeData[poolId as TinlakeDataKey]
? tinlakeData[poolId as TinlakeDataKey]
: poolId === '1655476167'
? '15%'
: tranchesAPY?.length
? tranchesAPY.map((tranche, index) => {
const formatted = formatPercentage(tranche)
Expand Down

0 comments on commit 8d23257

Please sign in to comment.