#[non_exhaustive]pub enum TradeAction {
Place(PlaceOrder),
Cancel(Cancel),
CancelByCloid(CancelByCloid),
Modify(Modify),
BatchModify(BatchModify),
Twap(Twap),
TwapCancel(TwapCancel),
Leverage(UpdateLeverage),
Margin(UpdateIsolatedMargin),
ScheduleCancel(ScheduleCancel),
Noop(Noop),
TrailingStop(TrailingStop),
}Expand description
One trading action of any kind, signed as the action it holds.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Place(PlaceOrder)
order: one or more orders.
Cancel(Cancel)
cancel: orders by their oid.
CancelByCloid(CancelByCloid)
cancelByCloid: orders by their client order id.
Modify(Modify)
modify: one resting order replaced in place.
BatchModify(BatchModify)
batchModify: several resting orders replaced in place.
Twap(Twap)
twapOrder: a TWAP.
TwapCancel(TwapCancel)
twapCancel: a running TWAP stopped.
Leverage(UpdateLeverage)
updateLeverage: a perp’s leverage and margin mode.
Margin(UpdateIsolatedMargin)
updateIsolatedMargin: USDC moved into or out of an isolated position.
ScheduleCancel(ScheduleCancel)
scheduleCancel: the dead man’s switch armed or disarmed.
Noop(Noop)
noop: a nonce spent so an order signed with it never lands.
TrailingStop(TrailingStop)
trailingStop: a stop that trails the best price.
Implementations§
Source§impl TradeAction
impl TradeAction
Trait Implementations§
Source§impl Clone for TradeAction
impl Clone for TradeAction
Source§impl Debug for TradeAction
impl Debug for TradeAction
impl Eq for TradeAction
Source§impl From<BatchModify> for TradeAction
impl From<BatchModify> for TradeAction
Source§fn from(action: BatchModify) -> TradeAction
fn from(action: BatchModify) -> TradeAction
Converts to this type from the input type.
Source§impl From<Cancel> for TradeAction
impl From<Cancel> for TradeAction
Source§fn from(action: Cancel) -> TradeAction
fn from(action: Cancel) -> TradeAction
Converts to this type from the input type.
Source§impl From<CancelByCloid> for TradeAction
impl From<CancelByCloid> for TradeAction
Source§fn from(action: CancelByCloid) -> TradeAction
fn from(action: CancelByCloid) -> TradeAction
Converts to this type from the input type.
Source§impl From<Modify> for TradeAction
impl From<Modify> for TradeAction
Source§fn from(action: Modify) -> TradeAction
fn from(action: Modify) -> TradeAction
Converts to this type from the input type.
Source§impl From<Noop> for TradeAction
impl From<Noop> for TradeAction
Source§fn from(action: Noop) -> TradeAction
fn from(action: Noop) -> TradeAction
Converts to this type from the input type.
Source§impl From<PlaceOrder> for TradeAction
impl From<PlaceOrder> for TradeAction
Source§fn from(action: PlaceOrder) -> TradeAction
fn from(action: PlaceOrder) -> TradeAction
Converts to this type from the input type.
Source§impl From<ScheduleCancel> for TradeAction
impl From<ScheduleCancel> for TradeAction
Source§fn from(action: ScheduleCancel) -> TradeAction
fn from(action: ScheduleCancel) -> TradeAction
Converts to this type from the input type.
Source§impl From<TrailingStop> for TradeAction
impl From<TrailingStop> for TradeAction
Source§fn from(action: TrailingStop) -> TradeAction
fn from(action: TrailingStop) -> TradeAction
Converts to this type from the input type.
Source§impl From<Twap> for TradeAction
impl From<Twap> for TradeAction
Source§fn from(action: Twap) -> TradeAction
fn from(action: Twap) -> TradeAction
Converts to this type from the input type.
Source§impl From<TwapCancel> for TradeAction
impl From<TwapCancel> for TradeAction
Source§fn from(action: TwapCancel) -> TradeAction
fn from(action: TwapCancel) -> TradeAction
Converts to this type from the input type.
Source§impl From<UpdateIsolatedMargin> for TradeAction
impl From<UpdateIsolatedMargin> for TradeAction
Source§fn from(action: UpdateIsolatedMargin) -> TradeAction
fn from(action: UpdateIsolatedMargin) -> TradeAction
Converts to this type from the input type.
Source§impl From<UpdateLeverage> for TradeAction
impl From<UpdateLeverage> for TradeAction
Source§fn from(action: UpdateLeverage) -> TradeAction
fn from(action: UpdateLeverage) -> TradeAction
Converts to this type from the input type.
Source§impl L1Action for TradeAction
impl L1Action for TradeAction
Source§fn action(&self) -> Map
fn action(&self) -> Map
The action’s keys and values in wire order, which is the hashed order.
Source§fn msgpack(&self) -> Vec<u8> ⓘ
fn msgpack(&self) -> Vec<u8> ⓘ
The action as msgpack bytes, the first part of the connection id’s hash.
Source§fn typed(
&self,
nonce: u64,
vault: Option<Address>,
network: Network,
) -> TypedStruct<'static>
fn typed( &self, nonce: u64, vault: Option<Address>, network: Network, ) -> TypedStruct<'static>
The phantom agent struct the key signs for this action.
Source§fn digest(
&self,
nonce: u64,
vault: Option<Address>,
network: Network,
) -> [u8; 32]
fn digest( &self, nonce: u64, vault: Option<Address>, network: Network, ) -> [u8; 32]
What the key signs for this action: the phantom agent’s digest under
Domain::EXCHANGE.Source§impl PartialEq for TradeAction
impl PartialEq for TradeAction
impl StructuralPartialEq for TradeAction
Auto Trait Implementations§
impl Forget for TradeAction
impl Freeze for TradeAction
impl Move for TradeAction
impl RefUnwindSafe for TradeAction
impl Send for TradeAction
impl Sync for TradeAction
impl Unpin for TradeAction
impl UnsafeUnpin for TradeAction
impl UnwindSafe for TradeAction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.