typed Syntax and improved formatting

This commit is contained in:
2026-07-25 04:30:58 +02:00
parent 6b6085ef25
commit f615d8dfbb
7 changed files with 147 additions and 87 deletions
+8 -5
View File
@@ -1,6 +1,9 @@
use std::sync::Arc;
use pulse_wire::general::Position;
use pulse_wire::{
general::Position,
units::{Symbol, USD},
};
use tokio::{sync::Mutex, task::JoinHandle};
use crate::{
@@ -91,14 +94,14 @@ impl Engine {
.asset_positions
.into_iter()
.map(|position| Position {
symbol: position.position.coin,
symbol: Symbol(position.position.coin),
size: position.position.szi.as_f64(),
entry_price: position
entry_price: USD(position
.position
.entry_px
.map(|px| px.as_f64())
.unwrap_or(0.0),
profit: position.position.unrealized_pnl.as_f64(),
.unwrap_or(0.0)),
profit: USD(position.position.unrealized_pnl.as_f64()),
})
.collect(),
),