pub struct BlockchainSubscriberActor {
pub(crate) core: DataActorCore,
pub(crate) config: BlockchainSubscriberActorConfig,
pub received_blocks: Vec<Block>,
pub received_pool_swaps: Vec<PoolSwap>,
pub received_pool_liquidity_updates: Vec<PoolLiquidityUpdate>,
pub received_pools: Vec<Pool>,
}
Expand description
A basic blockchain subscriber actor that monitors DeFi activities.
This actor demonstrates how to use the DataActor
trait to monitor blockchain data
from DEXs, pools, and other DeFi protocols. It logs received blocks and swaps
to demonstrate the data flow.
Fields§
§core: DataActorCore
§config: BlockchainSubscriberActorConfig
§received_blocks: Vec<Block>
§received_pool_swaps: Vec<PoolSwap>
§received_pool_liquidity_updates: Vec<PoolLiquidityUpdate>
§received_pools: Vec<Pool>
Implementations§
Source§impl BlockchainSubscriberActor
impl BlockchainSubscriberActor
Sourcepub fn new(config: BlockchainSubscriberActorConfig) -> Self
pub fn new(config: BlockchainSubscriberActorConfig) -> Self
Creates a new BlockchainSubscriberActor
instance.
Sourcepub const fn block_count(&self) -> usize
pub const fn block_count(&self) -> usize
Returns the number of pools received by this actor.
Sourcepub const fn pool_count(&self) -> usize
pub const fn pool_count(&self) -> usize
Returns the number of pools received by this actor.
Sourcepub const fn pool_swap_count(&self) -> usize
pub const fn pool_swap_count(&self) -> usize
Returns the number of swaps received by this actor.
Sourcepub const fn pool_liquidity_update_count(&self) -> usize
pub const fn pool_liquidity_update_count(&self) -> usize
Returns the number of liquidity updates received by this actor.
Methods from Deref<Target = DataActorCore>§
pub fn actor_id(&self) -> ActorId
pub fn timestamp_ns(&self) -> UnixNanos
pub fn clock(&mut self) -> RefMut<'_, dyn Clock>
pub fn clock(&mut self) -> RefMut<'_, dyn Clock>
Returns the clock for the actor (if registered).
§Panics
Panics if the actor has not been registered with a trader.
pub fn register(
&mut self,
trader_id: TraderId,
clock: Rc<RefCell<dyn Clock>>,
cache: Rc<RefCell<Cache>>,
) -> Result<(), Error>
pub fn register( &mut self, trader_id: TraderId, clock: Rc<RefCell<dyn Clock>>, cache: Rc<RefCell<Cache>>, ) -> Result<(), Error>
Register the data actor with a trader.
§Errors
Returns an error if the actor has already been registered with a trader or if the provided dependencies are invalid.
pub fn register_warning_event(&mut self, event_type: &str)
pub fn register_warning_event(&mut self, event_type: &str)
Register an event type for warning log levels.
pub fn deregister_warning_event(&mut self, event_type: &str)
pub fn deregister_warning_event(&mut self, event_type: &str)
Deregister an event type from warning log levels.
pub fn shutdown_system(&self, reason: Option<String>)
pub fn shutdown_system(&self, reason: Option<String>)
Sends a shutdown command to the system with an optional reason.
§Panics
Panics if the actor is not registered or has no trader ID.
pub fn subscribe_data(
&mut self,
handler: ShareableMessageHandler,
data_type: DataType,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn subscribe_data( &mut self, handler: ShareableMessageHandler, data_type: DataType, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for registering data subscriptions from the trait.
§Panics
Panics if the actor is not properly registered.
pub fn subscribe_quotes(
&mut self,
topic: MStr<Topic>,
handler: ShareableMessageHandler,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn subscribe_quotes( &mut self, topic: MStr<Topic>, handler: ShareableMessageHandler, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for registering quotes subscriptions from the trait.
pub fn subscribe_instruments(
&mut self,
topic: MStr<Topic>,
handler: ShareableMessageHandler,
venue: Venue,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn subscribe_instruments( &mut self, topic: MStr<Topic>, handler: ShareableMessageHandler, venue: Venue, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for registering instruments subscriptions from the trait.
pub fn subscribe_instrument(
&mut self,
topic: MStr<Topic>,
handler: ShareableMessageHandler,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn subscribe_instrument( &mut self, topic: MStr<Topic>, handler: ShareableMessageHandler, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for registering instrument subscriptions from the trait.
pub fn subscribe_book_deltas(
&mut self,
topic: MStr<Topic>,
handler: ShareableMessageHandler,
instrument_id: InstrumentId,
book_type: BookType,
depth: Option<NonZero<usize>>,
client_id: Option<ClientId>,
managed: bool,
params: Option<IndexMap<String, String>>,
)
pub fn subscribe_book_deltas( &mut self, topic: MStr<Topic>, handler: ShareableMessageHandler, instrument_id: InstrumentId, book_type: BookType, depth: Option<NonZero<usize>>, client_id: Option<ClientId>, managed: bool, params: Option<IndexMap<String, String>>, )
Helper method for registering book deltas subscriptions from the trait.
pub fn subscribe_book_at_interval(
&mut self,
topic: MStr<Topic>,
handler: ShareableMessageHandler,
instrument_id: InstrumentId,
book_type: BookType,
depth: Option<NonZero<usize>>,
interval_ms: NonZero<usize>,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn subscribe_book_at_interval( &mut self, topic: MStr<Topic>, handler: ShareableMessageHandler, instrument_id: InstrumentId, book_type: BookType, depth: Option<NonZero<usize>>, interval_ms: NonZero<usize>, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for registering book snapshots subscriptions from the trait.
pub fn subscribe_trades(
&mut self,
topic: MStr<Topic>,
handler: ShareableMessageHandler,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn subscribe_trades( &mut self, topic: MStr<Topic>, handler: ShareableMessageHandler, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for registering trades subscriptions from the trait.
pub fn subscribe_bars(
&mut self,
topic: MStr<Topic>,
handler: ShareableMessageHandler,
bar_type: BarType,
client_id: Option<ClientId>,
await_partial: bool,
params: Option<IndexMap<String, String>>,
)
pub fn subscribe_bars( &mut self, topic: MStr<Topic>, handler: ShareableMessageHandler, bar_type: BarType, client_id: Option<ClientId>, await_partial: bool, params: Option<IndexMap<String, String>>, )
Helper method for registering bars subscriptions from the trait.
pub fn subscribe_mark_prices(
&mut self,
topic: MStr<Topic>,
handler: ShareableMessageHandler,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn subscribe_mark_prices( &mut self, topic: MStr<Topic>, handler: ShareableMessageHandler, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for registering mark prices subscriptions from the trait.
pub fn subscribe_index_prices(
&mut self,
topic: MStr<Topic>,
handler: ShareableMessageHandler,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn subscribe_index_prices( &mut self, topic: MStr<Topic>, handler: ShareableMessageHandler, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for registering index prices subscriptions from the trait.
pub fn subscribe_instrument_status(
&mut self,
topic: MStr<Topic>,
handler: ShareableMessageHandler,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn subscribe_instrument_status( &mut self, topic: MStr<Topic>, handler: ShareableMessageHandler, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for registering instrument status subscriptions from the trait.
pub fn subscribe_instrument_close(
&mut self,
topic: MStr<Topic>,
handler: ShareableMessageHandler,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn subscribe_instrument_close( &mut self, topic: MStr<Topic>, handler: ShareableMessageHandler, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for registering instrument close subscriptions from the trait.
pub fn subscribe_blocks(
&mut self,
topic: MStr<Topic>,
handler: ShareableMessageHandler,
chain: Blockchain,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn subscribe_blocks( &mut self, topic: MStr<Topic>, handler: ShareableMessageHandler, chain: Blockchain, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for registering block subscriptions from the trait.
pub fn subscribe_pool(
&mut self,
topic: MStr<Topic>,
handler: ShareableMessageHandler,
address: Address,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn subscribe_pool( &mut self, topic: MStr<Topic>, handler: ShareableMessageHandler, address: Address, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for registering pool subscriptions from the trait.
pub fn subscribe_pool_swaps(
&mut self,
topic: MStr<Topic>,
handler: ShareableMessageHandler,
address: Address,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn subscribe_pool_swaps( &mut self, topic: MStr<Topic>, handler: ShareableMessageHandler, address: Address, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for registering pool swap subscriptions from the trait.
pub fn subscribe_pool_liquidity_updates(
&mut self,
topic: MStr<Topic>,
handler: ShareableMessageHandler,
address: Address,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn subscribe_pool_liquidity_updates( &mut self, topic: MStr<Topic>, handler: ShareableMessageHandler, address: Address, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for registering pool liquidity update subscriptions from the trait.
pub fn unsubscribe_data(
&self,
data_type: DataType,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn unsubscribe_data( &self, data_type: DataType, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for unsubscribing from data.
pub fn unsubscribe_instruments(
&self,
venue: Venue,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn unsubscribe_instruments( &self, venue: Venue, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for unsubscribing from instruments.
pub fn unsubscribe_instrument(
&self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn unsubscribe_instrument( &self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for unsubscribing from instrument.
pub fn unsubscribe_book_deltas(
&self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn unsubscribe_book_deltas( &self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for unsubscribing from book deltas.
pub fn unsubscribe_book_at_interval(
&mut self,
instrument_id: InstrumentId,
interval_ms: NonZero<usize>,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn unsubscribe_book_at_interval( &mut self, instrument_id: InstrumentId, interval_ms: NonZero<usize>, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for unsubscribing from book snapshots at interval.
pub fn unsubscribe_quotes(
&self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn unsubscribe_quotes( &self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for unsubscribing from quotes.
pub fn unsubscribe_trades(
&self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn unsubscribe_trades( &self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for unsubscribing from trades.
pub fn unsubscribe_bars(
&mut self,
bar_type: BarType,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn unsubscribe_bars( &mut self, bar_type: BarType, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for unsubscribing from bars.
pub fn unsubscribe_mark_prices(
&self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn unsubscribe_mark_prices( &self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for unsubscribing from mark prices.
pub fn unsubscribe_index_prices(
&self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn unsubscribe_index_prices( &self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for unsubscribing from index prices.
pub fn unsubscribe_instrument_status(
&self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn unsubscribe_instrument_status( &self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for unsubscribing from instrument status.
pub fn unsubscribe_instrument_close(
&self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn unsubscribe_instrument_close( &self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for unsubscribing from instrument close.
pub fn unsubscribe_blocks(
&mut self,
chain: Blockchain,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn unsubscribe_blocks( &mut self, chain: Blockchain, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for unsubscribing from blocks.
pub fn unsubscribe_pool(
&mut self,
address: Address,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn unsubscribe_pool( &mut self, address: Address, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for unsubscribing from pool definition updates.
pub fn unsubscribe_pool_swaps(
&mut self,
address: Address,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn unsubscribe_pool_swaps( &mut self, address: Address, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for unsubscribing from pool swaps.
pub fn unsubscribe_pool_liquidity_updates(
&mut self,
address: Address,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
pub fn unsubscribe_pool_liquidity_updates( &mut self, address: Address, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Helper method for unsubscribing from pool liquidity updates.
pub fn request_data(
&self,
data_type: DataType,
client_id: ClientId,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
limit: Option<NonZero<usize>>,
params: Option<IndexMap<String, String>>,
handler: ShareableMessageHandler,
) -> Result<UUID4, Error>
pub fn request_data( &self, data_type: DataType, client_id: ClientId, start: Option<DateTime<Utc>>, end: Option<DateTime<Utc>>, limit: Option<NonZero<usize>>, params: Option<IndexMap<String, String>>, handler: ShareableMessageHandler, ) -> Result<UUID4, Error>
pub fn request_instrument(
&self,
instrument_id: InstrumentId,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
handler: ShareableMessageHandler,
) -> Result<UUID4, Error>
pub fn request_instrument( &self, instrument_id: InstrumentId, start: Option<DateTime<Utc>>, end: Option<DateTime<Utc>>, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, handler: ShareableMessageHandler, ) -> Result<UUID4, Error>
pub fn request_instruments(
&self,
venue: Option<Venue>,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
handler: ShareableMessageHandler,
) -> Result<UUID4, Error>
pub fn request_instruments( &self, venue: Option<Venue>, start: Option<DateTime<Utc>>, end: Option<DateTime<Utc>>, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, handler: ShareableMessageHandler, ) -> Result<UUID4, Error>
pub fn request_book_snapshot(
&self,
instrument_id: InstrumentId,
depth: Option<NonZero<usize>>,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
handler: ShareableMessageHandler,
) -> Result<UUID4, Error>
pub fn request_book_snapshot( &self, instrument_id: InstrumentId, depth: Option<NonZero<usize>>, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, handler: ShareableMessageHandler, ) -> Result<UUID4, Error>
Helper method for requesting book snapshot.
§Errors
Returns an error if input parameters are invalid.
pub fn request_quotes(
&self,
instrument_id: InstrumentId,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
limit: Option<NonZero<usize>>,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
handler: ShareableMessageHandler,
) -> Result<UUID4, Error>
pub fn request_quotes( &self, instrument_id: InstrumentId, start: Option<DateTime<Utc>>, end: Option<DateTime<Utc>>, limit: Option<NonZero<usize>>, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, handler: ShareableMessageHandler, ) -> Result<UUID4, Error>
pub fn request_trades(
&self,
instrument_id: InstrumentId,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
limit: Option<NonZero<usize>>,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
handler: ShareableMessageHandler,
) -> Result<UUID4, Error>
pub fn request_trades( &self, instrument_id: InstrumentId, start: Option<DateTime<Utc>>, end: Option<DateTime<Utc>>, limit: Option<NonZero<usize>>, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, handler: ShareableMessageHandler, ) -> Result<UUID4, Error>
Trait Implementations§
Source§impl DataActor for BlockchainSubscriberActor
impl DataActor for BlockchainSubscriberActor
Source§fn on_block(&mut self, block: &Block) -> Result<()>
fn on_block(&mut self, block: &Block) -> Result<()>
Source§fn on_pool_swap(&mut self, swap: &PoolSwap) -> Result<()>
fn on_pool_swap(&mut self, swap: &PoolSwap) -> Result<()>
§fn on_save(&self) -> Result<IndexMap<String, Vec<u8>>, Error>
fn on_save(&self) -> Result<IndexMap<String, Vec<u8>>, Error>
§fn on_load(&mut self, state: IndexMap<String, Vec<u8>>) -> Result<(), Error>
fn on_load(&mut self, state: IndexMap<String, Vec<u8>>) -> Result<(), Error>
§fn on_time_event(&mut self, event: &TimeEvent) -> Result<(), Error>
fn on_time_event(&mut self, event: &TimeEvent) -> Result<(), Error>
§fn on_data(&mut self, data: &(dyn Any + 'static)) -> Result<(), Error>
fn on_data(&mut self, data: &(dyn Any + 'static)) -> Result<(), Error>
§fn on_signal(&mut self, signal: &Signal) -> Result<(), Error>
fn on_signal(&mut self, signal: &Signal) -> Result<(), Error>
§fn on_instrument(&mut self, instrument: &InstrumentAny) -> Result<(), Error>
fn on_instrument(&mut self, instrument: &InstrumentAny) -> Result<(), Error>
§fn on_book_deltas(&mut self, deltas: &OrderBookDeltas) -> Result<(), Error>
fn on_book_deltas(&mut self, deltas: &OrderBookDeltas) -> Result<(), Error>
§fn on_book(&mut self, order_book: &OrderBook) -> Result<(), Error>
fn on_book(&mut self, order_book: &OrderBook) -> Result<(), Error>
§fn on_quote(&mut self, quote: &QuoteTick) -> Result<(), Error>
fn on_quote(&mut self, quote: &QuoteTick) -> Result<(), Error>
§fn on_trade(&mut self, tick: &TradeTick) -> Result<(), Error>
fn on_trade(&mut self, tick: &TradeTick) -> Result<(), Error>
§fn on_bar(&mut self, bar: &Bar) -> Result<(), Error>
fn on_bar(&mut self, bar: &Bar) -> Result<(), Error>
§fn on_mark_price(&mut self, mark_price: &MarkPriceUpdate) -> Result<(), Error>
fn on_mark_price(&mut self, mark_price: &MarkPriceUpdate) -> Result<(), Error>
§fn on_index_price(
&mut self,
index_price: &IndexPriceUpdate,
) -> Result<(), Error>
fn on_index_price( &mut self, index_price: &IndexPriceUpdate, ) -> Result<(), Error>
§fn on_instrument_status(&mut self, data: &InstrumentStatus) -> Result<(), Error>
fn on_instrument_status(&mut self, data: &InstrumentStatus) -> Result<(), Error>
§fn on_instrument_close(&mut self, update: &InstrumentClose) -> Result<(), Error>
fn on_instrument_close(&mut self, update: &InstrumentClose) -> Result<(), Error>
§fn on_pool(&mut self, pool: &Pool) -> Result<(), Error>
fn on_pool(&mut self, pool: &Pool) -> Result<(), Error>
§fn on_pool_liquidity_update(
&mut self,
update: &PoolLiquidityUpdate,
) -> Result<(), Error>
fn on_pool_liquidity_update( &mut self, update: &PoolLiquidityUpdate, ) -> Result<(), Error>
§fn on_historical_data(
&mut self,
data: &(dyn Any + 'static),
) -> Result<(), Error>
fn on_historical_data( &mut self, data: &(dyn Any + 'static), ) -> Result<(), Error>
§fn on_historical_quotes(&mut self, quotes: &[QuoteTick]) -> Result<(), Error>
fn on_historical_quotes(&mut self, quotes: &[QuoteTick]) -> Result<(), Error>
§fn on_historical_trades(&mut self, trades: &[TradeTick]) -> Result<(), Error>
fn on_historical_trades(&mut self, trades: &[TradeTick]) -> Result<(), Error>
§fn on_historical_bars(&mut self, bars: &[Bar]) -> Result<(), Error>
fn on_historical_bars(&mut self, bars: &[Bar]) -> Result<(), Error>
§fn on_historical_mark_prices(
&mut self,
mark_prices: &[MarkPriceUpdate],
) -> Result<(), Error>
fn on_historical_mark_prices( &mut self, mark_prices: &[MarkPriceUpdate], ) -> Result<(), Error>
§fn on_historical_index_prices(
&mut self,
index_prices: &[IndexPriceUpdate],
) -> Result<(), Error>
fn on_historical_index_prices( &mut self, index_prices: &[IndexPriceUpdate], ) -> Result<(), Error>
§fn handle_time_event(&mut self, event: &TimeEvent)
fn handle_time_event(&mut self, event: &TimeEvent)
§fn handle_data(&mut self, data: &(dyn Any + 'static))
fn handle_data(&mut self, data: &(dyn Any + 'static))
§fn handle_signal(&mut self, signal: &Signal)
fn handle_signal(&mut self, signal: &Signal)
§fn handle_instrument(&mut self, instrument: &InstrumentAny)
fn handle_instrument(&mut self, instrument: &InstrumentAny)
§fn handle_book_deltas(&mut self, deltas: &OrderBookDeltas)
fn handle_book_deltas(&mut self, deltas: &OrderBookDeltas)
§fn handle_book(&mut self, book: &OrderBook)
fn handle_book(&mut self, book: &OrderBook)
§fn handle_quote(&mut self, quote: &QuoteTick)
fn handle_quote(&mut self, quote: &QuoteTick)
§fn handle_trade(&mut self, trade: &TradeTick)
fn handle_trade(&mut self, trade: &TradeTick)
§fn handle_bar(&mut self, bar: &Bar)
fn handle_bar(&mut self, bar: &Bar)
§fn handle_mark_price(&mut self, mark_price: &MarkPriceUpdate)
fn handle_mark_price(&mut self, mark_price: &MarkPriceUpdate)
§fn handle_index_price(&mut self, index_price: &IndexPriceUpdate)
fn handle_index_price(&mut self, index_price: &IndexPriceUpdate)
§fn handle_instrument_status(&mut self, status: &InstrumentStatus)
fn handle_instrument_status(&mut self, status: &InstrumentStatus)
§fn handle_instrument_close(&mut self, close: &InstrumentClose)
fn handle_instrument_close(&mut self, close: &InstrumentClose)
§fn handle_block(&mut self, block: &Block)
fn handle_block(&mut self, block: &Block)
§fn handle_pool(&mut self, pool: &Pool)
fn handle_pool(&mut self, pool: &Pool)
§fn handle_pool_swap(&mut self, swap: &PoolSwap)
fn handle_pool_swap(&mut self, swap: &PoolSwap)
§fn handle_pool_liquidity_update(&mut self, update: &PoolLiquidityUpdate)
fn handle_pool_liquidity_update(&mut self, update: &PoolLiquidityUpdate)
§fn handle_historical_data(&mut self, data: &(dyn Any + 'static))
fn handle_historical_data(&mut self, data: &(dyn Any + 'static))
§fn handle_data_response(&mut self, resp: &CustomDataResponse)
fn handle_data_response(&mut self, resp: &CustomDataResponse)
§fn handle_instrument_response(&mut self, resp: &InstrumentResponse)
fn handle_instrument_response(&mut self, resp: &InstrumentResponse)
§fn handle_instruments_response(&mut self, resp: &InstrumentsResponse)
fn handle_instruments_response(&mut self, resp: &InstrumentsResponse)
§fn handle_book_response(&mut self, resp: &BookResponse)
fn handle_book_response(&mut self, resp: &BookResponse)
§fn handle_quotes_response(&mut self, resp: &QuotesResponse)
fn handle_quotes_response(&mut self, resp: &QuotesResponse)
§fn handle_trades_response(&mut self, resp: &TradesResponse)
fn handle_trades_response(&mut self, resp: &TradesResponse)
§fn handle_bars_response(&mut self, resp: &BarsResponse)
fn handle_bars_response(&mut self, resp: &BarsResponse)
§fn subscribe_data(
&mut self,
data_type: DataType,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn subscribe_data( &mut self, data_type: DataType, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
data_type
data.§fn subscribe_quotes(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn subscribe_quotes( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
QuoteTick
] data for the instrument_id
.§fn subscribe_instruments(
&mut self,
venue: Venue,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn subscribe_instruments( &mut self, venue: Venue, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
InstrumentAny
] data for the venue
.§fn subscribe_instrument(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn subscribe_instrument( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
InstrumentAny
] data for the instrument_id
.§fn subscribe_book_deltas(
&mut self,
instrument_id: InstrumentId,
book_type: BookType,
depth: Option<NonZero<usize>>,
client_id: Option<ClientId>,
managed: bool,
params: Option<IndexMap<String, String>>,
)
fn subscribe_book_deltas( &mut self, instrument_id: InstrumentId, book_type: BookType, depth: Option<NonZero<usize>>, client_id: Option<ClientId>, managed: bool, params: Option<IndexMap<String, String>>, )
OrderBookDeltas
] data for the instrument_id
.§fn subscribe_book_at_interval(
&mut self,
instrument_id: InstrumentId,
book_type: BookType,
depth: Option<NonZero<usize>>,
interval_ms: NonZero<usize>,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn subscribe_book_at_interval( &mut self, instrument_id: InstrumentId, book_type: BookType, depth: Option<NonZero<usize>>, interval_ms: NonZero<usize>, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
OrderBook
] snapshots at a specified interval for the instrument_id
.§fn subscribe_trades(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn subscribe_trades( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
TradeTick
] data for the instrument_id
.§fn subscribe_bars(
&mut self,
bar_type: BarType,
client_id: Option<ClientId>,
await_partial: bool,
params: Option<IndexMap<String, String>>,
)
fn subscribe_bars( &mut self, bar_type: BarType, client_id: Option<ClientId>, await_partial: bool, params: Option<IndexMap<String, String>>, )
Bar
] data for the bar_type
.§fn subscribe_mark_prices(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn subscribe_mark_prices( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
MarkPriceUpdate
] data for the instrument_id
.§fn subscribe_index_prices(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn subscribe_index_prices( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
IndexPriceUpdate
] data for the instrument_id
.§fn subscribe_instrument_status(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn subscribe_instrument_status( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
InstrumentStatus
] data for the instrument_id
.§fn subscribe_instrument_close(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn subscribe_instrument_close( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
InstrumentClose
] data for the instrument_id
.§fn subscribe_blocks(
&mut self,
chain: Blockchain,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn subscribe_blocks( &mut self, chain: Blockchain, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Block
] data for the chain
.§fn subscribe_pool(
&mut self,
address: Address,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn subscribe_pool( &mut self, address: Address, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Pool
] definition updates for the AMM pool at the address
.§fn subscribe_pool_swaps(
&mut self,
address: Address,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn subscribe_pool_swaps( &mut self, address: Address, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
PoolSwap
] data for the address
.§fn subscribe_pool_liquidity_updates(
&mut self,
address: Address,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn subscribe_pool_liquidity_updates( &mut self, address: Address, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
PoolLiquidityUpdate
] data for the address
.§fn unsubscribe_data(
&mut self,
data_type: DataType,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn unsubscribe_data( &mut self, data_type: DataType, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
data_type
data.§fn unsubscribe_instruments(
&mut self,
venue: Venue,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn unsubscribe_instruments( &mut self, venue: Venue, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
InstrumentAny
] data for the venue
.§fn unsubscribe_instrument(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn unsubscribe_instrument( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
InstrumentAny
] data for the instrument_id
.§fn unsubscribe_book_deltas(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn unsubscribe_book_deltas( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
OrderBookDeltas
] data for the instrument_id
.§fn unsubscribe_book_at_interval(
&mut self,
instrument_id: InstrumentId,
interval_ms: NonZero<usize>,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn unsubscribe_book_at_interval( &mut self, instrument_id: InstrumentId, interval_ms: NonZero<usize>, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
OrderBook
] snapshots at a specified interval for the instrument_id
.§fn unsubscribe_quotes(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn unsubscribe_quotes( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
QuoteTick
] data for the instrument_id
.§fn unsubscribe_trades(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn unsubscribe_trades( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
TradeTick
] data for the instrument_id
.§fn unsubscribe_bars(
&mut self,
bar_type: BarType,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn unsubscribe_bars( &mut self, bar_type: BarType, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Bar
] data for the bar_type
.§fn unsubscribe_mark_prices(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn unsubscribe_mark_prices( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
MarkPriceUpdate
] data for the instrument_id
.§fn unsubscribe_index_prices(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn unsubscribe_index_prices( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
IndexPriceUpdate
] data for the instrument_id
.§fn unsubscribe_instrument_status(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn unsubscribe_instrument_status( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
InstrumentStatus
] data for the instrument_id
.§fn unsubscribe_instrument_close(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn unsubscribe_instrument_close( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
InstrumentClose
] data for the instrument_id
.§fn unsubscribe_blocks(
&mut self,
chain: Blockchain,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn unsubscribe_blocks( &mut self, chain: Blockchain, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Block
] data for the chain
.§fn unsubscribe_pool(
&mut self,
address: Address,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn unsubscribe_pool( &mut self, address: Address, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
Pool
] definition updates for the AMM pool at the address
.§fn unsubscribe_pool_swaps(
&mut self,
address: Address,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn unsubscribe_pool_swaps( &mut self, address: Address, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
PoolSwap
] data for the address
.§fn unsubscribe_pool_liquidity_updates(
&mut self,
address: Address,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
)
fn unsubscribe_pool_liquidity_updates( &mut self, address: Address, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, )
PoolLiquidityUpdate
] data for the address
.§fn request_data(
&mut self,
data_type: DataType,
client_id: ClientId,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
limit: Option<NonZero<usize>>,
params: Option<IndexMap<String, String>>,
) -> Result<UUID4, Error>
fn request_data( &mut self, data_type: DataType, client_id: ClientId, start: Option<DateTime<Utc>>, end: Option<DateTime<Utc>>, limit: Option<NonZero<usize>>, params: Option<IndexMap<String, String>>, ) -> Result<UUID4, Error>
data_type
. Read more§fn request_instrument(
&mut self,
instrument_id: InstrumentId,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
) -> Result<UUID4, Error>
fn request_instrument( &mut self, instrument_id: InstrumentId, start: Option<DateTime<Utc>>, end: Option<DateTime<Utc>>, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, ) -> Result<UUID4, Error>
§fn request_instruments(
&mut self,
venue: Option<Venue>,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
) -> Result<UUID4, Error>
fn request_instruments( &mut self, venue: Option<Venue>, start: Option<DateTime<Utc>>, end: Option<DateTime<Utc>>, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, ) -> Result<UUID4, Error>
§fn request_book_snapshot(
&mut self,
instrument_id: InstrumentId,
depth: Option<NonZero<usize>>,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
) -> Result<UUID4, Error>
fn request_book_snapshot( &mut self, instrument_id: InstrumentId, depth: Option<NonZero<usize>>, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, ) -> Result<UUID4, Error>
§fn request_quotes(
&mut self,
instrument_id: InstrumentId,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
limit: Option<NonZero<usize>>,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
) -> Result<UUID4, Error>
fn request_quotes( &mut self, instrument_id: InstrumentId, start: Option<DateTime<Utc>>, end: Option<DateTime<Utc>>, limit: Option<NonZero<usize>>, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, ) -> Result<UUID4, Error>
§fn request_trades(
&mut self,
instrument_id: InstrumentId,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
limit: Option<NonZero<usize>>,
client_id: Option<ClientId>,
params: Option<IndexMap<String, String>>,
) -> Result<UUID4, Error>
fn request_trades( &mut self, instrument_id: InstrumentId, start: Option<DateTime<Utc>>, end: Option<DateTime<Utc>>, limit: Option<NonZero<usize>>, client_id: Option<ClientId>, params: Option<IndexMap<String, String>>, ) -> Result<UUID4, Error>
Source§impl Debug for BlockchainSubscriberActor
impl Debug for BlockchainSubscriberActor
Source§impl Deref for BlockchainSubscriberActor
impl Deref for BlockchainSubscriberActor
Auto Trait Implementations§
impl Freeze for BlockchainSubscriberActor
impl !RefUnwindSafe for BlockchainSubscriberActor
impl !Send for BlockchainSubscriberActor
impl !Sync for BlockchainSubscriberActor
impl Unpin for BlockchainSubscriberActor
impl !UnwindSafe for BlockchainSubscriberActor
Blanket Implementations§
§impl<T> Actor for Twhere
T: DataActor + Debug + 'static,
impl<T> Actor for Twhere
T: DataActor + Debug + 'static,
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<T> Component for Twhere
T: DataActor + Debug + 'static,
impl<T> Component for Twhere
T: DataActor + Debug + 'static,
§fn component_id(&self) -> ComponentId
fn component_id(&self) -> ComponentId
§fn transition_state(&mut self, trigger: ComponentTrigger) -> Result<(), Error>
fn transition_state(&mut self, trigger: ComponentTrigger) -> Result<(), Error>
§fn register(
&mut self,
trader_id: TraderId,
clock: Rc<RefCell<dyn Clock>>,
cache: Rc<RefCell<Cache>>,
) -> Result<(), Error>
fn register( &mut self, trader_id: TraderId, clock: Rc<RefCell<dyn Clock>>, cache: Rc<RefCell<Cache>>, ) -> Result<(), Error>
§fn not_running(&self) -> bool
fn not_running(&self) -> bool
§fn is_running(&self) -> bool
fn is_running(&self) -> bool
§fn is_stopped(&self) -> bool
fn is_stopped(&self) -> bool
§fn is_degraded(&self) -> bool
fn is_degraded(&self) -> bool
§fn is_faulted(&self) -> bool
fn is_faulted(&self) -> bool
§fn is_disposed(&self) -> bool
fn is_disposed(&self) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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