diff --git a/common/calculate-metrics.ts b/common/calculate-metrics.ts
index 3aad1a9c..b27ac977 100644
--- a/common/calculate-metrics.ts
+++ b/common/calculate-metrics.ts
@@ -116,12 +116,12 @@ const calculateProfitForPeriod = (
return currentProfit
}
- const startingProfit = calculateTotalProfit(startingPortfolio)
+ const startingProfit = calculatePortfolioProfit(startingPortfolio)
return currentProfit - startingProfit
}
-const calculateTotalProfit = (portfolio: PortfolioMetrics) => {
+export const calculatePortfolioProfit = (portfolio: PortfolioMetrics) => {
return portfolio.investmentValue + portfolio.balance - portfolio.totalDeposits
}
@@ -129,7 +129,7 @@ export const calculateNewProfit = (
portfolioHistory: PortfolioMetrics[],
newPortfolio: PortfolioMetrics
) => {
- const allTimeProfit = calculateTotalProfit(newPortfolio)
+ const allTimeProfit = calculatePortfolioProfit(newPortfolio)
const descendingPortfolio = sortBy(
portfolioHistory,
(p) => p.timestamp
diff --git a/common/comment.ts b/common/comment.ts
index 3a4bd9ac..7ecbb6d4 100644
--- a/common/comment.ts
+++ b/common/comment.ts
@@ -1,6 +1,6 @@
import type { JSONContent } from '@tiptap/core'
-export type AnyCommentType = OnContract | OnGroup
+export type AnyCommentType = OnContract | OnGroup | OnPost
// Currently, comments are created after the bet, not atomically with the bet.
// They're uniquely identified by the pair contractId/betId.
@@ -20,7 +20,7 @@ export type Comment