pub struct Pool {
pub chain: SharedChain,
pub dex: SharedDex,
pub address: Address,
pub instrument_id: InstrumentId,
pub creation_block: u64,
pub token0: Token,
pub token1: Token,
pub fee: Option<u32>,
pub tick_spacing: Option<u32>,
pub ts_init: UnixNanos,
}
Expand description
Represents a liquidity pool in a decentralized exchange.
The instrument ID encodes with the following components:
symbol
– The pool address.
venue
– The chain name plus DEX ID.
The string representation therefore has the form:
<POOL_ADDRESS>.<CHAIN_NAME>:<DEX_ID>
Example:
0x11b815efB8f581194ae79006d24E0d814B7697F6.Ethereum:UniswapV3
Fields§
§chain: SharedChain
The blockchain network where this pool exists.
dex: SharedDex
The decentralized exchange protocol that created and manages this pool.
address: Address
The blockchain address of the pool smart contract.
instrument_id: InstrumentId
The instrument ID for the pool.
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: Option<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: Option<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: SharedDex,
address: Address,
creation_block: u64,
token0: Token,
token1: Token,
fee: Option<u32>,
tick_spacing: Option<u32>,
ts_init: UnixNanos,
) -> Self
pub fn new( chain: SharedChain, dex: SharedDex, address: Address, creation_block: u64, token0: Token, token1: Token, fee: Option<u32>, tick_spacing: Option<u32>, ts_init: UnixNanos, ) -> Self
Creates a new Pool
instance with the specified properties.
pub fn create_instrument_id( chain: Blockchain, dex: &Dex, address: &Address, ) -> InstrumentId
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
Source§impl<'py> IntoPyObject<'py> for Pool
impl<'py> IntoPyObject<'py> for Pool
Source§impl PyClassImpl for Pool
impl PyClassImpl for Pool
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§type ThreadChecker = SendablePyClass<Pool>
type ThreadChecker = SendablePyClass<Pool>
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature<Pool> for PyClassImplCollector<Pool>
impl PyClassNewTextSignature<Pool> for PyClassImplCollector<Pool>
fn new_text_signature(self) -> Option<&'static str>
Source§impl PyMethods<Pool> for PyClassImplCollector<Pool>
impl PyMethods<Pool> for PyClassImplCollector<Pool>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for Pool
impl PyTypeInfo for Pool
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
object
is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
object
is an instance of this type.impl DerefToPyAny for Pool
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,
§impl<T> FromPyObject<'_> for Twhere
T: PyClass + Clone,
impl<T> FromPyObject<'_> for Twhere
T: PyClass + Clone,
§fn extract_bound(obj: &Bound<'_, PyAny>) -> Result<T, PyErr>
fn extract_bound(obj: &Bound<'_, PyAny>) -> Result<T, PyErr>
§impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
§fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
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§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self
into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
self
into an owned Python object, dropping type information and unbinding it
from the 'py
lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
self
into a Python object. Read moreSource§impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
Source§fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>
fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>
§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
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