Crate rpaca

Crate rpaca 

Source
Expand description

§rpaca

A Rust client library for the Alpaca trading API.

This library provides a convenient interface for interacting with the Alpaca API, allowing users to access market data and execute trades programmatically.

§Features

  • Authentication with Alpaca API keys
  • Support for both paper trading and live trading environments
  • Access to market data (stocks, options)
  • Trading functionality (orders, positions, account management)

§Example

use rpaca::auth::{Alpaca, TradingType};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create a new Alpaca client using environment variables
    let client = Alpaca::from_env(TradingType::Paper)?;
     
    // Use the client to interact with the Alpaca API
    // ...
     
    Ok(())
}

Modules§

auth
Authentication module for Alpaca API Authentication module for Alpaca API.
market_data
Market data module for accessing stock and option information Market data module for Alpaca API.
trading
Trading module for managing orders, positions, and account information Trading module for Alpaca API.