pub struct PoolDiscoveryService<'a> { /* private fields */ }Expand description
Service responsible for discovering DEX liquidity pools from blockchain events.
This service handles the synchronization of pool creation events from various DEXes, managing token metadata fetching, buffering strategies, and database persistence.
Implementations§
Source§impl<'a> PoolDiscoveryService<'a>
impl<'a> PoolDiscoveryService<'a>
Sourcepub const fn new(
chain: SharedChain,
cache: &'a mut BlockchainCache,
erc20_contract: &'a Erc20Contract,
hypersync_client: &'a HyperSyncClient,
cancellation_token: CancellationToken,
config: BlockchainDataClientConfig,
) -> Self
pub const fn new( chain: SharedChain, cache: &'a mut BlockchainCache, erc20_contract: &'a Erc20Contract, hypersync_client: &'a HyperSyncClient, cancellation_token: CancellationToken, config: BlockchainDataClientConfig, ) -> Self
Creates a new PoolDiscoveryService instance.
Sourcepub async fn sync_pools(
&mut self,
dex: &DexExtended,
from_block: u64,
to_block: Option<u64>,
reset: bool,
) -> Result<()>
pub async fn sync_pools( &mut self, dex: &DexExtended, from_block: u64, to_block: Option<u64>, reset: bool, ) -> Result<()>
Synchronizes pools for a specific DEX within a given block range.
§Errors
Returns an error if:
- HyperSync streaming fails
- Token RPC calls fail
- Database operations fail
- Sync is cancelled
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for PoolDiscoveryService<'a>
impl<'a> !RefUnwindSafe for PoolDiscoveryService<'a>
impl<'a> Send for PoolDiscoveryService<'a>
impl<'a> Sync for PoolDiscoveryService<'a>
impl<'a> Unpin for PoolDiscoveryService<'a>
impl<'a> !UnwindSafe for PoolDiscoveryService<'a>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§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> 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>
Converts
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>
Converts
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