Skip to main content

Action

Enum Action 

Source
pub enum Action<'a> {
    Order(OrderRequest<'a>, bool),
    Amend(AmendOrderRequest<'a>, bool),
    Cancel(CancelOrderRequest<'a>, bool),
}
Expand description

Creates an order with various options for different account types and contract types.

§Account Coverage

  • Unified account: Spot, USDT perpetual, USDC contract, Inverse contract, Option
  • Classic account: Spot, USDT perpetual, Inverse contract

§Order Types

  • Limit Order: Must specify quantity and price.
  • Market Order: Executes at the best market price. Price parameter can be empty.
  • Conditional Order: Set triggerPrice to convert to a conditional order.

§Time In Force Strategies

  • GTC (Good Till Cancelled)
  • IOC (Immediate Or Cancel)
  • FOK (Fill Or Kill)
  • PostOnly: Cancelled if it would be filled immediately when submitted.

§Take Profit / Stop Loss

  • Can be set during order placement and modified later.

§Order Quantity

  • Only positive numbers are supported for perpetual contract orders.

§Order Price

  • Required for limit orders. Must be higher than liquidation price if in position.
  • Custom active order ID up to 36 characters.

§Order Limits

  • Futures: 500 active orders per contract, 10 conditional orders per account.
  • Spot: 500 total orders, 30 open TP/SL orders, 30 open conditional orders.
  • Option: 50 open orders.

§Rate Limit

  • Refer to the rate limit table. Contact client manager for increases.

§Risk Control

  • Bybit monitors API requests. Exceeding daily limits may lead to restrictions.

§Spot Stop Order in Different Account Types

  • Classic account: New order ID upon stop order trigger.
  • Unified account: Order ID remains unchanged upon stop order trigger.

Variants§

Auto Trait Implementations§

§

impl<'a> Freeze for Action<'a>

§

impl<'a> RefUnwindSafe for Action<'a>

§

impl<'a> Send for Action<'a>

§

impl<'a> Sync for Action<'a>

§

impl<'a> Unpin for Action<'a>

§

impl<'a> UnsafeUnpin for Action<'a>

§

impl<'a> UnwindSafe for Action<'a>

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> 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<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