pub struct DexPoolSnapshot {
pub block_height: i64,
pub block_slot: Option<i64>,
pub block_timestamp: i64,
pub pool_address: String,
pub snapshot_time: i64,
pub token_a: DexPoolTokenSnapshot,
pub token_b: DexPoolTokenSnapshot,
pub tvl_in_native: String,
pub tvl_in_usd: String,
}Expand description
DEX pool liquidity snapshot
JSON schema
{
"description": "DEX pool liquidity snapshot",
"examples": [
{
"blockHeight": 123456789,
"blockSlot": 123456789,
"blockTimestamp": 1705312800000,
"poolAddress": "58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2",
"snapshotTime": 1705312800000,
"tokenA": {
"amountInNative": "5000.123",
"amountInUsd": "1000000.45",
"decimals": 6,
"priceNative": "0.005",
"priceUsd": "1.0001",
"tokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"vaultAmount": "1000000000000"
},
"tokenB": {
"amountInNative": "5000.123",
"amountInUsd": "1000000.45",
"decimals": 6,
"priceNative": "0.005",
"priceUsd": "1.0001",
"tokenAddress": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
"vaultAmount": "1000000000000"
},
"tvlInNative": "5000",
"tvlInUsd": "1000000.45"
}
],
"type": "object",
"required": [
"blockHeight",
"blockTimestamp",
"poolAddress",
"snapshotTime",
"tokenA",
"tokenB",
"tvlInNative",
"tvlInUsd"
],
"properties": {
"blockHeight": {
"description": "Block height",
"type": "integer",
"format": "int64"
},
"blockSlot": {
"description": "Block slot (optional)",
"type": "integer",
"format": "int64"
},
"blockTimestamp": {
"description": "Block timestamp (ms)",
"type": "integer",
"format": "int64"
},
"poolAddress": {
"description": "Pool address",
"type": "string"
},
"snapshotTime": {
"description": "Snapshot timestamp (ms)",
"type": "integer",
"format": "int64"
},
"tokenA": {
"$ref": "#/components/schemas/DexPoolTokenSnapshot"
},
"tokenB": {
"$ref": "#/components/schemas/DexPoolTokenSnapshot"
},
"tvlInNative": {
"description": "TVL in native token",
"type": "string"
},
"tvlInUsd": {
"description": "TVL in USD",
"type": "string"
}
}
}Fields§
§block_height: i64Block height
block_slot: Option<i64>Block slot (optional)
block_timestamp: i64Block timestamp (ms)
pool_address: StringPool address
snapshot_time: i64Snapshot timestamp (ms)
token_a: DexPoolTokenSnapshot§token_b: DexPoolTokenSnapshot§tvl_in_native: StringTVL in native token
tvl_in_usd: StringTVL in USD
Implementations§
Source§impl DexPoolSnapshot
impl DexPoolSnapshot
pub fn builder() -> DexPoolSnapshot
Trait Implementations§
Source§impl Clone for DexPoolSnapshot
impl Clone for DexPoolSnapshot
Source§fn clone(&self) -> DexPoolSnapshot
fn clone(&self) -> DexPoolSnapshot
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DexPoolSnapshot
impl Debug for DexPoolSnapshot
Source§impl<'de> Deserialize<'de> for DexPoolSnapshot
impl<'de> Deserialize<'de> for DexPoolSnapshot
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&DexPoolSnapshot> for DexPoolSnapshot
impl From<&DexPoolSnapshot> for DexPoolSnapshot
Source§fn from(value: &DexPoolSnapshot) -> Self
fn from(value: &DexPoolSnapshot) -> Self
Converts to this type from the input type.
Source§impl From<DexPoolSnapshot> for DexPoolSnapshot
impl From<DexPoolSnapshot> for DexPoolSnapshot
Source§fn from(value: DexPoolSnapshot) -> Self
fn from(value: DexPoolSnapshot) -> Self
Converts to this type from the input type.
Source§impl Serialize for DexPoolSnapshot
impl Serialize for DexPoolSnapshot
Source§impl TryFrom<DexPoolSnapshot> for DexPoolSnapshot
impl TryFrom<DexPoolSnapshot> for DexPoolSnapshot
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: DexPoolSnapshot) -> Result<Self, ConversionError>
fn try_from(value: DexPoolSnapshot) -> Result<Self, ConversionError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for DexPoolSnapshot
impl RefUnwindSafe for DexPoolSnapshot
impl Send for DexPoolSnapshot
impl Sync for DexPoolSnapshot
impl Unpin for DexPoolSnapshot
impl UnsafeUnpin for DexPoolSnapshot
impl UnwindSafe for DexPoolSnapshot
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
Mutably borrows from an owned value. Read more