pub struct Pool {
pub chain: SharedChain,
pub dex: Dex,
pub address: Address,
pub creation_block: u64,
pub token0: Token,
pub token1: Token,
pub fee: u32,
pub tick_spacing: u32,
pub ts_init: UnixNanos,
}
Expand description
Represents a liquidity pool in a decentralized exchange.
Fields§
§chain: SharedChain
The blockchain network where this pool exists.
dex: Dex
The decentralized exchange protocol that created and manages this pool.
address: Address
The blockchain address of the pool smart contract.
creation_block: u64
The block number when this pool was created on the blockchain.
token0: Token
The first token in the trading pair.
token1: Token
The second token in the trading pair.
fee: u32
The trading fee tier used by the pool expressed in hundred-thousandths (1e-6) of one unit – identical to Uniswap-V3’s fee representation.
Examples:
• 500
→ 0.05 % (5 bps)
• 3_000
→ 0.30 % (30 bps)
• 10_000
→ 1.00 %
tick_spacing: u32
The minimum tick spacing for positions in concentrated liquidity AMMs.
ts_init: UnixNanos
UNIX timestamp (nanoseconds) when the instance was created.
Implementations§
Source§impl Pool
impl Pool
Sourcepub fn new(
chain: SharedChain,
dex: Dex,
address: Address,
creation_block: u64,
token0: Token,
token1: Token,
fee: u32,
tick_spacing: u32,
ts_init: UnixNanos,
) -> Self
pub fn new( chain: SharedChain, dex: Dex, address: Address, creation_block: u64, token0: Token, token1: Token, fee: u32, tick_spacing: u32, ts_init: UnixNanos, ) -> Self
Creates a new Pool
instance with the specified properties.
Sourcepub fn instrument_id(&self) -> InstrumentId
pub fn instrument_id(&self) -> InstrumentId
Returns the instrument ID for this pool.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Pool
impl<'de> Deserialize<'de> for Pool
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<Pool> for CurrencyPair
impl From<Pool> for CurrencyPair
Source§impl From<Pool> for InstrumentAny
impl From<Pool> for InstrumentAny
impl StructuralPartialEq for Pool
Auto Trait Implementations§
impl Freeze for Pool
impl RefUnwindSafe for Pool
impl Send for Pool
impl Sync for Pool
impl Unpin for Pool
impl UnwindSafe for Pool
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,
Source§impl<T> Separable for Twhere
T: Display,
impl<T> Separable for Twhere
T: Display,
Source§fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
SeparatorPolicy
. Read more