Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Avhz RustQuant SupershareOption

From Leeroopedia


Knowledge Sources
Domains Exotic_Options, Quantitative_Finance
Last Updated 2026-02-07 19:00 GMT

Overview

Implements the SupershareOption struct and its Payoff trait for computing the payoff of a supershare option that pays a leveraged amount when the underlying price falls within a specified range at expiry.

Description

The SupershareOption struct represents an exotic option with a payoff that depends on whether the terminal underlying price falls within a band defined by two strike prices. It wraps an OptionContract and two strike prices: strike_1 (lower bound) and strike_2 (upper bound).

The Payoff implementation accepts a single f64 (the terminal underlying price). If the underlying price is within the inclusive range [strike_1, strike_2], the payoff is S / strike_1 (a leveraged payout). If the underlying is outside this range, the payoff is 0.

This creates a binary-like option that pays a return proportional to how far the underlying has moved above the lower strike, but only if it remains within the band. The supershare can be thought of as a position in a portfolio insurance scheme.

Usage

Use this struct when pricing supershare options in structured products or when modeling range-dependent payoffs.

Code Reference

Source Location

Signature

#[derive(Debug, Clone)]
pub struct SupershareOption {
    pub contract: OptionContract,
    pub strike_1: f64,
    pub strike_2: f64,
}

impl Payoff for SupershareOption {
    type Underlying = f64;
    fn payoff(&self, underlying: Self::Underlying) -> f64;
}

Import

use RustQuant::instruments::options::supershare::SupershareOption;

I/O Contract

Inputs

Name Type Required Description
contract OptionContract Yes The base option contract
strike_1 f64 Yes Lower bound of the payoff range
strike_2 f64 Yes Upper bound of the payoff range
underlying (payoff) f64 Yes Terminal price of the underlying asset

Outputs

Name Type Description
payoff() f64 S / strike_1 if S is in [strike_1, strike_2], otherwise 0.0

Usage Examples

use RustQuant::instruments::options::supershare::SupershareOption;
use RustQuant::instruments::options::OptionContract;
use RustQuant::instruments::Payoff;

let contract = OptionContract { /* ... */ };

let supershare = SupershareOption {
    contract,
    strike_1: 90.0,
    strike_2: 110.0,
};

let payoff_in = supershare.payoff(100.0);
// 100.0 is in [90, 110]: payoff = 100 / 90 = 1.1111

let payoff_out = supershare.payoff(120.0);
// 120.0 is outside [90, 110]: payoff = 0.0

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment