Crates.io | optioncontracts |
lib.rs | optioncontracts |
version | 0.0.0 |
source | src |
created_at | 2021-03-03 21:20:39.25557 |
updated_at | 2021-03-03 21:20:39.25557 |
description | Option contract value at expiration calculations in pure Rust |
homepage | https://github.com/drbh/optioncontracts |
repository | https://github.com/drbh/optioncontracts.git |
max_upload_size | |
id | 363360 |
size | 5,524 |
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
cargo run --example simple