Skip to content

Commit 71efd8e

Browse files
committed
updated tomal to publish
1 parent e2894aa commit 71efd8e

10 files changed

+25
-14
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/target
2+

Cargo.toml

+14
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22
name = "RustyQLib"
33
version = "0.0.1"
44
edition = "2021"
5+
authors = ["Siddharth Singh"]
6+
description = "RustyQLib is a lightweight yet robust quantitative finance library designed to price derivatives and perform risk analysis"
7+
license = "MIT"
8+
repository = "https://github.com/siddharthqs/RustyQLib"
9+
readme = "README.md"
10+
homepage = "https://github.com/siddharthqs/RustyQLib"
11+
keywords = [
12+
"quantitative-finance",
13+
"derivatives",
14+
"monte-carlo",
15+
"black-scholes",
16+
"cli"
17+
]
18+
categories = ["command-line", "quant", "monte-carlo", "finance"]
519

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

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Rust](https://github.com/siddharthqs/RustyQLib/actions/workflows/rust.yml/badge.svg)](https://github.com/siddharthqs/RustyQLib/actions/workflows/rust.yml)
1+
[![Build and Tests](https://github.com/siddharthqs/RustyQLib/actions/workflows/rust.yml/badge.svg)](https://github.com/siddharthqs/RustyQLib/actions/workflows/rust.yml)
22

33
# RUSTYQLib :Pricing Options with Confidence using JSON
44
RustyQLib is a lightweight yet robust quantitative finance library designed for pricing options.

src/equity/binomial.rs

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ use super::utils::{Engine};
44
use crate::core::trade::{OptionType,Transection};
55
use crate::core::utils::{ContractStyle};
66
use ndarray::Array2;
7+
8+
/// Binomial tree model for European and American options
79
pub fn npv(option: &&EquityOption) -> f64 {
810
assert!(option.volatility >= 0.0);
911
assert!(option.time_to_maturity() >= 0.0);

src/equity/blackscholes.rs

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pub fn npv(bsd_option: &&EquityOption) -> f64 {
3737
}
3838

3939
impl Greeks for EquityOption{
40+
4041
fn delta(&self) -> f64 {
4142
let mut delta = N(self.d1());
4243
if self.option_type == OptionType::Call {

src/equity/montecarlo.rs

-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
11

2-
3-
4-
// let val: f64 = thread_rng().sample(StandardNormal);
5-
// println!("normal vector: {}", val);
6-
// let t = RNG::get_vector_standard_normal(10000);
7-
// for i in &t{
8-
// println!("{}", i);
9-
// }
10-
//println!(":?:{}",t);
11-
122
use std::io;
133
use chrono::{Datelike, Local, NaiveDate};
144
use libm::exp;

src/equity/utils.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
///Enum for different engines to price options
12
#[derive(PartialEq,Clone,Debug)]
23
pub enum Engine{
34
BlackScholes,

src/equity/vanila_option.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl Instrument for EquityOption {
3333
}
3434
}
3535
}
36-
36+
/// Equity Option represents a real world equity option contract
3737
#[derive(Debug)]
3838
pub struct EquityOption {
3939
pub option_type: OptionType,

src/equity/vol_surface.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ use serde::{Deserialize, Serialize};
22
use std::collections::{BTreeMap, HashMap};
33
use crate::rates::utils::{DayCountConvention};
44
use chrono::{NaiveDate};
5+
6+
/// Vol Surface is a collection of volatilities for different maturities and strikes
57
#[derive(Clone,Debug,Serialize,Deserialize)]
68
pub struct VolSurface{
79
pub term_structure: BTreeMap<NaiveDate, Vec<(f64,f64)>>,

src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ use std::time::{Instant};
4242
#[allow(dead_code)]
4343
#[allow(unused_variables)]
4444
fn main() {
45-
let matches = App::new("Rust Quant Option Pricing CLI")
46-
.version("0.1.0")
45+
let matches = App::new("RustyQLib Quant Library for Option Pricing")
46+
.version("0.0.1")
4747
.author("Siddharth Singh <[email protected]>")
4848
.about("Pricing and risk management of financial derivatives")
4949
.subcommand(

0 commit comments

Comments
 (0)