Skip to main content

PositionHTTP

Struct PositionHTTP 

Source
pub struct PositionHTTP { /* private fields */ }

Trait Implementations§

Source§

impl Position for PositionHTTP

Source§

fn get_position<'life0, 'async_trait>( &'life0 self, query: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query real-time position data, such as position size, cumulative realizedPNL. Required args: category (string): Product type Unified account: linear, option Normal account: linear, inverse. Please note that category is not involved with business logic Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/position

Source§

fn set_leverage<'life0, 'async_trait>( &'life0 self, query: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Set the leverage Required args: category (string): Product type Unified account: linear Normal account: linear, inverse. Please note that category is not involved with business logic symbol (string): Symbol name buyLeverage (string): [0, max leverage of corresponding risk limit]. Note: Under one-way mode, buyLeverage must be the same as sellLeverage sellLeverage (string): [0, max leverage of corresponding risk limit]. Note: Under one-way mode, buyLeverage must be the same as sellLeverage Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/position/leverage

Source§

fn switch_margin_mode<'life0, 'async_trait>( &'life0 self, query: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Select cross margin mode or isolated margin mode Required args: category (string): Product type. linear,inverse Please note that category is not involved with business logicUnified account is not applicable symbol (string): Symbol name tradeMode (integer): 0: cross margin. 1: isolated margin buyLeverage (string): The value must be equal to sellLeverage value sellLeverage (string): The value must be equal to buyLeverage value Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/position/cross-isolate

Source§

fn set_tp_sl_mode<'life0, 'async_trait>( &'life0 self, query: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Set TP/SL mode to Full or Partial Required args: category (string): Product type Unified account: linear Normal account: linear, inverse. Please note that category is not involved with business logic symbol (string): Symbol name tpSlMode (string): TP/SL mode. Full,Partial Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/position/tpsl-mode

Source§

fn switch_position_mode<'life0, 'async_trait>( &'life0 self, query: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

It supports to switch the position mode for USDT perpetual and Inverse futures. If you are in one-way Mode, you can only open one position on Buy or Sell side. If you are in hedge mode, you can open both Buy and Sell side positions simultaneously. Required args: category (string): Product type. linear,inverse Please note that category is not involved with business logicUnified account is not applicable Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/position/position-mode

Source§

fn set_risk_limit<'life0, 'async_trait>( &'life0 self, query: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The risk limit will limit the maximum position value you can hold under different margin requirements. If you want to hold a bigger position size, you need more margin. This interface can set the risk limit of a single position. If the order exceeds the current risk limit when placing an order, it will be rejected. Click here to learn more about risk limit. Required args: category (string): Product type Unified account: linear Normal account: linear, inverse. Please note that category is not involved with business logic symbol (string): Symbol name riskId (integer): Risk limit ID Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/position/set-risk-limit

Source§

fn set_trading_stop<'life0, 'async_trait>( &'life0 self, query: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Set the trading stop condition Required args: category (string): Product type Unified account: linear Normal account: linear, inverse. Please note that category is not involved with business logic symbol (string): Symbol name Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/position/trading-stop

Source§

fn set_auto_add_margin<'life0, 'async_trait>( &'life0 self, query: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Turn on/off auto-add-margin for isolated margin position Required args: category (string): Product type. linear symbol (string): Symbol name autoAddMargin (integer): Turn on/off. 0: off. 1: on Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/position/add-margin

Source§

fn get_executions<'life0, 'async_trait>( &'life0 self, query: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query users’ execution records, sorted by execTime in descending order Required args: category (string): Product type Unified account: spot, linear, option Normal account: linear, inverse. Please note that category is not involved with business logic Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/position/execution

Source§

fn get_closed_pnl<'life0, 'async_trait>( &'life0 self, query: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query user’s closed profit and loss records. The results are sorted by createdTime in descending order. Required args: category (string): Product type Unified account: linear Normal account: linear, inverse. Please note that category is not involved with business logic Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/position/close-pnl

Source§

fn new(http_manager: Arc<HttpManager>) -> Self

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

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