1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! Massive (formerly Polygon.io) market data connectors.
//!
//! Provides access to institutional-grade market data across all major asset classes:
//! stocks, options, indices, forex, crypto, and futures.
//!
//! # Testing Status
//!
//! **Partially integration-tested.** We have a currencies subscription (crypto + forex)
//! but not stocks, options, indices, or futures subscriptions. Verified endpoints:
//!
//! - ✅ REST aggregates (crypto, forex, stocks, options, futures via free tier)
//! - ✅ REST tick trades (crypto)
//! - ✅ REST quotes (forex)
//! - ✅ WebSocket streaming (crypto)
//! - ✅ Reference data (tickers, exchanges, market status, holidays)
//! - ✅ Corporate actions (dividends, splits)
//! - ✅ Options contracts reference data (free tier)
//! - ❌ Options snapshots with Greeks — requires Options Starter subscription
//! - ❌ REST aggregates (indices) — requires indices subscription
//! - ❌ REST tick trades (stocks) — requires stocks subscription
//! - ❌ REST quotes (stocks) — requires stocks subscription
//! - ❌ WebSocket (stocks) — requires stocks subscription
//!
//! Unit tests for JSON transformation live inline in `reference.rs`, `options.rs`,
//! and `transformer.rs`. Live API integration tests are in `tests/massive_integration.rs`.
//!
//! # Architecture
//!
//! - [`MassiveRestClient`]: Historical and intraday data via REST API
//! - [`MassiveLive`]: Real-time streaming via WebSocket
//!
//! # Authentication
//!
//! Requires `MASSIVE_API_KEY` environment variable from an active Massive subscription.
//! Get your API key from: <https://massive.com/dashboard/api-keys>
//!
//! # Symbol Conventions
//!
//! **Important**: REST API and WebSocket use different symbol formats!
//!
//! ## REST API Symbols
//!
//! - `X:BTCUSD` — Crypto
//! - `C:EURUSD` — Forex
//! - `O:AAPL251219C00150000` — Options
//! - `I:SPX` — Indices
//! - `AAPL` — Stocks
//!
//! ## WebSocket Symbols
//!
//! - `BTC-USD` — Crypto (hyphenated)
//! - `EUR-USD` — Forex (hyphenated)
//! - `O:AAPL251219C00150000` — Options
//! - `AAPL` — Stocks
//!
//! # Examples
//!
//! ## REST Client
//!
//! ```ignore
//! use rustrade_data::exchange::massive::MassiveRestClient;
//!
//! let client = MassiveRestClient::from_env()?;
//! let candles = client.fetch_aggregates("X:BTCUSD", 1, "minute", from, to).await?;
//! ```
//!
//! ## WebSocket Client
//!
//! ```ignore
//! use rustrade_data::exchange::massive::{MassiveLive, Market, ChannelType};
//! use std::collections::HashMap;
//!
//! let instruments = HashMap::from([("BTC-USD".into(), "btc".into())]);
//! let mut client = MassiveLive::from_env(Market::Crypto, ExchangeId::Massive, instruments)?;
//! client.subscribe(&["BTC-USD"], ChannelType::Trade);
//! let stream = client.start().await?;
//! ```
pub
pub
pub
pub
pub
pub use MassiveError;
pub use ;
pub use ;
pub use ;
pub use MassiveRestClient;
pub use FairMarketValue;