Expand description
§Alpaca WebSocket Client
WebSocket client for Alpaca trading platform real-time data. This crate provides real-time market data and trading updates via WebSocket connections.
Re-exports§
pub use client::AlpacaWebSocketClient;pub use client::DataFeed;pub use config::ConnectionState;pub use config::StreamType;pub use config::WebSocketConfig;pub use error::WebSocketError;pub use messages::*;pub use streams::*;
Modules§
- auth
- Authentication types and utilities.
- client
- WebSocket client for Alpaca streaming data.
- config
- WebSocket configuration types.
- error
- WebSocket-specific error types.
- messages
- WebSocket message types for Alpaca streaming.
- streams
- Stream types for WebSocket data.
- types
- Core API types and data structures. Core types for the Alpaca API.
- utils
- Utility functions and helpers. Utility functions and helpers for the Alpaca API.
Structs§
- Account
- Account information from Alpaca API.
- Account
Activity - Account activity
- Account
Document - Account document/statement.
- Account
Status Event - Account status event from SSE stream.
- AchRelationship
- ACH relationship.
- Agreement
- Agreement for broker account.
- ApiError
Response - Detailed API error response from Alpaca.
- Asset
- Asset information.
- Auction
- Auction data.
- Bar
- Market data bar
- Batch
Journal Entry - Batch journal entry.
- Borrow
Rate - Borrow rate information for short selling.
- Broker
Account - Broker account.
- Broker
Crypto Wallet - Broker crypto wallet for Broker API.
- Broker
Trade Event - Trade event from SSE stream.
- Buying
Power Calculator - Buying power calculation helper.
- Calendar
- Calendar information
- Calendar
Day - Enhanced calendar day information.
- Calendar
Params - Calendar query parameters.
- CipInfo
- CIP (Customer Identification Program) info.
- Clock
- Clock information
- Close
Position Params - Close position request.
- Contact
- Contact information for broker account.
- Corporate
Action - Corporate action announcement.
- Corporate
Action Announcement - Corporate action announcement.
- Corporate
Actions Params - Parameters for corporate actions request.
- Create
AchRelationship Request - Request to create an ACH relationship.
- Create
Batch Journal Request - Request to create batch journal entries.
- Create
Broker Account Request - Request to create a broker account.
- Create
Crypto Transfer Request - Request to create a crypto transfer.
- Create
Crypto Wallet Request - Request to create a crypto wallet.
- Create
Crypto Whitelist Request - Request to add a whitelisted address.
- Create
IraContribution Request - IRA contribution request.
- Create
IraDistribution Request - IRA distribution request.
- Create
Journal Request - Request to create a journal entry.
- Create
Transfer Request - Request to create a transfer.
- Create
Wire Bank Request - Request to create a wire bank.
- Credentials
- Authentication credentials for Alpaca API.
- Crypto
Bar - Crypto bar data.
- Crypto
Bars Params - Parameters for crypto bars request.
- Crypto
Orderbook - Crypto orderbook.
- Crypto
Orderbook Entry - Crypto orderbook entry.
- Crypto
Quote - Crypto quote data.
- Crypto
Snapshot - Crypto snapshot with current price data.
- Crypto
Trade - Crypto trade data.
- Crypto
Transfer - Crypto transfer.
- Crypto
Wallet - Crypto wallet
- Crypto
Whitelist Address - Whitelisted crypto address.
- Currency
Pair - Currency pair for exchange rate queries.
- Disclosures
- Disclosures for broker account.
- Document
- Document for broker account.
- Document
Params - Document query parameters.
- Enhanced
Asset - Enhanced asset with all fields.
- Enhanced
News Article - Enhanced news article with images and additional fields.
- Environment
Guard - Environment safety guard.
- Exchange
Rate - Exchange rate between two currencies.
- FixSequence
Numbers - FIX sequence numbers.
- FixSession
Config - FIX session configuration.
- Fractional
Qty - Fractional quantity with precision.
- Fractional
Validator - Fractional trading validation.
- Identity
- Identity information for broker account.
- IraBeneficiary
- IRA beneficiary.
- IraContribution
- IRA contribution.
- IraDistribution
- IRA distribution.
- Journal
- Journal entry.
- Journal
Status Event - Journal status event from SSE stream.
- LctPosition
- Local currency position values.
- List
Activities Params - Parameters for listing account activities.
- List
Announcements Params - Parameters for listing corporate action announcements.
- List
Assets Params - Parameters for listing assets.
- List
Broker Accounts Params - Parameters for listing broker accounts.
- List
Journals Params - Parameters for listing journals.
- List
Transfers Params - Parameters for listing transfers.
- Locate
Request - Locate request for short selling.
- Locate
Response - Locate response for short selling.
- Luld
- Limit Up Limit Down (LULD) data.
- Margin
Info - Margin information for an account.
- Margin
Requirement - Margin requirement for a position.
- Market
Clock - Enhanced market clock information.
- Multi
Bars Params - Parameters for multi-symbol bars request.
- Multi
Quotes Params - Parameters for multi-symbol quotes request.
- Multi
Trades Params - Parameters for multi-symbol trades request.
- News
Article - News article
- News
Image - News image.
- News
Params - Parameters for news request.
- News
Source - News source.
- NonTrade
Activity - Non-trade activity with detailed fields.
- NonTrade
Activity Event - Non-trade activity event from SSE stream.
- Notional
Amount - Notional order amount (dollar-based).
- OAuth
Config - OAuth 2.0 configuration.
- OAuth
Revoke Request - Request to revoke a token.
- OAuth
Token - OAuth token for API access.
- OAuth
Token Request - Request to exchange authorization code for token.
- Option
Bar - Option bar (OHLCV) data.
- Option
Bars Params - Parameters for querying option bars.
- Option
Chain Entry - Options chain entry for a specific strike/expiration.
- Option
Contract - Option contract information.
- Option
Contract Asset - Option contract asset.
- Option
Contract Params - Parameters for querying option contracts.
- Option
Exercise Request - Request to exercise an option.
- Option
Greeks - Option Greeks for pricing and risk analysis.
- Option
Quote - Option quote data.
- Option
Snapshot - Option snapshot with latest quote, trade, and greeks.
- Option
Trade - Option trade data.
- Options
Approval - Options approval status response.
- Options
Approval Request - Options approval request for an account.
- Order
- Order information.
- Paginated
Response - Response wrapper with pagination information
- Pagination
- Pagination parameters for API requests
- Paper
Trading Config - Paper trading configuration.
- Portfolio
History - Portfolio history
- Portfolio
History Params - Parameters for portfolio history.
- Position
- Position information
- Quote
- Market data quote
- Rate
Limit Config - Rate limit configuration.
- Rate
Limit Info - Rate limit information from API response headers.
- Rate
Limit Status - Rate limit information from response headers.
- Rate
Limiter - Rate limiter for API requests
- Rebalance
Portfolio - Rebalance portfolio.
- Rebalance
Portfolio Request - Rebalance portfolio request.
- Rebalance
Run - Rebalance run result.
- Rebalance
RunRequest - Rebalance run request.
- Reset
Account Request - Paper trading account reset request.
- Retry
Config - Retry configuration for API requests
- Short
Position - Short position information.
- SseEvent
Params - Parameters for SSE event stream.
- Stock
Snapshot - Stock snapshot with latest market data.
- Stop
Loss - Stop loss configuration for bracket orders.
- Take
Profit - Take profit configuration for bracket orders.
- Target
Allocation - Target allocation for rebalancing.
- TaxDocument
- Tax document.
- Trade
- Market data trade
- Trade
Activity - Trade activity with detailed fields.
- Trade
Confirmation - Trade confirmation document.
- Trading
Day - Trading day utilities.
- Trading
Status - Trading status update.
- Transfer
- Transfer.
- Transfer
Status Event - Transfer status event from SSE stream.
- Trusted
Contact - Trusted contact for broker account.
- Update
Broker Account Request - Request to update a broker account.
- UrlBuilder
- URL builder helper
- Validation
Error - Validation error for a specific field.
- Watchlist
- Watchlist information
- Wire
Bank - Wire bank details.
Enums§
- Account
Status - Account status.
- Account
Status Event Type - Account status event type.
- AchRelationship
Status - ACH relationship status.
- Activity
Type - Activity type
- Agreement
Type - Agreement type for broker accounts.
- Alpaca
Error - Error types for the Alpaca API client.
- ApiError
Code - Alpaca-specific API error codes.
- Asset
Attribute - Asset attribute.
- Asset
Class - Asset class.
- Asset
Exchange - Asset exchange.
- Asset
Status - Asset status.
- Bank
Account Type - Bank account type.
- Broker
Account Status - Broker account status.
- Broker
SseEvent - SSE event wrapper for all broker events.
- Corporate
Action Type - Corporate action type.
- Crypto
Chain - Crypto blockchain chain.
- Crypto
Transfer Direction - Crypto transfer direction.
- Crypto
Transfer Status - Crypto transfer status.
- Crypto
Wallet Status - Crypto wallet status.
- Currency
- Supported currencies for Local Currency Trading.
- Document
Type - Document type for KYC.
- Environment
- Trading environment for Alpaca API.
- FixMsg
Type - FIX message type.
- FixSession
State - FIX session state.
- FixVersion
- FIX protocol version.
- Fractional
Order Restriction - Fractional order type restrictions.
- Funding
Source - Funding source for broker accounts.
- IraAccount
Type - IRA account type.
- Journal
Entry Type - Journal entry type.
- Journal
Status - Journal status.
- Journal
Status Event Type - Journal status event type.
- Market
Session - Market session type.
- News
Content Type - News content type.
- News
Image Size - News image size.
- NonTrade
Activity Type - Non-trade activity event type.
- OAuth
Scope - OAuth 2.0 scope.
- Option
Style - Option style (American or European).
- Option
Type - Option type (call or put).
- Options
Approval Level - Options trading approval level.
- Options
Approval Status - Options approval status.
- Order
Class - Order class.
- Order
Query Status - Order query status filter.
- Order
Side - Order side.
- Order
Status - Order status
- Order
Type - Order type.
- PdtStatus
- Pattern day trader status.
- Portfolio
Period - Portfolio history period.
- Portfolio
Timeframe - Portfolio history timeframe.
- Position
Intent - Position intent for options orders.
- Position
Side - Position side
- Rebalance
Status - Rebalance status.
- Request
Priority - Request priority for queue management.
- Sort
Direction - Sort direction for order queries.
- Statement
Type - Statement document type.
- TaxForm
Type - Tax form type.
- TaxId
Type - Tax ID type.
- Time
InForce - Time in force for orders.
- Timeframe
- Timeframe for market data
- Trading
Environment - Trading environment.
- Transfer
Direction - Transfer direction.
- Transfer
Status - Transfer status.
- Transfer
Status Event Type - Transfer status event type.
- Transfer
Type - Transfer type.
Functions§
- format_
decimal - Format decimal value to string with specified precision
- generate_
client_ order_ id - Generate a random client order ID
- init_
logger - Logger configuration
- parse_
decimal - Parse a string to a decimal value with validation
- parse_
rfc3339 - Parse RFC3339 timestamp
- timestamp_
to_ rfc3339 - Convert timestamp to RFC3339 format
- validate_
price - Validate price value
- validate_
quantity - Validate quantity value
- validate_
symbol - Validate symbol format
Type Aliases§
- Result
- Result type for Alpaca API operations.