pub enum DecMarketItem {
OpenPosition {
collateral: NonZero<Collateral>,
slippage_assert: Option<SlippageAssert>,
leverage: LeverageToBase,
direction: DirectionToBase,
stop_loss_override: Option<PriceBaseInQuote>,
take_profit: TakeProfitTrader,
},
UpdatePositionAddCollateralImpactLeverage {
collateral: NonZero<Collateral>,
id: PositionId,
},
UpdatePositionAddCollateralImpactSize {
collateral: NonZero<Collateral>,
id: PositionId,
slippage_assert: Option<SlippageAssert>,
},
UpdatePositionLeverage {
id: PositionId,
leverage: LeverageToBase,
slippage_assert: Option<SlippageAssert>,
},
UpdatePositionTakeProfitPrice {
id: PositionId,
price: TakeProfitTrader,
},
UpdatePositionStopLossPrice {
id: PositionId,
stop_loss: StopLoss,
},
PlaceLimitOrder {
collateral: NonZero<Collateral>,
trigger_price: PriceBaseInQuote,
leverage: LeverageToBase,
direction: DirectionToBase,
stop_loss_override: Option<PriceBaseInQuote>,
take_profit: TakeProfitTrader,
},
}
Expand description
Queue item that needs to be processed
Variants§
OpenPosition
Open position
Fields
collateral: NonZero<Collateral>
Collateral for the position
slippage_assert: Option<SlippageAssert>
Assertion that the price has not moved too far
leverage: LeverageToBase
Leverage of new position
direction: DirectionToBase
Direction of new position
stop_loss_override: Option<PriceBaseInQuote>
Stop loss price of new position
take_profit: TakeProfitTrader
Take profit price of new position
UpdatePositionAddCollateralImpactLeverage
Add collateral to position, causing leverage to decrease
Fields
collateral: NonZero<Collateral>
Collateral that will be added
id: PositionId
ID of position to update
UpdatePositionAddCollateralImpactSize
Add collateral to position, causing notional size to increase
Fields
collateral: NonZero<Collateral>
Collateral that will be added
id: PositionId
ID of position to update
slippage_assert: Option<SlippageAssert>
Slippage assert
UpdatePositionLeverage
Update position leverage
Fields
id: PositionId
ID of position to update
leverage: LeverageToBase
New leverage of the position
slippage_assert: Option<SlippageAssert>
Slippage assert
UpdatePositionTakeProfitPrice
Modify the take profit price of a position
Fields
id: PositionId
ID of position to update
price: TakeProfitTrader
New take profit price of the position
UpdatePositionStopLossPrice
Update the stop loss price of a position
Fields
id: PositionId
ID of position to update
PlaceLimitOrder
Set a limit order to open a position when the price of the asset hits the specified trigger price.
Fields
collateral: NonZero<Collateral>
Collateral for the position
trigger_price: PriceBaseInQuote
Price when the order should trigger
leverage: LeverageToBase
Leverage of new position
direction: DirectionToBase
Direction of new position
stop_loss_override: Option<PriceBaseInQuote>
Stop loss price of new position
take_profit: TakeProfitTrader
Take profit price of new position
Trait Implementations§
source§impl Clone for DecMarketItem
impl Clone for DecMarketItem
source§fn clone(&self) -> DecMarketItem
fn clone(&self) -> DecMarketItem
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DecMarketItem
impl Debug for DecMarketItem
source§impl<'de> Deserialize<'de> for DecMarketItem
impl<'de> Deserialize<'de> for DecMarketItem
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for DecMarketItem
impl PartialEq for DecMarketItem
source§fn eq(&self, other: &DecMarketItem) -> bool
fn eq(&self, other: &DecMarketItem) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for DecMarketItem
impl Serialize for DecMarketItem
impl StructuralPartialEq for DecMarketItem
Auto Trait Implementations§
impl Freeze for DecMarketItem
impl RefUnwindSafe for DecMarketItem
impl Send for DecMarketItem
impl Sync for DecMarketItem
impl Unpin for DecMarketItem
impl UnwindSafe for DecMarketItem
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moresource§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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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