Skip to content

Commit

Permalink
updated tomal to publish
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthqs committed Oct 29, 2023
1 parent e2894aa commit 71efd8e
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target

14 changes: 14 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
name = "RustyQLib"
version = "0.0.1"
edition = "2021"
authors = ["Siddharth Singh"]
description = "RustyQLib is a lightweight yet robust quantitative finance library designed to price derivatives and perform risk analysis"
license = "MIT"
repository = "https://github.com/siddharthqs/RustyQLib"
readme = "README.md"
homepage = "https://github.com/siddharthqs/RustyQLib"
keywords = [
"quantitative-finance",
"derivatives",
"monte-carlo",
"black-scholes",
"cli"
]
categories = ["command-line", "quant", "monte-carlo", "finance"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Rust](https://github.com/siddharthqs/RustyQLib/actions/workflows/rust.yml/badge.svg)](https://github.com/siddharthqs/RustyQLib/actions/workflows/rust.yml)
[![Build and Tests](https://github.com/siddharthqs/RustyQLib/actions/workflows/rust.yml/badge.svg)](https://github.com/siddharthqs/RustyQLib/actions/workflows/rust.yml)

# RUSTYQLib :Pricing Options with Confidence using JSON
RustyQLib is a lightweight yet robust quantitative finance library designed for pricing options.
Expand Down
2 changes: 2 additions & 0 deletions src/equity/binomial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use super::utils::{Engine};
use crate::core::trade::{OptionType,Transection};
use crate::core::utils::{ContractStyle};
use ndarray::Array2;

/// Binomial tree model for European and American options
pub fn npv(option: &&EquityOption) -> f64 {
assert!(option.volatility >= 0.0);
assert!(option.time_to_maturity() >= 0.0);
Expand Down
1 change: 1 addition & 0 deletions src/equity/blackscholes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub fn npv(bsd_option: &&EquityOption) -> f64 {
}

impl Greeks for EquityOption{

fn delta(&self) -> f64 {
let mut delta = N(self.d1());
if self.option_type == OptionType::Call {
Expand Down
10 changes: 0 additions & 10 deletions src/equity/montecarlo.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@



// let val: f64 = thread_rng().sample(StandardNormal);
// println!("normal vector: {}", val);
// let t = RNG::get_vector_standard_normal(10000);
// for i in &t{
// println!("{}", i);
// }
//println!(":?:{}",t);

use std::io;
use chrono::{Datelike, Local, NaiveDate};
use libm::exp;
Expand Down
1 change: 1 addition & 0 deletions src/equity/utils.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
///Enum for different engines to price options
#[derive(PartialEq,Clone,Debug)]
pub enum Engine{
BlackScholes,
Expand Down
2 changes: 1 addition & 1 deletion src/equity/vanila_option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl Instrument for EquityOption {
}
}
}

/// Equity Option represents a real world equity option contract
#[derive(Debug)]
pub struct EquityOption {
pub option_type: OptionType,
Expand Down
2 changes: 2 additions & 0 deletions src/equity/vol_surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ use serde::{Deserialize, Serialize};
use std::collections::{BTreeMap, HashMap};
use crate::rates::utils::{DayCountConvention};
use chrono::{NaiveDate};

/// Vol Surface is a collection of volatilities for different maturities and strikes
#[derive(Clone,Debug,Serialize,Deserialize)]
pub struct VolSurface{
pub term_structure: BTreeMap<NaiveDate, Vec<(f64,f64)>>,
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ use std::time::{Instant};
#[allow(dead_code)]
#[allow(unused_variables)]
fn main() {
let matches = App::new("Rust Quant Option Pricing CLI")
.version("0.1.0")
let matches = App::new("RustyQLib Quant Library for Option Pricing")
.version("0.0.1")
.author("Siddharth Singh <[email protected]>")
.about("Pricing and risk management of financial derivatives")
.subcommand(
Expand Down

0 comments on commit 71efd8e

Please sign in to comment.