Skip to main content

CompositeMarketMakerConfigBuilder

Struct CompositeMarketMakerConfigBuilder 

Source
pub struct CompositeMarketMakerConfigBuilder<S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<S: State> CompositeMarketMakerConfigBuilder<S>

Source

pub fn build(self) -> CompositeMarketMakerConfig
where S: IsComplete,

Finish building and return the requested object

Source

pub fn base( self, value: StrategyConfig, ) -> CompositeMarketMakerConfigBuilder<SetBase<S>>
where S::Base: IsUnset,

Optional (Some / Option setters). Default:

StrategyConfig {
    strategy_id: Some(StrategyId::from("COMPOSITE_MM-001")),
    order_id_tag: Some("001".to_string()),
    ..Default::default()
}

Base strategy configuration.

Source

pub fn maybe_base( self, value: Option<StrategyConfig>, ) -> CompositeMarketMakerConfigBuilder<SetBase<S>>
where S::Base: IsUnset,

Optional (Some / Option setters). Default:

StrategyConfig {
    strategy_id: Some(StrategyId::from("COMPOSITE_MM-001")),
    order_id_tag: Some("001".to_string()),
    ..Default::default()
}

Base strategy configuration.

Source

pub fn instrument_id( self, value: InstrumentId, ) -> CompositeMarketMakerConfigBuilder<SetInstrumentId<S>>
where S::InstrumentId: IsUnset,

Required.

Target instrument the strategy quotes on.

Source

pub fn signal_instrument_id( self, value: InstrumentId, ) -> CompositeMarketMakerConfigBuilder<SetSignalInstrumentId<S>>
where S::SignalInstrumentId: IsUnset,

Required.

Signal instrument that drives the signal skew. Typically a SyntheticInstrument, but any instrument that publishes quotes works.

Source

pub fn trade_size( self, value: Quantity, ) -> CompositeMarketMakerConfigBuilder<SetTradeSize<S>>
where S::TradeSize: IsUnset,

Optional (Some / Option setters). Trade size per quote. When None, resolved from the instrument’s min_quantity during on_start.

Source

pub fn maybe_trade_size( self, value: Option<Quantity>, ) -> CompositeMarketMakerConfigBuilder<SetTradeSize<S>>
where S::TradeSize: IsUnset,

Optional (Some / Option setters). Trade size per quote. When None, resolved from the instrument’s min_quantity during on_start.

Source

pub fn half_spread_bps( self, value: u32, ) -> CompositeMarketMakerConfigBuilder<SetHalfSpreadBps<S>>
where S::HalfSpreadBps: IsUnset,

Optional (Some / Option setters). Default: 5.

Half of the desired quoted spread, in basis points of the anchor. E.g. 5 = 5 bps, so the full quoted spread is 10 bps before skew.

Source

pub fn maybe_half_spread_bps( self, value: Option<u32>, ) -> CompositeMarketMakerConfigBuilder<SetHalfSpreadBps<S>>
where S::HalfSpreadBps: IsUnset,

Optional (Some / Option setters). Default: 5.

Half of the desired quoted spread, in basis points of the anchor. E.g. 5 = 5 bps, so the full quoted spread is 10 bps before skew.

Source

pub fn inventory_skew_factor( self, value: f64, ) -> CompositeMarketMakerConfigBuilder<SetInventorySkewFactor<S>>
where S::InventorySkewFactor: IsUnset,

Optional (Some / Option setters). Default: 0.0.

Inventory skew gain in price units per unit of net position. Both sides shift down by factor * net_position so a long position widens the bid and tightens the ask.

Source

pub fn maybe_inventory_skew_factor( self, value: Option<f64>, ) -> CompositeMarketMakerConfigBuilder<SetInventorySkewFactor<S>>
where S::InventorySkewFactor: IsUnset,

Optional (Some / Option setters). Default: 0.0.

Inventory skew gain in price units per unit of net position. Both sides shift down by factor * net_position so a long position widens the bid and tightens the ask.

Source

pub fn signal_skew_factor( self, value: f64, ) -> CompositeMarketMakerConfigBuilder<SetSignalSkewFactor<S>>
where S::SignalSkewFactor: IsUnset,

