optioncontracts

Crates.iooptioncontracts
lib.rsoptioncontracts
version0.0.0
sourcesrc
created_at2021-03-03 21:20:39.25557
updated_at2021-03-03 21:20:39.25557
descriptionOption contract value at expiration calculations in pure Rust
homepagehttps://github.com/drbh/optioncontracts
repositoryhttps://github.com/drbh/optioncontracts.git
max_upload_size
id363360
size5,524
drbh (drbh)

documentation

README

option contracts

crates.io

written in rust - because rust.

Build options with the Builder Pattern.

let option_input = OptionBuilder::new()
    .kind(Type::Call)
    .direction(Direction::Long)
    .strike(10.0)
    .price(1.0)
    .finish();

Execute the option based on a current market price

let current_price = 20.0;
let result = execute_option(&option_input, current_price);

println!("{:#?}", result);
// 9.0

Run Example

cargo run --example simple
Commit count: 4

cargo fmt