rustrade_execution/expiry.rs
1//! How an option position settles at expiry.
2
3use serde::{Deserialize, Serialize};
4
5/// How a long option position settles at expiry, whoever settles it: an engine that settles
6/// expiry itself, or the [`SimulatedVenue`](crate::exchange::mock::SimulatedVenue). Short options
7/// and futures are not affected.
8#[non_exhaustive]
9#[derive(
10 Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize,
11)]
12pub enum LongOptionExpiry {
13 /// An option in the money is exercised, against the underlying's price as whoever settles it
14 /// takes it (see their documentation). One out of the money settles at zero. The default, matching an exchange that exercises in-the-money
15 /// options automatically. What exercise does to the account is up to whoever settles it: an
16 /// engine settles in cash at the intrinsic value, and the simulated venue settles as the
17 /// contract's [`OptionSettlement`](rustrade_instrument::instrument::kind::option::OptionSettlement)
18 /// says.
19 #[default]
20 Exercise,
21 /// Every long option lapses: the position settles at zero, in the money or not, and no
22 /// underlying price is needed for it. This matches a holder who instructs the broker not to
23 /// exercise any option still held at expiry.
24 Lapse,
25}