Optional (Some / Option setters). Default: 0.0.

Signal skew gain in price units per unit of normalized signal residual. Both sides shift up by factor * residual where residual = (signal_mid - baseline) / baseline.

Source

pub fn maybe_signal_skew_factor( self, value: Option<f64>, ) -> CompositeMarketMakerConfigBuilder<SetSignalSkewFactor<S>>
where S::SignalSkewFactor: IsUnset,

Optional (Some / Option setters). Default: 0.0.

Signal skew gain in price units per unit of normalized signal residual. Both sides shift up by factor * residual where residual = (signal_mid - baseline) / baseline.

Source

pub fn signal_baseline( self, value: f64, ) -> CompositeMarketMakerConfigBuilder<SetSignalBaseline<S>>
where S::SignalBaseline: IsUnset,

Optional (Some / Option setters). Optional baseline price for the signal residual. When None, the first observed signal mid is captured as the baseline. When Some(_), the configured value is used so backtests are deterministic.

Source

pub fn maybe_signal_baseline( self, value: Option<f64>, ) -> CompositeMarketMakerConfigBuilder<SetSignalBaseline<S>>
where S::SignalBaseline: IsUnset,

Optional (Some / Option setters). Optional baseline price for the signal residual. When None, the first observed signal mid is captured as the baseline. When Some(_), the configured value is used so backtests are deterministic.

Source

pub fn max_position( self, value: Quantity, ) -> CompositeMarketMakerConfigBuilder<SetMaxPosition<S>>
where S::MaxPosition: IsUnset,

Required.

Hard cap on net exposure (long or short).

Source

pub fn requote_threshold_bps( self, value: u32, ) -> CompositeMarketMakerConfigBuilder<SetRequoteThresholdBps<S>>
where S::RequoteThresholdBps: IsUnset,

Optional (Some / Option setters). Default: 5.

Minimum movement in basis points of the anchor before re-quoting. Applied to both anchor movement and the signal residual’s price impact (signal_skew_factor * residual); whichever clears the threshold first triggers a requote.

Source

pub fn maybe_requote_threshold_bps( self, value: Option<u32>, ) -> CompositeMarketMakerConfigBuilder<SetRequoteThresholdBps<S>>
where S::RequoteThresholdBps: IsUnset,

Optional (Some / Option setters). Default: 5.

Minimum movement in basis points of the anchor before re-quoting. Applied to both anchor movement and the signal residual’s price impact (signal_skew_factor * residual); whichever clears the threshold first triggers a requote.

Source

pub fn expire_time_secs( self, value: u64, ) -> CompositeMarketMakerConfigBuilder<SetExpireTimeSecs<S>>
where S::ExpireTimeSecs: IsUnset,

Optional (Some / Option setters). Optional order expiry in seconds. When set, orders use GTD time-in-force with expire_time = now + expire_time_secs.

Source

pub fn maybe_expire_time_secs( self, value: Option<u64>, ) -> CompositeMarketMakerConfigBuilder<SetExpireTimeSecs<S>>
where S::ExpireTimeSecs: IsUnset,

Optional (Some / Option setters). Optional order expiry in seconds. When set, orders use GTD time-in-force with expire_time = now + expire_time_secs.

Source

pub fn on_cancel_resubmit( self, value: bool, ) -> CompositeMarketMakerConfigBuilder<SetOnCancelResubmit<S>>
where S::OnCancelResubmit: IsUnset,

Optional (Some / Option setters). Default: false.

When true, resubmit on the next quote tick after an external cancel. Useful for venues that proactively cancel short-term orders.

Source

pub fn maybe_on_cancel_resubmit( self, value: Option<bool>, ) -> CompositeMarketMakerConfigBuilder<SetOnCancelResubmit<S>>
where S::OnCancelResubmit: IsUnset,

Optional (Some / Option setters). Default: false.

When true, resubmit on the next quote tick after an external cancel. Useful for venues that proactively cancel short-term orders.

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<T> Ungil for T
where T: Send,

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more