AccountSummary

Struct AccountSummary 

Source
pub struct AccountSummary {
Show 36 fields pub currency: String, pub balance: f64, pub equity: f64, pub available_funds: f64, pub margin_balance: f64, pub unrealized_pnl: f64, pub realized_pnl: f64, pub total_pl: f64, pub session_funding: f64, pub session_rpl: f64, pub session_upl: f64, pub maintenance_margin: f64, pub initial_margin: f64, pub available_withdrawal_funds: Option<f64>, pub cross_collateral_enabled: Option<bool>, pub delta_total: Option<f64>, pub futures_pl: Option<f64>, pub futures_session_rpl: Option<f64>, pub futures_session_upl: Option<f64>, pub options_delta: Option<f64>, pub options_gamma: Option<f64>, pub options_pl: Option<f64>, pub options_session_rpl: Option<f64>, pub options_session_upl: Option<f64>, pub options_theta: Option<f64>, pub options_vega: Option<f64>, pub portfolio_margining_enabled: Option<bool>, pub projected_delta_total: Option<f64>, pub projected_initial_margin: Option<f64>, pub projected_maintenance_margin: Option<f64>, pub system_name: Option<String>, pub account_type: String, pub delta_total_map: HashMap<String, f64>, pub deposit_address: String, pub fees: Vec<HashMap<String, f64>>, pub limits: HashMap<String, f64>,
}
Expand description

Account summary information

Fields§

§currency: String

Account currency (kept as Currencies enum for compatibility)

§balance: f64

Total balance

§equity: f64

Account equity

§available_funds: f64

Available funds for trading

§margin_balance: f64

Margin balance

§unrealized_pnl: f64

Unrealized profit and loss

§realized_pnl: f64

Realized profit and loss

§total_pl: f64

Total profit and loss

§session_funding: f64

Session funding

§session_rpl: f64

Session realized P&L

§session_upl: f64

Session unrealized P&L

§maintenance_margin: f64

Maintenance margin requirement

§initial_margin: f64

Initial margin requirement

§available_withdrawal_funds: Option<f64>

Available withdrawal funds

§cross_collateral_enabled: Option<bool>

Cross collateral enabled

§delta_total: Option<f64>

Delta total

§futures_pl: Option<f64>

Futures profit and loss

§futures_session_rpl: Option<f64>

Futures session realized profit and loss

§futures_session_upl: Option<f64>

Futures session unrealized profit and loss

§options_delta: Option<f64>

Options delta

§options_gamma: Option<f64>

Options gamma

§options_pl: Option<f64>

Options profit and loss

§options_session_rpl: Option<f64>

Options session realized profit and loss

§options_session_upl: Option<f64>

Options session unrealized profit and loss

§options_theta: Option<f64>

Options theta

§options_vega: Option<f64>

Options vega

§portfolio_margining_enabled: Option<bool>

Portfolio margin enabled

§projected_delta_total: Option<f64>

Projected delta total

§projected_initial_margin: Option<f64>

Projected initial margin

§projected_maintenance_margin: Option<f64>

Projected maintenance margin

§system_name: Option<String>

System name

§account_type: String

Type of account

§delta_total_map: HashMap<String, f64>

Delta total map (currency -> delta)

§deposit_address: String

Deposit address

§fees: Vec<HashMap<String, f64>>

Fees structure

§limits: HashMap<String, f64>

Account limits

Implementations§

Source§

impl AccountSummary

Source

pub fn margin_utilization(&self) -> f64

Calculate margin utilization as percentage

Source

pub fn available_margin(&self) -> f64

Calculate available margin

Source

pub fn is_at_risk(&self, threshold: f64) -> bool

Check if account is at risk (high margin utilization)

Source

pub fn return_on_equity(&self) -> f64

Calculate return on equity

Trait Implementations§

Source§

impl Clone for AccountSummary

Source§

fn clone(&self) -> AccountSummary

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AccountSummary

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AccountSummary

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for AccountSummary

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for AccountSummary

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,