balancer_maths_rust/pools/stable/
stable_data.rs

1use crate::common::types::BasePoolState;
2use num_bigint::BigInt;
3use serde::{Deserialize, Serialize};
4
5/// Stable pool mutable state
6#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7pub struct StableMutable {
8    pub amp: BigInt,
9}
10
11/// Stable pool state
12#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
13pub struct StableState {
14    #[serde(flatten)]
15    pub base: BasePoolState,
16    #[serde(flatten)]
17    pub mutable: StableMutable,
18}
19
20impl From<StableState> for crate::common::types::PoolState {
21    fn from(state: StableState) -> Self {
22        crate::common::types::PoolState::Stable(state)
23    }
24}