typed Syntax and improved formatting
This commit is contained in:
@@ -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(),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user