Skip to main content

InstrumentSizingError

Enum InstrumentSizingError 

Source
pub enum InstrumentSizingError {
Show 15 variants Sizing(SizingError), UnsupportedInstrumentSizing { quantity_unit: QuantityUnit, pnl_model: EconomicsModelId, }, MissingNativeToAccountRate, InvalidNativeToAccountRate { value: f64, }, ExactDecimalOutOfRange { field: &'static str, value: Decimal, }, UnsupportedQuantityGridOrigin { value: Decimal, }, QuantityBoundOffGrid { field: &'static str, value: Decimal, }, InvalidQuantityBounds { minimum: Decimal, maximum: Decimal, }, QuantityStepOverflow { field: &'static str, value: Decimal, }, InvalidQuantityGrid(GridError), PriceOffGrid { field: &'static str, value: Decimal, }, UnsupportedNotionalAsset { notional_asset: AssetId, settlement_asset: AssetId, }, BelowMinimumNotional { notional: Decimal, minimum: Decimal, }, AboveMaximumNotional { notional: Decimal, maximum: Decimal, }, ExactArithmetic(DecimalError),
}
Expand description

Catalog-backed sizing failures.

Variants§

§

Sizing(SizingError)

Existing policy, price, or floating-point sizing validation failed.

§

UnsupportedInstrumentSizing

The instrument quantity and P&L model combination is not supported by this sizing path.

Fields

§quantity_unit: QuantityUnit

Instrument quantity unit.

§pnl_model: EconomicsModelId

Instrument P&L model.

§

MissingNativeToAccountRate

Catalog-backed monetary sizing did not receive a native-to-account conversion rate.

§

InvalidNativeToAccountRate

The supplied native-to-account conversion rate is not usable.

Fields

§value: f64

Invalid conversion rate.

§

ExactDecimalOutOfRange

The exact instrument decimal cannot be represented as a finite f64.

Fields

§field: &'static str

Instrument field being converted.

§value: Decimal

Exact value that could not be converted.

§

UnsupportedQuantityGridOrigin

The quantity grid origin is incompatible with the retained zero-based lot-step result.

Fields

§value: Decimal

Unsupported grid origin.

§

QuantityBoundOffGrid

An exact quantity bound is not on the declared quantity grid.

Fields

§field: &'static str

Quantity bound field.

§value: Decimal

Off-grid exact quantity.

§

InvalidQuantityBounds

The exact quantity bounds are inconsistent.

Fields

§minimum: Decimal

Minimum standard-lot quantity.

§maximum: Decimal

Maximum standard-lot quantity.

§

QuantityStepOverflow

An exact quantity bound cannot be represented as a supported lot-step count.

Fields

§field: &'static str

Quantity bound field.

§value: Decimal

Exact quantity that overflowed.

§

InvalidQuantityGrid(GridError)

Exact quantity-grid arithmetic failed.

§

PriceOffGrid

A replay price is outside the declared price grid.

Fields

§field: &'static str

Price field being validated.

§value: Decimal

Exact off-grid value.

§

UnsupportedNotionalAsset

The notional asset is unsupported by the current quote-linear sizing model.

Fields

§notional_asset: AssetId

Declared notional asset.

§settlement_asset: AssetId

Instrument settlement asset.

§

BelowMinimumNotional

Exact final notional is below the declared minimum.

Fields

§notional: Decimal

Calculated final notional.

§minimum: Decimal

Required minimum.

§

AboveMaximumNotional

Exact final notional exceeds the declared maximum.

Fields

§notional: Decimal

Calculated final notional.

§maximum: Decimal

Allowed maximum.

§

ExactArithmetic(DecimalError)

Exact catalog arithmetic failed.

Trait Implementations§

Source§

impl Clone for InstrumentSizingError

Source§

fn clone(&self) -> InstrumentSizingError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InstrumentSizingError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for InstrumentSizingError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for InstrumentSizingError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<DecimalError> for InstrumentSizingError

Source§

fn from(source: DecimalError) -> Self

Converts to this type from the input type.
Source§

impl From<GridError> for InstrumentSizingError

Source§

fn from(source: GridError) -> Self

Converts to this type from the input type.
Source§

impl From<SizingError> for InstrumentSizingError

Source§

fn from(source: SizingError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for InstrumentSizingError

Source§

fn eq(&self, other: &InstrumentSizingError) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for InstrumentSizingError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V