#options #cashmoney

optioncontracts

Option contract value at expiration calculations in pure Rust

1 unstable release

0.0.0 Mar 3, 2021

#155 in #options

21 downloads per month

MIT license

5KB
94 lines

option contracts

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

No runtime deps