nt_execution/
lime_broker.rs1use crate::broker::{
8 Account, BrokerClient, BrokerError, HealthStatus, OrderFilter, Position,
9};
10use crate::{OrderRequest, OrderResponse};
11use async_trait::async_trait;
12
13#[derive(Debug, Clone)]
15pub struct LimeBrokerConfig {
16 pub endpoint: String,
18 pub api_key: String,
20 pub secret: String,
22}
23
24pub struct LimeBroker {
26 config: LimeBrokerConfig,
27}
28
29impl LimeBroker {
30 pub fn new(config: LimeBrokerConfig) -> Self {
32 Self { config }
33 }
34}
35
36#[async_trait]
37impl BrokerClient for LimeBroker {
38 async fn get_account(&self) -> Result<Account, BrokerError> {
39 Err(BrokerError::Other(anyhow::anyhow!(
40 "Lime Brokerage requires institutional FIX protocol access. Please contact Lime Brokerage for integration."
41 )))
42 }
43
44 async fn get_positions(&self) -> Result<Vec<Position>, BrokerError> {
45 Err(BrokerError::Other(anyhow::anyhow!(
46 "Lime Brokerage requires institutional FIX protocol access"
47 )))
48 }
49
50 async fn place_order(&self, _order: OrderRequest) -> Result<OrderResponse, BrokerError> {
51 Err(BrokerError::Other(anyhow::anyhow!(
52 "Lime Brokerage requires institutional FIX protocol access"
53 )))
54 }
55
56 async fn cancel_order(&self, _order_id: &str) -> Result<(), BrokerError> {
57 Err(BrokerError::Other(anyhow::anyhow!(
58 "Lime Brokerage requires institutional FIX protocol access"
59 )))
60 }
61
62 async fn get_order(&self, _order_id: &str) -> Result<OrderResponse, BrokerError> {
63 Err(BrokerError::Other(anyhow::anyhow!(
64 "Lime Brokerage requires institutional FIX protocol access"
65 )))
66 }
67
68 async fn list_orders(&self, _filter: OrderFilter) -> Result<Vec<OrderResponse>, BrokerError> {
69 Err(BrokerError::Other(anyhow::anyhow!(
70 "Lime Brokerage requires institutional FIX protocol access"
71 )))
72 }
73
74 async fn health_check(&self) -> Result<HealthStatus, BrokerError> {
75 Ok(HealthStatus::Unhealthy)
76 }
77}