general: snapshot

This commit is contained in:
k
2024-10-02 10:48:05 +02:00
parent 9d2c2f7945
commit 669205aa4d
22 changed files with 236 additions and 83 deletions

View File

@@ -11,7 +11,6 @@ use super::Amount;
pub struct LiquidityClassification {
illiquid: f64,
liquid: f64,
// highly_liquid: f64,
}
impl LiquidityClassification {
@@ -54,11 +53,7 @@ impl LiquidityClassification {
unreachable!()
}
Self {
illiquid,
liquid,
// highly_liquid: 1.0 - liquid - illiquid,
}
Self { illiquid, liquid }
}
#[inline(always)]
@@ -136,43 +131,3 @@ where
self.highly_liquid -= rhs.highly_liquid;
}
}
// impl<T> SplitByLiquidity<T>
// where
// T: Default,
// {
// // pub fn get(&self, id: &LiquidityId) -> &T {
// // match id {
// // LiquidityId::All => &self.all,
// // LiquidityId::Illiquid => &self.illiquid,
// // LiquidityId::Liquid => &self.liquid,
// // LiquidityId::HighlyLiquid => &self.highly_liquid,
// // }
// // }
// pub fn get_mut(&mut self, id: &LiquidityId) -> &mut T {
// match id {
// LiquidityId::All => &mut self.all,
// LiquidityId::Illiquid => &mut self.illiquid,
// LiquidityId::Liquid => &mut self.liquid,
// LiquidityId::HighlyLiquid => &mut self.highly_liquid,
// }
// }
// pub fn as_vec(&self) -> Vec<(&T, LiquidityId)> {
// vec![
// (&self.all, LiquidityId::All),
// (&self.illiquid, LiquidityId::Illiquid),
// (&self.liquid, LiquidityId::Liquid),
// (&self.highly_liquid, LiquidityId::HighlyLiquid),
// ]
// }
// }
// #[derive(Debug, Clone, Copy)]
// pub enum LiquidityId {
// All,
// Illiquid,
// Liquid,
// HighlyLiquid,
// }