Expand description
Async Rust client for the ProjectX Gateway API.
This crate models ProjectX’s provider-native HTTP contract. It deliberately
owns no trading-engine concepts, runtime, environment loading, or application
state. Applications authenticate explicitly and translate these types at
their own boundary.
Authenticated REST requests use shared rolling-window admission control.
Safe queries wait asynchronously for capacity, while mutations return
Error::LocallyRateLimited before sending when the local budget is full.
§Example
use projectx_client::{Client, Credentials};
let credentials = Credentials::new("user", "api-key")?;
let client = Client::builder(credentials).build()?;
client.authenticate().await?;
let accounts = client.search_active_accounts().await?;Structs§
- Account
- A
ProjectXaccount. - Account
Id - Validated ProjectX account identifier.
- Application
Credentials ProjectXauthorized-application credentials.- Application
Credentials Builder - Builder for validated
ApplicationCredentials. - Bar
- A historical OHLCV bar.
- Bracket
ProjectXbracket-leg configuration.- Cancel
Order - Order cancellation parameters.
- Client
- Authenticated
ProjectXREST client. - Client
Builder - Builder for
Client. - Close
Contract - Position close parameters.
- Contract
- A
ProjectXfutures contract. - Contract
Id - Validated ProjectX contract identifier.
- Credentials
ProjectXAPI-key credentials.- Decimal
Decimalrepresents a 128 bit representation of a fixed-precision decimal number. The finite set of values of typeDecimalare of the form m / 10e, where m is an integer such that -296 < m < 296, and e is an integer between 0 and 28 inclusive.- Endpoints
- REST and real-time endpoints for one
ProjectXdeployment. - History
Request - Historical-bar request parameters.
- History
Request Builder - Builder for a validated
HistoryRequest. - Market
Depth - Depth-of-market update from the market hub.
- Market
Quote - Sparse quote update from the market hub.
- Market
Trade - Trade print from the market hub.
- Modify
Order - Order modification parameters.
- Modify
Order Builder - Builder for a validated
ModifyOrder. - Operation
Response - Successful response for an operation without a result body.
- Order
- A
ProjectXorder. - OrderId
- Validated ProjectX order identifier.
- Order
Page - One page returned by
Client::query_orders. - Order
Query - Filtered, paginated order-query parameters.
- Order
Query Builder - Builder for a validated
OrderQuery. - Order
Response - Successful order-placement result.
- Order
Search - Historical order search parameters.
- Partial
Close Contract - Partial-position close parameters.
- Place
Order - Order placement parameters.
- Place
Order Builder - Builder for a validated
PlaceOrder. - Position
- A
ProjectXopen position. - Position
Id - Validated ProjectX position identifier.
- Provider
Date - A provider civil date parsed from an ISO-8601
YYYY-MM-DDvalue. - Provider
Date Error - A string was not a valid provider civil date.
- Provider
Error - A provider-declared failed operation.
- Rate
Limit - One rolling-window request limit.
- Rate
Limit Config - Rate limits applied to authenticated
ProjectXREST requests. - Realtime
Client SignalR-over-WebSocket client for oneProjectXhub.- Realtime
Event Receiver - Single-consumer bounded receiver for real-time events.
- Realtime
Generation - Identity of one ready socket, scoped to its owning real-time client.
- Realtime
Message - An observation attributed to the exact socket that produced it.
- Realtime
Session - Subscription and invocation admission bound to one exact ready socket. This handle cannot stop or reconnect the transport and does not keep its owner alive.
- Search
Contracts - Contract search parameters.
- Session
Validator - Guard for a periodic token-validation task.
- SignalR
Invocation - A decoded
SignalRinvocation frame. - Symbol
Id - Validated ProjectX symbol identifier.
- Timestamp
- An absolute provider timestamp parsed from an ISO-8601/RFC-3339 value.
- Timestamp
Error - A string was not a valid absolute provider timestamp.
- Trade
- A
ProjectXexecution trade. - TradeId
- Validated ProjectX trade identifier.
- Trade
Query - Trade search parameters with independently optional timestamp bounds.
- Trade
Query Builder - Builder for a validated
TradeQuery. - Trade
Search - Trade search parameters.
Enums§
- BarUnit
- Historical-bar aggregation unit.
- Depth
Type - A
ProjectXdepth-of-market update kind. - Error
- Errors returned by the
ProjectXclient. - Hub
ProjectXreal-time hub.- Order
Sort By - Field used to sort an
OrderQueryresult page. - Order
Sort Direction - Direction used to sort an
OrderQueryresult page. - Order
Status - A
ProjectXorder lifecycle status. - Order
Type - A
ProjectXorder type. - Position
Type - A
ProjectXposition direction. - Rate
Limit Kind - Identifies one provider REST rate-limit budget.
- Realtime
Error - Errors returned by the real-time transport.
- Realtime
Event - Events emitted by a
RealtimeClient. - Request
Validation Error - Validation failures while constructing a provider request.
- Side
- A
ProjectXorder side. - Trade
LogType - A
ProjectXmarket-trade aggressor classification.