pub struct Dcf { /* private fields */ }Expand description
DCF and Valuation API endpoints
Implementations§
Source§impl Dcf
impl Dcf
Sourcepub async fn get_dcf(&self, symbol: &str) -> Result<Vec<DcfModel>>
pub async fn get_dcf(&self, symbol: &str) -> Result<Vec<DcfModel>>
Get current DCF valuation for a symbol
Returns the discounted cash flow (DCF) valuation which estimates the intrinsic value of a stock based on its future cash flows.
§Arguments
symbol- Stock symbol (e.g., “AAPL”)
§Example
let client = FmpClient::new()?;
let dcf = client.dcf().get_dcf("AAPL").await?;
for valuation in dcf {
println!("Symbol: {}, DCF: ${:.2}, Stock Price: ${:.2}",
valuation.symbol,
valuation.dcf.unwrap_or(0.0),
valuation.stock_price.unwrap_or(0.0));
}Sourcepub async fn get_historical_dcf(
&self,
symbol: &str,
) -> Result<Vec<HistoricalDcf>>
pub async fn get_historical_dcf( &self, symbol: &str, ) -> Result<Vec<HistoricalDcf>>
Get historical DCF valuations for a symbol
Returns DCF valuations over time, allowing comparison of historical intrinsic values vs. actual stock prices.
§Arguments
symbol- Stock symbol (e.g., “AAPL”)
§Example
let client = FmpClient::new()?;
let history = client.dcf().get_historical_dcf("AAPL").await?;
for record in history.iter().take(5) {
println!("{}: DCF ${:.2} vs Stock ${:.2}",
record.date,
record.dcf.unwrap_or(0.0),
record.stock_price.unwrap_or(0.0));
}Sourcepub async fn get_advanced_dcf(&self, symbol: &str) -> Result<Vec<AdvancedDcf>>
pub async fn get_advanced_dcf(&self, symbol: &str) -> Result<Vec<AdvancedDcf>>
Get advanced DCF with detailed assumptions
Returns DCF valuation with detailed modeling assumptions including revenue growth, margins, tax rates, WACC, and projected cash flows.
§Arguments
symbol- Stock symbol (e.g., “AAPL”)
§Example
let client = FmpClient::new()?;
let dcf = client.dcf().get_advanced_dcf("AAPL").await?;
for valuation in dcf {
println!("DCF: ${:.2}", valuation.dcf.unwrap_or(0.0));
println!("Revenue Growth: {:.2}%", valuation.revenue_growth.unwrap_or(0.0) * 100.0);
println!("WACC: {:.2}%", valuation.wacc.unwrap_or(0.0) * 100.0);
}Sourcepub async fn get_levered_dcf(&self, symbol: &str) -> Result<Vec<LeveredDcf>>
pub async fn get_levered_dcf(&self, symbol: &str) -> Result<Vec<LeveredDcf>>
Get levered DCF (equity value after debt)
Returns DCF valuation accounting for debt, providing equity value rather than enterprise value.
§Arguments
symbol- Stock symbol (e.g., “AAPL”)
§Example
let client = FmpClient::new()?;
let dcf = client.dcf().get_levered_dcf("AAPL").await?;
for valuation in dcf {
println!("Levered DCF: ${:.2}", valuation.levered_dcf.unwrap_or(0.0));
println!("Enterprise Value: ${:.2}B", valuation.enterprise_value.unwrap_or(0.0) / 1_000_000_000.0);
println!("Total Debt: ${:.2}B", valuation.total_debt.unwrap_or(0.0) / 1_000_000_000.0);
}Sourcepub async fn get_enterprise_value(
&self,
symbol: &str,
) -> Result<Vec<EnterpriseValue>>
pub async fn get_enterprise_value( &self, symbol: &str, ) -> Result<Vec<EnterpriseValue>>
Get company enterprise value
Returns the enterprise value calculation, which represents the total value of a company (market cap + debt - cash).
§Arguments
symbol- Stock symbol (e.g., “AAPL”)
§Example
let client = FmpClient::new()?;
let ev = client.dcf().get_enterprise_value("AAPL").await?;
for value in ev {
println!("Market Cap: ${:.2}B", value.market_capitalization.unwrap_or(0.0) / 1_000_000_000.0);
println!("+ Debt: ${:.2}B", value.add_total_debt.unwrap_or(0.0) / 1_000_000_000.0);
println!("- Cash: ${:.2}B", value.minus_cash_and_cash_equivalents.unwrap_or(0.0) / 1_000_000_000.0);
println!("= Enterprise Value: ${:.2}B", value.enterprise_value.unwrap_or(0.0) / 1_000_000_000.0);
}