Skip to content

Commit

Permalink
Subquery fee renamings (#2158)
Browse files Browse the repository at this point in the history
* Fix transaction history

* Fix investor list

* Fix 0 tx showing up

* Remove console log

* Fix fee names
  • Loading branch information
hieronx authored May 29, 2024
1 parent 3d7258f commit abdfceb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions centrifuge-app/src/components/Charts/CashflowsChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export const CashflowsChart = ({ poolStates, pool }: Props) => {

const interest = new CurrencyBalance(day.sumInterestRepaidAmountByPeriod, pool.currency.decimals).toFloat()
const fees =
new CurrencyBalance(day.sumChargedAmountByPeriod ?? 0, pool.currency.decimals).toFloat() +
new CurrencyBalance(day.sumAccruedAmountByPeriod ?? 0, pool.currency.decimals).toFloat()
new CurrencyBalance(day.sumPoolFeesChargedAmountByPeriod ?? 0, pool.currency.decimals).toFloat() +
new CurrencyBalance(day.sumPoolFeesAccruedAmountByPeriod ?? 0, pool.currency.decimals).toFloat()
return { name: new Date(day.timestamp), purchases, principalRepayments, interest, fees }
}) || [],
[poolStates, pool.currency.decimals]
Expand Down
16 changes: 8 additions & 8 deletions centrifuge-js/src/modules/pools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,8 @@ export type DailyPoolState = {
poolValue: CurrencyBalance
timestamp: string
tranches: { [trancheId: string]: DailyTrancheState }
sumChargedAmountByPeriod: string | null
sumAccruedAmountByPeriod: string | null
sumPoolFeesChargedAmountByPeriod: string | null
sumPoolFeesAccruedAmountByPeriod: string | null
sumBorrowedAmountByPeriod: string
sumInterestRepaidAmountByPeriod: string
sumRepaidAmountByPeriod: string
Expand Down Expand Up @@ -2196,8 +2196,8 @@ export function getPoolsModule(inst: Centrifuge) {
totalReserve
portfolioValuation
blockNumber
sumChargedAmountByPeriod
sumAccruedAmountByPeriod
sumPoolFeesChargedAmountByPeriod
sumPoolFeesAccruedAmountByPeriod
sumBorrowedAmountByPeriod
sumRepaidAmountByPeriod
sumInvestedAmountByPeriod
Expand Down Expand Up @@ -2381,12 +2381,12 @@ export function getPoolsModule(inst: Centrifuge) {
id: state.id,
portfolioValuation: new CurrencyBalance(state.portfolioValuation, poolCurrency.decimals),
totalReserve: new CurrencyBalance(state.totalReserve, poolCurrency.decimals),
sumChargedAmountByPeriod: new CurrencyBalance(
state.sumChargedAmountByPeriod ?? 0,
sumPoolFeesChargedAmountByPeriod: new CurrencyBalance(
state.sumPoolFeesChargedAmountByPeriod ?? 0,
poolCurrency.decimals
),
sumAccruedAmountByPeriod: new CurrencyBalance(
state.sumAccruedAmountByPeriod ?? 0,
sumPoolFeesAccruedAmountByPeriod: new CurrencyBalance(
state.sumPoolFeesAccruedAmountByPeriod ?? 0,
poolCurrency.decimals
),
sumBorrowedAmountByPeriod: new CurrencyBalance(state.sumBorrowedAmountByPeriod, poolCurrency.decimals),
Expand Down
4 changes: 2 additions & 2 deletions centrifuge-js/src/types/subquery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export type SubqueryPoolSnapshot = {
value: string
portfolioValuation: number
totalReserve: number
sumChargedAmountByPeriod: string | null
sumAccruedAmountByPeriod: string | null
sumPoolFeesChargedAmountByPeriod: string | null
sumPoolFeesAccruedAmountByPeriod: string | null
sumBorrowedAmountByPeriod: string
sumInterestRepaidAmountByPeriod: string
sumRepaidAmountByPeriod: string
Expand Down

0 comments on commit abdfceb

Please sign in to comment.