balancer_maths_rust/pools/reclammv2/
reclammv2_data.rs

1use crate::common::types::BasePoolState;
2use num_bigint::BigInt;
3use serde::{Deserialize, Serialize};
4
5/// ReClammV2 mutable state
6#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7pub struct ReClammV2Mutable {
8    #[serde(rename = "lastVirtualBalances")]
9    pub last_virtual_balances: Vec<BigInt>,
10    #[serde(rename = "dailyPriceShiftBase")]
11    pub daily_price_shift_base: BigInt,
12    #[serde(rename = "lastTimestamp")]
13    pub last_timestamp: BigInt,
14    #[serde(rename = "currentTimestamp")]
15    pub current_timestamp: BigInt,
16    #[serde(rename = "centerednessMargin")]
17    pub centeredness_margin: BigInt,
18    #[serde(rename = "startFourthRootPriceRatio")]
19    pub start_fourth_root_price_ratio: BigInt,
20    #[serde(rename = "endFourthRootPriceRatio")]
21    pub end_fourth_root_price_ratio: BigInt,
22    #[serde(rename = "priceRatioUpdateStartTime")]
23    pub price_ratio_update_start_time: BigInt,
24    #[serde(rename = "priceRatioUpdateEndTime")]
25    pub price_ratio_update_end_time: BigInt,
26}
27
28/// ReClammV2 immutable state
29#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
30pub struct ReClammV2Immutable {
31    pub pool_address: String,
32    pub tokens: Vec<String>,
33}
34
35/// ReClammV2 pool state
36#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
37pub struct ReClammV2State {
38    pub base: BasePoolState,
39    pub mutable: ReClammV2Mutable,
40    pub immutable: ReClammV2Immutable,
41}
42
43impl From<ReClammV2State> for crate::common::types::PoolState {
44    fn from(state: ReClammV2State) -> Self {
45        crate::common::types::PoolState::ReClammV2(state)
46    }
47}