use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LiquidationInfo {
#[serde(rename = "positions")]
pub positions: Vec<models::AccountPosition>,
#[serde(rename = "risk_info_before")]
pub risk_info_before: Box<models::RiskInfo>,
#[serde(rename = "risk_info_after")]
pub risk_info_after: Box<models::RiskInfo>,
#[serde(rename = "mark_prices")]
pub mark_prices: std::collections::HashMap<String, f64>,
}
impl LiquidationInfo {
pub fn new(
positions: Vec<models::AccountPosition>,
risk_info_before: models::RiskInfo,
risk_info_after: models::RiskInfo,
mark_prices: std::collections::HashMap<String, f64>,
) -> LiquidationInfo {
LiquidationInfo {
positions,
risk_info_before: Box::new(risk_info_before),
risk_info_after: Box::new(risk_info_after),
mark_prices,
}
}
}