summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--frontend/lib/api.ts7
-rw-r--r--frontend/types/api.ts36
2 files changed, 42 insertions, 1 deletions
diff --git a/frontend/lib/api.ts b/frontend/lib/api.ts
index 05af5ae..53b3dd3 100644
--- a/frontend/lib/api.ts
+++ b/frontend/lib/api.ts
@@ -1,4 +1,4 @@
-import type { FinancialsResponse, HistoryPoint, MarketIndex, SearchResult, TickerOverview, WatchlistResponse } from "@/types/api";
+import type { FinancialsResponse, HistoryPoint, MarketIndex, SearchResult, TickerOverview, ValuationResponse, WatchlistResponse } from "@/types/api";
const API_BASE = process.env.NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000";
@@ -53,5 +53,10 @@ export const api = {
return request<FinancialsResponse>(
`/api/tickers/${encodeURIComponent(symbol)}/financials?period=${encodeURIComponent(period)}`
);
+ },
+ valuation(symbol: string) {
+ return request<ValuationResponse>(
+ `/api/tickers/${encodeURIComponent(symbol)}/valuation`
+ );
}
};
diff --git a/frontend/types/api.ts b/frontend/types/api.ts
index 3cc93e4..998f618 100644
--- a/frontend/types/api.ts
+++ b/frontend/types/api.ts
@@ -120,3 +120,39 @@ export type FinancialsResponse = {
balance: FinancialStatement;
cash_flow: FinancialStatement;
};
+
+export type DcfResult = {
+ available: boolean;
+ error?: string | null;
+ intrinsic_value_per_share?: number | null;
+ enterprise_value?: number | null;
+ equity_value?: number | null;
+ net_debt?: number | null;
+ cash_and_equivalents?: number | null;
+ total_debt?: number | null;
+ terminal_value_pv?: number | null;
+ fcf_pv_sum?: number | null;
+ growth_rate_used?: number | null;
+ base_fcf?: number | null;
+ wacc: number;
+ terminal_growth: number;
+};
+
+export type MultipleResult = {
+ available: boolean;
+ implied_price_per_share?: number | null;
+ implied_ev?: number | null;
+ equity_value?: number | null;
+ net_debt?: number | null;
+ multiple_used?: number | null;
+};
+
+export type ValuationResponse = {
+ symbol: string;
+ current_price?: number | null;
+ shares_outstanding?: number | null;
+ dcf: DcfResult;
+ ev_ebitda: MultipleResult;
+ ev_revenue: MultipleResult;
+ price_to_book: MultipleResult;
+};