balancer_maths_rust/pools/quantamm/
quantamm_data.rs1use crate::common::types::BasePoolState;
2use num_bigint::BigInt;
3use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7pub struct QuantAmmMutable {
8 pub first_four_weights_and_multipliers: Vec<BigInt>,
9 pub second_four_weights_and_multipliers: Vec<BigInt>,
10 pub last_update_time: BigInt,
11 pub last_interop_time: BigInt,
12 pub current_timestamp: BigInt,
13}
14
15#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
17pub struct QuantAmmImmutable {
18 pub max_trade_size_ratio: BigInt,
19}
20
21#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
23pub struct QuantAmmState {
24 pub base: BasePoolState,
25 pub mutable: QuantAmmMutable,
26 pub immutable: QuantAmmImmutable,
27}
28
29impl From<QuantAmmState> for crate::common::types::PoolState {
30 fn from(state: QuantAmmState) -> Self {
31 crate::common::types::PoolState::QuantAmm(state)
32 }
33}