trading-client is a Rust library that provides a convenient wrapper for commonly used trading platform APIs under a single unified interface.
Currently an experimental work in progress that only supports Alpaca.
pub trait TradingClient {
fn new(config: &Config) -> Self
where
Self: Sized;
async fn create_order(&self, order: &Order) -> Result<(), Box<dyn std::error::Error>>; // TODO: OrderResponse
async fn get_asset(&self, symbol: &str) -> Result<Asset, Box<dyn std::error::Error>>;
async fn subscribe_to_data(
&self,
symbol: &str,
) -> std::result::Result<(), Box<dyn std::error::Error>>;
}