Skip to main content

FeeModel

Trait FeeModel 

Source
pub trait FeeModel {
    // Required method
    fn compute_fee(
        &self,
        price: Decimal,
        quantity: Decimal,
        contract_size: Decimal,
    ) -> Decimal;
}
Expand description

Computes the trading fee for a single fill.

§Arguments

  • price - Execution price per unit of the underlying.
  • quantity - Number of contracts (or shares/units) filled.
  • contract_size - Multiplier converting contracts to underlying units (e.g. 100 for standard equity options). Use Decimal::ONE for spot.

Required Methods§

Source

fn compute_fee( &self, price: Decimal, quantity: Decimal, contract_size: Decimal, ) -> Decimal

Implementors§