This commit is contained in:
2026-07-30 04:44:21 +02:00
parent 8dcf6b2a41
commit 87e3c2b964
8 changed files with 95 additions and 236 deletions
+4 -42
View File
@@ -1,7 +1,6 @@
use crate::{
general::{EventLog, MarketTrend, Position, Signal},
general::{EventLog, Position, Signal},
strategy::StrategyManifest,
units::{Symbol, USD, Volatility},
};
use hypersdk::{Decimal, hypercore::CandleInterval};
@@ -39,37 +38,10 @@ pub enum TerminalClientMessage {
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct MarketItem {
pub symbol: Symbol,
pub price: USD,
pub symbol: String,
pub price: Decimal,
pub trend: Decimal,
pub volume_24h: USD,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct MarketOverview {
pub trend: MarketTrend,
pub volatility: Volatility,
pub pressure: f64,
pub alerts: Vec<Alert>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub enum AlertLevel {
High,
Medium,
Low,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct Alert {
pub level: AlertLevel,
pub message: String,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct Balance {
pub asset: String,
pub amount: f64,
pub value: f64,
pub volume_24h: Decimal,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
@@ -116,16 +88,6 @@ pub struct Strategy {
pub cooldown: CandleInterval,
}
impl std::fmt::Display for AlertLevel {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::High => write!(f, "H"),
Self::Medium => write!(f, "M"),
Self::Low => write!(f, "L"),
}
}
}
impl std::fmt::Display for Mode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {