pub enum DexMsg {
Deposit {
receiver: String,
token_a: String,
token_b: String,
amounts_a: Vec<Uint128>,
amounts_b: Vec<Uint128>,
tick_indexes_a_to_b: Vec<i64>,
fees: Vec<u64>,
options: Vec<DepositOption>,
},
Withdrawal {
receiver: String,
token_a: String,
token_b: String,
shares_to_remove: Vec<Uint128>,
tick_indexes_a_to_b: Vec<i64>,
fees: Vec<u64>,
},
PlaceLimitOrder {
receiver: String,
token_in: String,
token_out: String,
tick_index_in_to_out: i64,
amount_in: Uint128,
order_type: LimitOrderType,
expiration_time: Option<u64>,
max_amount_out: Option<Uint128>,
limit_sell_price: String,
},
WithdrawFilledLimitOrder {
tranche_key: String,
},
CancelLimitOrder {
tranche_key: String,
},
MultiHopSwap {
receiver: String,
routes: Vec<MultiHopRoute>,
amount_in: Uint128,
exit_limit_price: PrecDec,
pick_best_route: bool,
},
}Variants§
Deposit
Deposit provides liquidity to a specific trading pair by depositing tokens at a specific price into one or both sides of the pair in “a liquidity pool”
Fields
tick_indexes_a_to_b: Vec<i64>Tick indexes to deposit at defined in terms of TokenA to TokenB (ie. TokenA is on the left)
options: Vec<DepositOption>Additional deposit options
Withdrawal
Withdraw is used to redeem PoolShares for the user’s pro-rata portion of tokens within a liquidity pool. Users can withdraw from a pool at any time
Fields
Amount of shares to remove from each pool
PlaceLimitOrder
PlaceLimitOrder provides the primary mechanism for trading on the Duality Dex. Limit orders can provide liquidity to the Dex (“Maker Limit Orders”) and/or can be used to trade against preexisting liquidity (“Taker Limit Orders”)
Fields
receiver: StringAccount to which TokenOut is credited or that will be allowed to withdraw or cancel a maker order
order_type: LimitOrderTypeType of limit order to be used. Must be one of: GOOD_TIL_CANCELLED, FILL_OR_KILL, IMMEDIATE_OR_CANCEL, JUST_IN_TIME, or GOOD_TIL_TIME
WithdrawFilledLimitOrder
WithdrawFilledLimitOrder. Once a limit order has been filled – either partially or in its entirety, it can be withdrawn at any time. Withdrawing from a limit order credits all available proceeds to the user. Withdraw can be called on a limit order multiple times as new proceeds become available
CancelLimitOrder
CancelLimitOrder. Standard Taker limit orders (Good-til-cancelled & Good-til-Time) can be canceled at any time if they have not been completely filled
MultiHopSwap
MultiHopSwap provides a swapping mechanism to achieve better prices by routing through a series of pools
Fields
routes: Vec<MultiHopRoute>Array of possible routes
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DexMsg
impl<'de> Deserialize<'de> for DexMsg
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 JsonSchema for DexMsg
impl JsonSchema for DexMsg
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreimpl Eq for DexMsg
impl StructuralPartialEq for DexMsg
Auto Trait Implementations§
impl Freeze for DexMsg
impl RefUnwindSafe for DexMsg
impl Send for DexMsg
impl Sync for DexMsg
impl Unpin for DexMsg
impl UnwindSafe for DexMsg
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<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§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