Struct DeribitFixConfig

Source
pub struct DeribitFixConfig {
Show 23 fields pub username: String, pub password: String, pub host: String, pub port: u16, pub use_ssl: bool, pub test_mode: bool, pub heartbeat_interval: u32, pub connection_timeout: Duration, pub reconnect_attempts: u32, pub reconnect_delay: Duration, pub enable_logging: bool, pub log_level: String, pub sender_comp_id: String, pub target_comp_id: String, pub cancel_on_disconnect: bool, pub app_id: Option<String>, pub app_secret: Option<String>, pub use_wordsafe_tags: Option<bool>, pub deribit_sequential: Option<bool>, pub unsubscribe_execution_reports: Option<bool>, pub connection_only_execution_reports: Option<bool>, pub report_fills_as_exec_reports: Option<bool>, pub display_increment_steps: Option<bool>,
}
Expand description

Configuration for the Deribit FIX client

Fields§

§username: String

Deribit username

§password: String

Deribit password

§host: String

FIX server host (default: www.deribit.com for production, test.deribit.com for test)

§port: u16

FIX server port (default: 9881 for test, 9880 for production)

§use_ssl: bool

Whether to use SSL connection (default: false for raw TCP)

§test_mode: bool

Whether to use test environment

§heartbeat_interval: u32

Heartbeat interval in seconds (default: 30)

§connection_timeout: Duration

Connection timeout in seconds (default: 10)

§reconnect_attempts: u32

Reconnection attempts (default: 3)

§reconnect_delay: Duration

Reconnection delay in seconds (default: 5)

§enable_logging: bool

Enable logging (default: true)

§log_level: String

Log level filter

§sender_comp_id: String

Sender company ID for FIX messages

§target_comp_id: String

Target company ID for FIX messages (DERIBITSERVER)

§cancel_on_disconnect: bool

Cancel orders on disconnect (default: false)

§app_id: Option<String>

Application ID for registered applications

§app_secret: Option<String>

Application secret for registered applications

§use_wordsafe_tags: Option<bool>

Use word-safe tags (custom tags start at 5000 instead of 100000)

§deribit_sequential: Option<bool>

Enable sequential FIX messaging (single queue for all messages)

§unsubscribe_execution_reports: Option<bool>

Unsubscribe from notificational Execution Reports

§connection_only_execution_reports: Option<bool>

Receive Execution Reports only for orders created in this connection

§report_fills_as_exec_reports: Option<bool>

Report fills as Execution Reports with ExecType = F(TRADE)

§display_increment_steps: Option<bool>

Include price increment steps in symbol entries

Implementations§

Source§

impl DeribitFixConfig

Source

pub fn new() -> Self

Create a new configuration from environment variables with optional username and password

Source

pub fn with_credentials(self, username: String, password: String) -> Self

Set credentials

Source

pub fn production() -> Self

Create configuration for production environment

Source

pub fn production_with_credentials(username: String, password: String) -> Self

Create configuration for production environment with credentials

Source

pub fn production_ssl() -> Self

Create configuration for production environment with SSL

Source

pub fn test_ssl() -> Self

Create configuration for test environment with SSL

Source

pub fn with_endpoint(self, host: String, port: u16) -> Self

Set custom host and port

Source

pub fn with_ssl(self, use_ssl: bool) -> Self

Enable or disable SSL

Source

pub fn with_heartbeat_interval(self, interval: u32) -> Self

Set heartbeat interval

Source

pub fn with_connection_timeout(self, timeout: Duration) -> Self

Set connection timeout

Source

pub fn with_reconnection(self, attempts: u32, delay: Duration) -> Self

Set reconnection parameters

Source

pub fn with_logging(self, enabled: bool, level: String) -> Self

Set logging configuration

Source

pub fn with_session_ids( self, sender_comp_id: String, target_comp_id: String, ) -> Self

Set FIX session identifiers

Source

pub fn with_cancel_on_disconnect(self, cancel_on_disconnect: bool) -> Self

Set cancel on disconnect behavior

Source

pub fn with_app_credentials(self, app_id: String, app_secret: String) -> Self

Set application credentials for registered applications

Source

pub fn with_use_wordsafe_tags(self, use_wordsafe_tags: bool) -> Self

Set whether to use word-safe tags (custom tags start at 5000 instead of 100000)

Source

pub fn with_deribit_sequential(self, deribit_sequential: bool) -> Self

Set whether to enable sequential FIX messaging (single queue for all messages)

Source

pub fn with_unsubscribe_execution_reports(self, unsubscribe: bool) -> Self

Set whether to unsubscribe from notificational Execution Reports

Source

pub fn with_connection_only_execution_reports( self, connection_only: bool, ) -> Self

Set whether to receive Execution Reports only for orders created in this connection

Source

pub fn with_report_fills_as_exec_reports(self, report_fills: bool) -> Self

Set whether to report fills as Execution Reports with ExecType = F(TRADE)

Source

pub fn with_display_increment_steps(self, display_steps: bool) -> Self

Set whether to include price increment steps in symbol entries

Source

pub fn connection_url(&self) -> String

Get the connection URL

Source

pub fn validate(&self) -> Result<()>

Validate the configuration

Trait Implementations§

Source§

impl Clone for DeribitFixConfig

Source§

fn clone(&self) -> DeribitFixConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for DeribitFixConfig

Source§

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

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

impl Default for DeribitFixConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for DeribitFixConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for DeribitFixConfig

Source§

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

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

impl Serialize for DeribitFixConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> Instrument for T

Source§

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

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

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.

Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

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

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,