Enum DexMsg

Source
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

§receiver: String

The account to which PoolShares will be issued

§token_a: String

Denom for one side of the deposit

§token_b: String

Denom for the opposing side of the deposit

§amounts_a: Vec<Uint128>

Amounts of tokenA to deposit

§amounts_b: Vec<Uint128>

Amounts of tokenB to deposit

§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)

§fees: Vec<u64>

Fees to use for each deposit

§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

§receiver: String

The account to which the tokens are credited

§token_a: String

Denom for one side of the deposit

§token_b: String

Denom for the opposing side of the deposit

§shares_to_remove: Vec<Uint128>

Amount of shares to remove from each pool

§tick_indexes_a_to_b: Vec<i64>

Tick indexes of the target LiquidityPools defined in terms of TokenA to TokenB (ie. TokenA is on the left)

§fees: Vec<u64>

Fee for the target LiquidityPools

§

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: String

Account to which TokenOut is credited or that will be allowed to withdraw or cancel a maker order

§token_in: String

Token being “sold”

§token_out: String

Token being “bought”

§tick_index_in_to_out: i64

Limit tick for a limit order, specified in terms of TokenIn to TokenOut

§amount_in: Uint128

Amount of TokenIn to be traded

§order_type: LimitOrderType

Type 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

§expiration_time: Option<u64>

Expiration time for order. Only valid for GOOD_TIL_TIME limit orders

§max_amount_out: Option<Uint128>

Maximum amount of TokenB can be bought. For everything except JUST_IN_TIME OrderType

§limit_sell_price: String

Accepts standard decimals and decimals with scientific notation (ie. 1234.23E-7)

§

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

Fields

§tranche_key: String

TrancheKey for the target limit order

§

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

Fields

§tranche_key: String

TrancheKey for the target limit order

§

MultiHopSwap

MultiHopSwap provides a swapping mechanism to achieve better prices by routing through a series of pools

Fields

§receiver: String

Account to which TokenOut is credited

§routes: Vec<MultiHopRoute>

Array of possible routes

§amount_in: Uint128

Amount of TokenIn to swap

§exit_limit_price: PrecDec

Minimum price that that must be satisfied for a route to succeed

§pick_best_route: bool

If true all routes are run and the route with the best price is used

Trait Implementations§

Source§

impl Clone for DexMsg

Source§

fn clone(&self) -> DexMsg

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DexMsg

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DexMsg

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for DexMsg

Source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for DexMsg

Source§

fn eq(&self, other: &DexMsg) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for DexMsg

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for DexMsg

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts 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 more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,