pub struct FinFeedDataClient { /* private fields */ }Expand description
Prediction-market data client for requests and book, quote, trade, and bar polling subscriptions. Execution is unsupported. The injected sender supports standalone clients and runtime dispatch.
§Connection Lifecycle
Startup publishes every selected definition before readiness. Disconnect closes task admission and response publication before draining work. Reconnect uses fresh transport and instrument state after the previous generation drains.
§Polling Subscriptions
- Quotes and trades share sampled latest-activity polls.
- L2 MBP deltas and depth share validated current-book snapshots.
- Bars publish periods closing after subscribe time, with a cutoff taken before each request.
Their publication watermark survives reconnects. Provider OHLCV maps to
LASTfor compatibility; trade-only price provenance is unverified.
Polling guarantees neither completeness nor backfill.
§Market Status and Definition Refreshes
Fresh definition requests apply provider lifecycle metadata and publish instrument updates and correlated responses.
ClosedandResolvedend all polling subscriptions and reject new ones for that outcome.OpenandSuspendedkeep polling.
If any selected definition fails to refresh, list refreshes preserve loaded definitions and
outcome ownership. Historical requests remain available for loaded terminal definitions.
The client infers no InstrumentStatus or InstrumentClose event.
§Historical Requests
Historical series require a start and share the configured attempt budget.
- Trades and quotes retrieve covering UTC hours with checked overlapping continuation, then filter and order records by exposed timestamps. Completeness under provider processing-time selection remains unverified.
- Quotes use entry time for
ts_eventand receive time forts_init. - Trades use their sole timestamp for both fields and infer no aggressor side.
- Bars continue from validated period ends, including short nonempty pages, and emit only complete external OHLCV periods contained in the requested window.
§Historical Books
Historical L2 books use hour-boundary selectors with checked overlapping continuation and replay returned records from a snapshot seed assumed to be complete. Source coverage, bounded timestamp delay, and continuity remain assumptions.
- Numeric actions
0,1, and3mean relative ADD, absolute SET, and replacement snapshot. - Source order and exchange timestamps are preserved. Each completed group’s derived
ts_initis the cumulative maximum of processing clocks when present and exchange clocks otherwise. Seed placement and window bounds use this ordering clock, not measured receipt time. - Series begin with a generated replacement at start. Point snapshots select an
endtimestamp in request params. - Changed or noncontiguous overlap, nonprogress, exhausted allowance, missing seeds, rewound lower selectors at or past their hourly upper bound, and unsupported actions fail without partial delivery.
§Validation and Failures
Current books are validated atomically. Prices and raw sizes must fit the loaded definition exactly; OHLCV volumes allow bounded normalization of numeric tails at size precision. Asynchronous failures log an error and publish no response. Synchronous validation failures return an error.
Implementations§
Source§impl FinFeedDataClient
impl FinFeedDataClient
Sourcepub fn new(
client_id: ClientId,
config: FinFeedDataClientConfig,
sender: EventSender<DataEvent>,
) -> Result<Self>
pub fn new( client_id: ClientId, config: FinFeedDataClientConfig, sender: EventSender<DataEvent>, ) -> Result<Self>
Constructs a disconnected client with explicit event plumbing.
The bootstrap deadline must be in [1, 86400] seconds. Poll spacing must be in
[100, 86400000] milliseconds and the per-list poll limit in [1, 10000].
§Errors
Returns an error if:
- Selections, credentials, REST controls, the bootstrap deadline, or polling bounds are invalid.
- Neither an explicit key nor
FINFEED_API_KEYis available.
Trait Implementations§
Source§impl DataClient for FinFeedDataClient
impl DataClient for FinFeedDataClient
Source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
true if the client is currently connected.Source§fn is_disconnected(&self) -> bool
fn is_disconnected(&self) -> bool
true if the client is currently disconnected.Source§fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn request_instrument(&self, request: RequestInstrument) -> Result<()>
fn request_instrument(&self, request: RequestInstrument) -> Result<()>
Source§fn request_instruments(&self, request: RequestInstruments) -> Result<()>
fn request_instruments(&self, request: RequestInstruments) -> Result<()>
Source§fn request_book_snapshot(&self, request: RequestBookSnapshot) -> Result<()>
fn request_book_snapshot(&self, request: RequestBookSnapshot) -> Result<()>
Source§fn request_quotes(&self, request: RequestQuotes) -> Result<()>
fn request_quotes(&self, request: RequestQuotes) -> Result<()>
Source§fn request_trades(&self, request: RequestTrades) -> Result<()>
fn request_trades(&self, request: RequestTrades) -> Result<()>
Source§fn request_bars(&self, request: RequestBars) -> Result<()>
fn request_bars(&self, request: RequestBars) -> Result<()>
Source§fn subscribe_bars(&mut self, cmd: SubscribeBars) -> Result<()>
fn subscribe_bars(&mut self, cmd: SubscribeBars) -> Result<()>
Source§fn unsubscribe_bars(&mut self, cmd: &UnsubscribeBars) -> Result<()>
fn unsubscribe_bars(&mut self, cmd: &UnsubscribeBars) -> Result<()>
Source§fn subscribe_book_deltas(&mut self, cmd: SubscribeBookDeltas) -> Result<()>
fn subscribe_book_deltas(&mut self, cmd: SubscribeBookDeltas) -> Result<()>
Source§fn subscribe_book_depth(&mut self, cmd: SubscribeBookDepth) -> Result<()>
fn subscribe_book_depth(&mut self, cmd: SubscribeBookDepth) -> Result<()>
Source§fn unsubscribe_book_deltas(&mut self, cmd: &UnsubscribeBookDeltas) -> Result<()>
fn unsubscribe_book_deltas(&mut self, cmd: &UnsubscribeBookDeltas) -> Result<()>
Source§fn unsubscribe_book_depth(&mut self, cmd: &UnsubscribeBookDepth) -> Result<()>
fn unsubscribe_book_depth(&mut self, cmd: &UnsubscribeBookDepth) -> Result<()>
Source§fn subscribe_quotes(&mut self, cmd: SubscribeQuotes) -> Result<()>
fn subscribe_quotes(&mut self, cmd: SubscribeQuotes) -> Result<()>
Source§fn subscribe_trades(&mut self, cmd: SubscribeTrades) -> Result<()>
fn subscribe_trades(&mut self, cmd: SubscribeTrades) -> Result<()>
Source§fn unsubscribe_quotes(&mut self, cmd: &UnsubscribeQuotes) -> Result<()>
fn unsubscribe_quotes(&mut self, cmd: &UnsubscribeQuotes) -> Result<()>
Source§fn unsubscribe_trades(&mut self, cmd: &UnsubscribeTrades) -> Result<()>
fn unsubscribe_trades(&mut self, cmd: &UnsubscribeTrades) -> Result<()>
Source§fn request_data(&self, _request: RequestCustomData) -> Result<()>
fn request_data(&self, _request: RequestCustomData) -> Result<()>
Source§fn request_book_depth(&self, request: RequestBookDepth) -> Result<()>
fn request_book_depth(&self, request: RequestBookDepth) -> Result<()>
Source§fn request_book_deltas(&self, request: RequestBookDeltas) -> Result<()>
fn request_book_deltas(&self, request: RequestBookDeltas) -> Result<()>
Source§fn request_funding_rates(&self, _request: RequestFundingRates) -> Result<()>
fn request_funding_rates(&self, _request: RequestFundingRates) -> Result<()>
Source§fn request_option_chain_reference_price(
&self,
_request: RequestOptionChainReferencePrice,
) -> Result<()>
fn request_option_chain_reference_price( &self, _request: RequestOptionChainReferencePrice, ) -> Result<()>
§fn subscribe(&mut self, cmd: SubscribeCustomData) -> Result<(), Error>
fn subscribe(&mut self, cmd: SubscribeCustomData) -> Result<(), Error>
§fn subscribe_instruments(
&mut self,
cmd: SubscribeInstruments,
) -> Result<(), Error>
fn subscribe_instruments( &mut self, cmd: SubscribeInstruments, ) -> Result<(), Error>
§fn subscribe_instrument(
&mut self,
cmd: SubscribeInstrument,
) -> Result<(), Error>
fn subscribe_instrument( &mut self, cmd: SubscribeInstrument, ) -> Result<(), Error>
§fn subscribe_mark_prices(
&mut self,
cmd: SubscribeMarkPrices,
) -> Result<(), Error>
fn subscribe_mark_prices( &mut self, cmd: SubscribeMarkPrices, ) -> Result<(), Error>
§fn subscribe_index_prices(
&mut self,
cmd: SubscribeIndexPrices,
) -> Result<(), Error>
fn subscribe_index_prices( &mut self, cmd: SubscribeIndexPrices, ) -> Result<(), Error>
§fn subscribe_funding_rates(
&mut self,
cmd: SubscribeFundingRates,
) -> Result<(), Error>
fn subscribe_funding_rates( &mut self, cmd: SubscribeFundingRates, ) -> Result<(), Error>
§fn subscribe_instrument_status(
&mut self,
cmd: SubscribeInstrumentStatus,
) -> Result<(), Error>
fn subscribe_instrument_status( &mut self, cmd: SubscribeInstrumentStatus, ) -> Result<(), Error>
§fn subscribe_instrument_close(
&mut self,
cmd: SubscribeInstrumentClose,
) -> Result<(), Error>
fn subscribe_instrument_close( &mut self, cmd: SubscribeInstrumentClose, ) -> Result<(), Error>
§fn subscribe_option_greeks(
&mut self,
cmd: SubscribeOptionGreeks,
) -> Result<(), Error>
fn subscribe_option_greeks( &mut self, cmd: SubscribeOptionGreeks, ) -> Result<(), Error>
§fn subscribe_blocks(&mut self, cmd: SubscribeBlocks) -> Result<(), Error>
fn subscribe_blocks(&mut self, cmd: SubscribeBlocks) -> Result<(), Error>
§fn subscribe_pool(&mut self, cmd: SubscribePool) -> Result<(), Error>
fn subscribe_pool(&mut self, cmd: SubscribePool) -> Result<(), Error>
§fn subscribe_pool_swaps(&mut self, cmd: SubscribePoolSwaps) -> Result<(), Error>
fn subscribe_pool_swaps(&mut self, cmd: SubscribePoolSwaps) -> Result<(), Error>
§fn subscribe_pool_liquidity_updates(
&mut self,
cmd: SubscribePoolLiquidityUpdates,
) -> Result<(), Error>
fn subscribe_pool_liquidity_updates( &mut self, cmd: SubscribePoolLiquidityUpdates, ) -> Result<(), Error>
§fn subscribe_pool_fee_collects(
&mut self,
cmd: SubscribePoolFeeCollects,
) -> Result<(), Error>
fn subscribe_pool_fee_collects( &mut self, cmd: SubscribePoolFeeCollects, ) -> Result<(), Error>
§fn subscribe_pool_flash_events(
&mut self,
cmd: SubscribePoolFlashEvents,
) -> Result<(), Error>
fn subscribe_pool_flash_events( &mut self, cmd: SubscribePoolFlashEvents, ) -> Result<(), Error>
§fn unsubscribe(&mut self, cmd: &UnsubscribeCustomData) -> Result<(), Error>
fn unsubscribe(&mut self, cmd: &UnsubscribeCustomData) -> Result<(), Error>
§fn unsubscribe_instruments(
&mut self,
cmd: &UnsubscribeInstruments,
) -> Result<(), Error>
fn unsubscribe_instruments( &mut self, cmd: &UnsubscribeInstruments, ) -> Result<(), Error>
§fn unsubscribe_instrument(
&mut self,
cmd: &UnsubscribeInstrument,
) -> Result<(), Error>
fn unsubscribe_instrument( &mut self, cmd: &UnsubscribeInstrument, ) -> Result<(), Error>
§fn unsubscribe_mark_prices(
&mut self,
cmd: &UnsubscribeMarkPrices,
) -> Result<(), Error>
fn unsubscribe_mark_prices( &mut self, cmd: &UnsubscribeMarkPrices, ) -> Result<(), Error>
§fn unsubscribe_index_prices(
&mut self,
cmd: &UnsubscribeIndexPrices,
) -> Result<(), Error>
fn unsubscribe_index_prices( &mut self, cmd: &UnsubscribeIndexPrices, ) -> Result<(), Error>
§fn unsubscribe_funding_rates(
&mut self,
cmd: &UnsubscribeFundingRates,
) -> Result<(), Error>
fn unsubscribe_funding_rates( &mut self, cmd: &UnsubscribeFundingRates, ) -> Result<(), Error>
§fn unsubscribe_instrument_status(
&mut self,
cmd: &UnsubscribeInstrumentStatus,
) -> Result<(), Error>
fn unsubscribe_instrument_status( &mut self, cmd: &UnsubscribeInstrumentStatus, ) -> Result<(), Error>
§fn unsubscribe_instrument_close(
&mut self,
cmd: &UnsubscribeInstrumentClose,
) -> Result<(), Error>
fn unsubscribe_instrument_close( &mut self, cmd: &UnsubscribeInstrumentClose, ) -> Result<(), Error>
§fn unsubscribe_option_greeks(
&mut self,
cmd: &UnsubscribeOptionGreeks,
) -> Result<(), Error>
fn unsubscribe_option_greeks( &mut self, cmd: &UnsubscribeOptionGreeks, ) -> Result<(), Error>
§fn unsubscribe_blocks(&mut self, cmd: &UnsubscribeBlocks) -> Result<(), Error>
fn unsubscribe_blocks(&mut self, cmd: &UnsubscribeBlocks) -> Result<(), Error>
§fn unsubscribe_pool(&mut self, cmd: &UnsubscribePool) -> Result<(), Error>
fn unsubscribe_pool(&mut self, cmd: &UnsubscribePool) -> Result<(), Error>
§fn unsubscribe_pool_swaps(
&mut self,
cmd: &UnsubscribePoolSwaps,
) -> Result<(), Error>
fn unsubscribe_pool_swaps( &mut self, cmd: &UnsubscribePoolSwaps, ) -> Result<(), Error>
§fn unsubscribe_pool_liquidity_updates(
&mut self,
cmd: &UnsubscribePoolLiquidityUpdates,
) -> Result<(), Error>
fn unsubscribe_pool_liquidity_updates( &mut self, cmd: &UnsubscribePoolLiquidityUpdates, ) -> Result<(), Error>
§fn unsubscribe_pool_fee_collects(
&mut self,
cmd: &UnsubscribePoolFeeCollects,
) -> Result<(), Error>
fn unsubscribe_pool_fee_collects( &mut self, cmd: &UnsubscribePoolFeeCollects, ) -> Result<(), Error>
Source§impl Debug for FinFeedDataClient
impl Debug for FinFeedDataClient
Source§impl Drop for FinFeedDataClient
impl Drop for FinFeedDataClient
Auto Trait Implementations§
impl !RefUnwindSafe for FinFeedDataClient
impl !UnwindSafe for FinFeedDataClient
impl Freeze for FinFeedDataClient
impl Send for FinFeedDataClient
impl Sync for FinFeedDataClient
impl Unpin for FinFeedDataClient
impl UnsafeUnpin for FinFeedDataClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more