pub struct StopLossData {Show 13 fields
pub sell_token: Address,
pub buy_token: Address,
pub sell_amount: U256,
pub buy_amount: U256,
pub app_data: B256,
pub receiver: Address,
pub is_sell_order: bool,
pub is_partially_fillable: bool,
pub valid_to: u32,
pub strike_price: U256,
pub sell_token_price_oracle: Address,
pub buy_token_price_oracle: Address,
pub token_amount_in_eth: bool,
}Expand description
Parameters for a stop-loss conditional order.
A stop-loss order is triggered when the spot price of sell_token in
units of buy_token falls to or below strike_price (18-decimal
fixed-point). Both token prices are read from Chainlink-compatible oracle
contracts.
Fields§
§sell_token: AddressToken to sell when the condition triggers.
buy_token: AddressToken to buy when the condition triggers.
sell_amount: U256Amount of sell_token to sell (in atoms).
buy_amount: U256Minimum amount of buy_token to receive (in atoms).
app_data: B256App-data hash (bytes32).
receiver: AddressReceiver of bought tokens (Address::ZERO = order owner).
is_sell_order: boolWhether this is a sell-direction (true) or buy-direction (false) order.
is_partially_fillable: boolWhether the order may be partially filled.
valid_to: u32Order expiry as a Unix timestamp.
strike_price: U256Strike price as an 18-decimal fixed-point uint256.
The order triggers when the oracle-reported price falls to or below this value.
sell_token_price_oracle: AddressChainlink-compatible price oracle for sell_token.
buy_token_price_oracle: AddressChainlink-compatible price oracle for buy_token.
token_amount_in_eth: boolWhen true, the oracle price is expressed in ETH units rather than
token-atom units.
Trait Implementations§
Source§impl Clone for StopLossData
impl Clone for StopLossData
Source§fn clone(&self) -> StopLossData
fn clone(&self) -> StopLossData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for StopLossData
impl RefUnwindSafe for StopLossData
impl Send for StopLossData
impl Sync for StopLossData
impl Unpin for StopLossData
impl UnsafeUnpin for StopLossData
impl UnwindSafe for StopLossData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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