Skip to main content

AccountHTTP

Struct AccountHTTP 

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

Trait Implementations§

Source§

impl Account for AccountHTTP

Source§

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

Initialize the AccountHTTP by passing the HttpManager

Source§

fn get_wallet_balance<'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,

Obtain wallet balance, query asset information of each currency, and account risk rate information under unified margin mode. By default, currency information with assets or liabilities of 0 is not returned. Required args: accountType (string): Account type Unified account: UNIFIED Normal account: CONTRACT Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/account/wallet-balance

Source§

fn upgrade_to_unified_trading_account<'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,

Upgrade Unified Account Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/account/upgrade-unified-account

Source§

fn get_borrow_history<'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,

Get interest records, sorted in reverse order of creation time. Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/account/borrow-history

Source§

fn get_collateral_info<'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,

Get the collateral information of the current unified margin account, including loan interest rate, loanable amount, collateral conversion rate, whether it can be mortgaged as margin, etc. Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/account/collateral-info

Source§

fn get_coin_greeks<'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,

Get current account Greeks information Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/account/coin-greeks

Source§

fn get_fee_rates<'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,

Get the trading fee rate of derivatives. Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/account/fee-rate

Source§

fn get_account_info<'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 the margin mode configuration of the account. Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/account/account-info

Source§

fn get_transaction_log<'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 transaction logs in Unified account. Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/account/transaction-log

Source§

fn set_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,

Default is regular margin mode. This mode is valid for USDT Perp, USDC Perp and USDC Option. Required args: setMarginMode (string): REGULAR_MARGIN, PORTFOLIO_MARGIN Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/account/set-margin-mode

Source§

fn set_mmp<'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,

Market Maker Protection (MMP) is an automated mechanism designed to protect market makers (MM) against liquidity risks and over-exposure in the market. It prevents simultaneous trade executions on quotes provided by the MM within a short time span. The MM can automatically pull their quotes if the number of contracts traded for an underlying asset exceeds the configured threshold within a certain time frame. Once MMP is triggered, any pre-existing MMP orders will be automatically canceled, and new orders tagged as MMP will be rejected for a specific duration — known as the frozen period — so that MM can reassess the market and modify the quotes. Required args: baseCoin (strin): Base coin window (string): Time window (ms) frozenPeriod (string): Frozen period (ms). “0” means the trade will remain frozen until manually reset qtyLimit (string): Trade qty limit (positive and up to 2 decimal places) deltaLimit (string): Delta limit (positive and up to 2 decimal places) Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/account/set-mmp

Source§

fn reset_mmp<'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,

Once the mmp triggered, you can unfreeze the account by this endpoint Required args: baseCoin (string): Base coin Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/account/reset-mmp

Source§

fn get_mmp_state<'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,

Get MMP state Required args: baseCoin (string): Base coin Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/account/get-mmp-state

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