rustnance

Crates.iorustnance
lib.rsrustnance
version0.2.2
sourcesrc
created_at2023-04-11 17:17:03.702806
updated_at2023-05-04 17:58:01.815716
descriptionA crate to help with financial analysis
homepage
repositoryhttps://github.com/Nelliguns/rustnance/
max_upload_size
id836199
size10,232
Nelligan (Nelliguns)

documentation

README

Rustnance

Downloads Version License

Synopsis

A crate that provides functionality within the space of financial analysis

Explanation

This crate is meant to provide calculations as well as metrics and should not be seen as any financial or investing advice. The intent is to firstly develop calculation for fundamental analysis but technical analysis related functionality may be added. Some of the existing functions you will find consist of:

  • Calculate intrinsic value
  • Calculate compound interest

Usage

Inside your Cargo.toml

[dependencies]
rustnance = "0.2.1" # Latest version

Example usage

use rustnance::value; // Bring module into scope
fn main() {
    let free_cash_flow: Vec<f32> = vec![1000.0, 2000.0, 3000.0, 4000.0, 5000.0]; // Historical free cash flow
    let expected_return: f32 = 0.15; // The return you expect to achieve from an investment
    let outstanding_shares: f32 = 1_000.0; // Amount of shares that excist for the specific company
    let margin_of_safety: f32 = 0.3; // A margin of safety to take into account for the uncertainty of any calculation
    
    let intrinsic_value: f32 = value::calculate_intrinsic_value(&free_cash_flow, &expected_return);
    let intrinsic_value_per_share: f32 = value::intrinsic_value_per_stock(&intrinsic_value, &outstanding_shares);
    let share_buy_price: f32 = value::margin_of_safety(&intrinsic_value_per_share, &margin_of_safety);
    println!("A reasonable price would be: {}", share_buy_price);
}

Module structure

Output of cargo modules generate tree

Find a bug?

If you found a bug, an issue, an improvement or a potential addition to this project, please submit an issue(if it hasn't already been raised) using the issue tab towards the top. I intend to fix issues as they arise as well as add requested functionality.

Commit count: 46

cargo fmt