pub struct FlashEvent {
pub dex: SharedDex,
pub pool_address: Address,
pub block_number: u64,
pub transaction_hash: String,
pub transaction_index: u32,
pub log_index: u32,
pub sender: Address,
pub recipient: Address,
pub amount0: U256,
pub amount1: U256,
pub paid0: U256,
pub paid1: U256,
}Expand description
Represents a flash loan event from liquidity pools emitted from smart contract.
This struct captures the essential data from a flash loan transaction on decentralized exchanges (DEXs) that support flash loans.
Fields§
§dex: SharedDexThe decentralized exchange where the event happened.
pool_address: AddressThe address of the smart contract which emitted the event.
block_number: u64The block number in which this flash loan transaction was included.
transaction_hash: StringThe unique hash identifier of the transaction containing this event.
transaction_index: u32The position of this transaction within the block.
log_index: u32The position of this event log within the transaction.
sender: AddressThe address that initiated the flash loan transaction.
recipient: AddressThe address that received the flash loan.
amount0: U256The amount of token0 borrowed.
amount1: U256The amount of token1 borrowed.
paid0: U256The amount of token0 paid back (including fees).
paid1: U256The amount of token1 paid back (including fees).
Implementations§
Source§impl FlashEvent
impl FlashEvent
Sourcepub const fn new(
dex: SharedDex,
pool_address: Address,
block_number: u64,
transaction_hash: String,
transaction_index: u32,
log_index: u32,
sender: Address,
recipient: Address,
amount0: U256,
amount1: U256,
paid0: U256,
paid1: U256,
) -> Self
pub const fn new( dex: SharedDex, pool_address: Address, block_number: u64, transaction_hash: String, transaction_index: u32, log_index: u32, sender: Address, recipient: Address, amount0: U256, amount1: U256, paid0: U256, paid1: U256, ) -> Self
Creates a new FlashEvent instance with the specified parameters.
Sourcepub fn to_pool_flash(
&self,
chain: SharedChain,
instrument_id: InstrumentId,
pool_address: Address,
timestamp: Option<UnixNanos>,
) -> PoolFlash
pub fn to_pool_flash( &self, chain: SharedChain, instrument_id: InstrumentId, pool_address: Address, timestamp: Option<UnixNanos>, ) -> PoolFlash
Converts a flash event into a PoolFlash.
Trait Implementations§
Source§impl Clone for FlashEvent
impl Clone for FlashEvent
Source§fn clone(&self) -> FlashEvent
fn clone(&self) -> FlashEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FlashEvent
impl RefUnwindSafe for FlashEvent
impl Send for FlashEvent
impl Sync for FlashEvent
impl Unpin for FlashEvent
impl UnwindSafe for FlashEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
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