pub struct DeribitFixClient {
pub config: DeribitFixConfig,
/* private fields */
}Expand description
Main Deribit FIX client
Fields§
§config: DeribitFixConfigClient configuration
Implementations§
Source§impl DeribitFixClient
impl DeribitFixClient
Sourcepub async fn new(config: &DeribitFixConfig) -> Result<Self>
pub async fn new(config: &DeribitFixConfig) -> Result<Self>
Create a new Deribit FIX client
Sourcepub async fn disconnect(&mut self) -> Result<()>
pub async fn disconnect(&mut self) -> Result<()>
Disconnect from the server
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if the client is connected
Sourcepub async fn get_session_state(&self) -> Option<SessionState>
pub async fn get_session_state(&self) -> Option<SessionState>
Get the current session state
Sourcepub async fn send_order(&self, order: NewOrderRequest) -> Result<String>
pub async fn send_order(&self, order: NewOrderRequest) -> Result<String>
Send a new order
Sourcepub async fn cancel_order(&self, order_id: String) -> Result<()>
pub async fn cancel_order(&self, order_id: String) -> Result<()>
Cancel an order
Sourcepub async fn cancel_order_with_symbol(
&self,
order_id: String,
symbol: Option<String>,
) -> Result<()>
pub async fn cancel_order_with_symbol( &self, order_id: String, symbol: Option<String>, ) -> Result<()>
Cancel an order with optional symbol specification
§Arguments
order_id- The order identifier (OrigClOrdID) to cancelsymbol- Optional instrument symbol (e.g., “BTC-PERPETUAL”). Required when canceling by ClOrdID or DeribitLabel, but not required when using OrigClOrdID (fastest approach)
Sourcepub async fn subscribe_market_data(&self, symbol: String) -> Result<()>
pub async fn subscribe_market_data(&self, symbol: String) -> Result<()>
Subscribe to market data
Sourcepub async fn get_positions(&self) -> Result<Vec<Position>>
pub async fn get_positions(&self) -> Result<Vec<Position>>
Get account positions
Sourcepub async fn receive_message(&self) -> Result<Option<FixMessage>>
pub async fn receive_message(&self) -> Result<Option<FixMessage>>
Receive and process a message from the server
Auto Trait Implementations§
impl Freeze for DeribitFixClient
impl !RefUnwindSafe for DeribitFixClient
impl Send for DeribitFixClient
impl Sync for DeribitFixClient
impl Unpin for DeribitFixClient
impl !UnwindSafe for DeribitFixClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more