use crate::broker::{
Account, BrokerClient, BrokerError, HealthStatus, OrderFilter, Position,
};
use crate::{OrderRequest, OrderResponse};
use async_trait::async_trait;
#[derive(Debug, Clone)]
pub struct LimeBrokerConfig {
pub endpoint: String,
pub api_key: String,
pub secret: String,
}
pub struct LimeBroker {
config: LimeBrokerConfig,
}
impl LimeBroker {
pub fn new(config: LimeBrokerConfig) -> Self {
Self { config }
}
}
#[async_trait]
impl BrokerClient for LimeBroker {
async fn get_account(&self) -> Result<Account, BrokerError> {
Err(BrokerError::Other(anyhow::anyhow!(
"Lime Brokerage requires institutional FIX protocol access. Please contact Lime Brokerage for integration."
)))
}
async fn get_positions(&self) -> Result<Vec<Position>, BrokerError> {
Err(BrokerError::Other(anyhow::anyhow!(
"Lime Brokerage requires institutional FIX protocol access"
)))
}
async fn place_order(&self, _order: OrderRequest) -> Result<OrderResponse, BrokerError> {
Err(BrokerError::Other(anyhow::anyhow!(
"Lime Brokerage requires institutional FIX protocol access"
)))
}
async fn cancel_order(&self, _order_id: &str) -> Result<(), BrokerError> {
Err(BrokerError::Other(anyhow::anyhow!(
"Lime Brokerage requires institutional FIX protocol access"
)))
}
async fn get_order(&self, _order_id: &str) -> Result<OrderResponse, BrokerError> {
Err(BrokerError::Other(anyhow::anyhow!(
"Lime Brokerage requires institutional FIX protocol access"
)))
}
async fn list_orders(&self, _filter: OrderFilter) -> Result<Vec<OrderResponse>, BrokerError> {
Err(BrokerError::Other(anyhow::anyhow!(
"Lime Brokerage requires institutional FIX protocol access"
)))
}
async fn health_check(&self) -> Result<HealthStatus, BrokerError> {
Ok(HealthStatus::Unhealthy)
}
}