Skip to main content

DefiData

Enum DefiData 

Source
pub enum DefiData {
    Block(Block),
    Pool(Pool),
    PoolSnapshot(PoolSnapshot),
    PoolSwap(PoolSwap),
    PoolLiquidityUpdate(PoolLiquidityUpdate),
    PoolFeeCollect(PoolFeeCollect),
    PoolFeeProtocolUpdate(PoolFeeProtocolUpdate),
    PoolFeeProtocolCollect(PoolFeeProtocolCollect),
    PoolFlash(PoolFlash),
}
Expand description

Represents DeFi-specific data events in a decentralized exchange ecosystem.

Variants§

§

Block(Block)

A block completion in a blockchain network.

§

Pool(Pool)

A DEX liquidity pool definition or update.

§

PoolSnapshot(PoolSnapshot)

A complete snapshot of a pool’s state at a specific point in time.

§

PoolSwap(PoolSwap)

A token swap transaction on a decentralized exchange.

§

PoolLiquidityUpdate(PoolLiquidityUpdate)

A liquidity update event (mint/burn) in a DEX pool.

§

PoolFeeCollect(PoolFeeCollect)

A fee collection event from a DEX pool position.

§

PoolFeeProtocolUpdate(PoolFeeProtocolUpdate)

A protocol-fee configuration change in a DEX pool.

§

PoolFeeProtocolCollect(PoolFeeProtocolCollect)

A protocol-fee withdrawal from a DEX pool.

§

PoolFlash(PoolFlash)

A flash event

Implementations§

Source§

impl DefiData

Source

pub fn block_position(&self) -> (u64, u32, u32)

Returns the block position associated with this DeFi data.

Source

pub fn block_number(&self) -> u64

Returns the block number associated with this DeFi data.

Source

pub fn transaction_index(&self) -> u32

Returns the transaction index associated with this DeFi data.

Source

pub fn log_index(&self) -> u32

Returns the log index associated with this DeFi data.

Source

pub fn ts_event(&self) -> UnixNanos

Returns the event timestamp associated with this DeFi data.

Source

pub fn timestamp(&self) -> UnixNanos

Returns the event timestamp associated with this DeFi data.

Source

pub fn ts_init(&self) -> UnixNanos

Returns the initialization timestamp associated with this DeFi data.

Source

pub fn instrument_id(&self) -> InstrumentId

Returns the instrument ID associated with this DeFi data.

§Panics

Panics if the variant is a Block or PoolSnapshot where instrument IDs are not applicable.

Trait Implementations§

Source§

impl Clone for DefiData

Source§

fn clone(&self) -> DefiData

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DefiData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for DefiData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<DefiData> for Data

Available on crate feature defi only.
Source§

fn from(value: DefiData) -> Self

Converts to this type from the input type.
Source§

impl From<Pool> for DefiData

Source§

fn from(value: Pool) -> Self

Converts to this type from the input type.
Source§

impl From<PoolFeeCollect> for DefiData

Source§

fn from(value: PoolFeeCollect) -> Self

Converts to this type from the input type.
Source§

impl From<PoolFeeProtocolCollect> for DefiData

Source§

fn from(value: PoolFeeProtocolCollect) -> Self

Converts to this type from the input type.
Source§

impl From<PoolFeeProtocolUpdate> for DefiData

Source§

fn from(value: PoolFeeProtocolUpdate) -> Self

Converts to this type from the input type.
Source§

impl From<PoolFlash> for DefiData

Source§

fn from(value: PoolFlash) -> Self

Converts to this type from the input type.
Source§

impl From<PoolLiquidityUpdate> for DefiData

Source§

fn from(value: PoolLiquidityUpdate) -> Self

Converts to this type from the input type.
Source§

impl From<PoolSnapshot> for DefiData

Source§

fn from(value: PoolSnapshot) -> Self

Converts to this type from the input type.
Source§

impl From<PoolSwap> for DefiData

Source§

fn from(value: PoolSwap) -> Self

Converts to this type from the input type.
Source§

impl HasTsInit for DefiData

Source§

fn ts_init(&self) -> UnixNanos

Returns the UNIX timestamp (nanoseconds) when the instance was created.
Source§

impl PartialEq for DefiData

Source§

fn eq(&self, other: &DefiData) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for DefiData

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.