Skip to main content

AddReduceMarginResult

Struct AddReduceMarginResult 

Source
pub struct AddReduceMarginResult {
Show 23 fields pub category: Category, pub symbol: String, pub position_idx: i32, pub risk_id: i32, pub risk_limit_value: f64, pub size: f64, pub position_value: f64, pub avg_price: f64, pub liq_price: f64, pub bust_price: f64, pub mark_price: f64, pub leverage: String, pub auto_add_margin: i32, pub position_status: String, pub position_im: String, pub position_mm: String, pub unrealised_pnl: String, pub cum_realised_pnl: String, pub stop_loss: Option<f64>, pub take_profit: Option<f64>, pub trailing_stop: String, pub created_time: u64, pub updated_time: u64,
}
Expand description

Details the result of a margin adjustment for a position.

Part of the AddReduceMarginResponse, this struct provides updated position metrics after adding or reducing margin. Bots use this to confirm the new position state and update risk management calculations.

Fields§

§category: Category

The product category (e.g., Linear).

Indicates the instrument type of the position. Bots should verify this matches the requested category.

§symbol: String

The trading pair symbol (e.g., “BTCUSDT”).

Identifies the perpetual futures contract. Bots should confirm this matches the requested symbol.

§position_idx: i32

The position index (e.g., 0 for one-way mode, 1 or 2 for hedge mode).

Indicates the position type. Bots use this to distinguish between long and short positions in hedge mode.

§risk_id: i32

The risk ID associated with the position.

Identifies the risk limit tier applied to the position. Bots use this to verify compliance with risk management settings.

§risk_limit_value: f64

The risk limit value for the position.

The maximum exposure allowed for the position, in the settlement currency. Bots use this to ensure positions stay within risk limits.

§size: f64

The position size (in base asset).

The quantity of the base asset held in the position. Bots use this to calculate position value and risk exposure.

§position_value: f64

The position value.

The monetary value of the position (size * avg_price). Bots use this to calculate margin requirements and exposure.

§avg_price: f64

The average entry price of the position.

The average price at which the position was opened. Bots use this to calculate unrealized P&L and assess profitability.

§liq_price: f64

The liquidation price.

The price at which the position will be liquidated. Bots use this to set stop-loss orders or trigger risk management actions.

§bust_price: f64

The bankruptcy price.

The price at which the position would result in account bankruptcy. Bots use this as a critical risk threshold.

§mark_price: f64

The mark price of the position.

The current mark price used for P&L calculations in perpetual futures. Bots use this to calculate unrealized P&L and assess position health.

§leverage: String

The leverage applied to the position.

The leverage multiplier (e.g., “10” for 10x). Bots use this to calculate margin requirements and assess risk exposure.

§auto_add_margin: i32

Auto-margin addition status (0 or 1).

Indicates whether auto-margin addition is enabled (1) or disabled (0). Bots use this to monitor margin settings.

§position_status: String

The position status (e.g., “Normal”, “Liq”).

Indicates the current state of the position, such as active or in liquidation. Bots use this to trigger risk management actions if needed.

§position_im: String

The initial margin for the position.

The initial margin required to maintain the position. Bots use this to calculate leverage and margin utilization.

§position_mm: String

The maintenance margin for the position.

The minimum margin required to avoid liquidation. Bots use this to calculate margin ratios and manage risk.

§unrealised_pnl: String

The unrealized profit and loss.

The current unrealized P&L for the position, based on the mark price. Bots use this to monitor position profitability in real time.

§cum_realised_pnl: String

The cumulative realized profit and loss.

The total realized P&L for the position from all executions. Bots use this to track historical performance.

§stop_loss: Option<f64>

The stop-loss price (optional).

The price at which the position will automatically close to limit losses. Bots use this to verify stop-loss settings.

§take_profit: Option<f64>

The take-profit price (optional).

The price at which the position will automatically close for a profit. Bots use this to verify take-profit settings.

§trailing_stop: String

The trailing stop value.

The trailing stop offset, if enabled. Bots use this to verify dynamic stop-loss settings that follow market movements.

§created_time: u64

The timestamp when the position was created.

Indicates when the position was opened. Bots use this to calculate position duration and align with other time-series data.

§updated_time: u64

The timestamp of the last position update.

Indicates when the position was last modified (e.g., margin or size changes). Bots use this to track position changes in real time.

Trait Implementations§

Source§

impl Clone for AddReduceMarginResult

Source§

fn clone(&self) -> AddReduceMarginResult

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 AddReduceMarginResult

Source§

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

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

impl<'de> Deserialize<'de> for AddReduceMarginResult

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 Serialize for AddReduceMarginResult

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> Same for T

Source§

type Output = T

Should always be Self
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, 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>,