pub type StopOrderTicket = StopOrderTicket<Otw>;Aliased Type§
pub struct StopOrderTicket {
pub id: UID,
pub executors: MoveVec<Address>,
pub gas: Balance<SUI>,
pub account_id: u64,
pub stop_order_type: u64,
pub encrypted_details: MoveVec<u8>,
/* private fields */
}Fields§
§id: UID§executors: MoveVec<Address>Addresses allowed to execute the order on behalf of the user.
gas: Balance<SUI>The executor collects the gas in case the order is placed or canceled for any reason. The user gets back the gas in case he manually cancels the order.
account_id: u64User account id
stop_order_type: u64Value to indentify the stop order type. Available values can be found in the constants module.
encrypted_details: MoveVec<u8>Vector containing the blake2b hash obtained from offchain on the stop order parameters. Depending on the stop order type value, a different set of parameters is expected to be used.
Parameters encoded for a SLTP stop order (stop_order_type code 0):
- clearing_house_id: ID
- expire_timestamp: Option
- is_limit_order:
trueif limit order,falseif market order - stop_index_price: u256
- is_stop_loss:
trueif stop loss order,falseif take profit order - position_is_ask:
trueif position is short,falseif position is long - size: u64
- price: u64 (can be set at random value if
is_limit_orderis false) - order_type: u64 (can be set at random value if
is_limit_orderis false) - salt: vector
Parameters encoded for a Standalone stop order (stop_order_type code 1):
- clearing_house_id: ID
- expire_timestamp: Option
- is_limit_order:
trueif limit order,falseif market order - stop_index_price: u256
- ge_stop_index_price:
truemeans the order can be placed when oracle index price is >= than chosenstop_index_price - side: bool
- size: u64
- price: u64 (can be set at random value if
is_limit_orderis false) - order_type: u64 (can be set at random value if
is_limit_orderis false) - reduce_only: bool
- salt: vector