pub enum ExecuteMsg {
Show 31 variants Owner(ExecuteOwnerMsg), Receive { sender: RawAddr, amount: Uint128, msg: Binary, }, OpenPosition { slippage_assert: Option<SlippageAssert>, leverage: LeverageToBase, direction: DirectionToBase, stop_loss_override: Option<PriceBaseInQuote>, take_profit: TakeProfitTrader, }, UpdatePositionAddCollateralImpactLeverage { id: PositionId, }, UpdatePositionAddCollateralImpactSize { id: PositionId, slippage_assert: Option<SlippageAssert>, }, UpdatePositionRemoveCollateralImpactLeverage { id: PositionId, amount: NonZero<Collateral>, }, UpdatePositionRemoveCollateralImpactSize { id: PositionId, amount: NonZero<Collateral>, slippage_assert: Option<SlippageAssert>, }, UpdatePositionLeverage { id: PositionId, leverage: LeverageToBase, slippage_assert: Option<SlippageAssert>, }, UpdatePositionMaxGains { id: PositionId, max_gains: MaxGainsInQuote, }, UpdatePositionTakeProfitPrice { id: PositionId, price: TakeProfitTrader, }, UpdatePositionStopLossPrice { id: PositionId, stop_loss: StopLoss, }, SetTriggerOrder { id: PositionId, stop_loss_override: Option<PriceBaseInQuote>, take_profit: Option<TakeProfitTrader>, }, PlaceLimitOrder { trigger_price: PriceBaseInQuote, leverage: LeverageToBase, direction: DirectionToBase, stop_loss_override: Option<PriceBaseInQuote>, take_profit: TakeProfitTrader, }, CancelLimitOrder { order_id: OrderId, }, ClosePosition { id: PositionId, slippage_assert: Option<SlippageAssert>, }, DepositLiquidity { stake_to_xlp: bool, }, ReinvestYield { stake_to_xlp: bool, amount: Option<NonZero<Collateral>>, }, WithdrawLiquidity { lp_amount: Option<NonZero<LpToken>>, claim_yield: bool, }, ClaimYield {}, StakeLp { amount: Option<NonZero<LpToken>>, }, UnstakeXlp { amount: Option<NonZero<LpToken>>, }, StopUnstakingXlp {}, CollectUnstakedLp {}, Crank { execs: Option<u32>, rewards: Option<RawAddr>, }, NftProxy { sender: RawAddr, msg: ExecuteMsg, }, LiquidityTokenProxy { sender: RawAddr, kind: LiquidityTokenKind, msg: ExecuteMsg, }, TransferDaoFees {}, CloseAllPositions {}, ProvideCrankFunds {}, SetManualPrice { price: PriceBaseInQuote, price_usd: PriceCollateralInUsd, }, PerformDeferredExec { id: DeferredExecId, price_point_timestamp: Timestamp, },
}
Expand description

Execute message for the market contract

Variants§

§

Owner(ExecuteOwnerMsg)

Owner-only executions

§

Receive

cw20

Fields

§sender: RawAddr

Owner of funds sent to the contract

§amount: Uint128

Amount of funds sent

§msg: Binary

Must parse to a ExecuteMsg

§

OpenPosition

Open a new position

Fields

§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 a position, causing leverage to decrease

The amount of collateral to add must be attached as funds

Fields

§id: PositionId

ID of position to update

§

UpdatePositionAddCollateralImpactSize

Add collateral to a position, causing notional size to increase

The amount of collateral to add must be attached as funds

Fields

§id: PositionId

ID of position to update

§slippage_assert: Option<SlippageAssert>

Assertion that the price has not moved too far

§

UpdatePositionRemoveCollateralImpactLeverage

Remove collateral from a position, causing leverage to increase

Fields

§id: PositionId

ID of position to update

§amount: NonZero<Collateral>

Amount of funds to remove from the position

§

UpdatePositionRemoveCollateralImpactSize

Remove collateral from a position, causing notional size to decrease

Fields

§id: PositionId

ID of position to update

§amount: NonZero<Collateral>

Amount of funds to remove from the position

§slippage_assert: Option<SlippageAssert>

Assertion that the price has not moved too far

§

UpdatePositionLeverage

Modify the leverage of the position

This will impact the notional size of the position

Fields

§id: PositionId

ID of position to update

§leverage: LeverageToBase

New leverage of the position

§slippage_assert: Option<SlippageAssert>

Assertion that the price has not moved too far

§

UpdatePositionMaxGains

Modify the max gains of a position

Fields

§id: PositionId

ID of position to update

§max_gains: MaxGainsInQuote

New max gains of the position

§

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

§stop_loss: StopLoss

New stop loss price of the position, or remove

§

SetTriggerOrder

Set a stop loss or take profit override. Deprecated, use UpdatePositionStopLossPrice instead

Fields

§id: PositionId

ID of position to modify

§stop_loss_override: Option<PriceBaseInQuote>

New stop loss price of the position Passing None will remove the override.

§take_profit: Option<TakeProfitTrader>

New take profit price of the position, merely as a trigger. Passing None will bypass changing this This does not affect the locked up counter collateral (or borrow fees etc.). if this override is further away than the position’s take profit price, the position’s will be triggered first if you want to update the position itself, use ExecuteMsg::UpdatePositionTakeProfitPrice

§

PlaceLimitOrder

Set a limit order to open a position when the price of the asset hits the specified trigger price.

Fields

§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

§

CancelLimitOrder

Cancel an open limit order

Fields

§order_id: OrderId

ID of the order

§

ClosePosition

Close a position

Fields

§id: PositionId

ID of position to close

§slippage_assert: Option<SlippageAssert>

Assertion that the price has not moved too far

§

DepositLiquidity

Deposits send funds into the unlocked liquidity fund

Fields

§stake_to_xlp: bool

Should we stake the resulting LP tokens into xLP?

Defaults to false.

§

ReinvestYield

Like ExecuteMsg::DepositLiquidity, but reinvests pending yield instead of receiving new funds.

Fields

§stake_to_xlp: bool

Should we stake the resulting LP tokens into xLP?

Defaults to false.

§amount: Option<NonZero<Collateral>>

Amount of rewards to reinvest.

If None, reinvests all pending rewards.

§

WithdrawLiquidity

Withdraw liquidity calculated from specified lp_amount

Fields

§lp_amount: Option<NonZero<LpToken>>

Amount of LP tokens to burn

§claim_yield: bool

Claim yield as well?

§

ClaimYield

Claims accrued yield based on LP share allocation

§

StakeLp

Stake some existing LP tokens into xLP

None means stake all LP tokens.

Fields

§amount: Option<NonZero<LpToken>>

Amount of LP tokens to convert into xLP.

§

UnstakeXlp

Begin unstaking xLP into LP

None means unstake all xLP tokens.

Fields

§amount: Option<NonZero<LpToken>>

Amount of xLP tokens to convert into LP

§

StopUnstakingXlp

Stop an ongoing xLP unstaking process.

§

CollectUnstakedLp

Collect any LP tokens that have been unstaked from xLP.

§

Crank

Crank a number of times

Fields

§execs: Option<u32>

Total number of crank executions to do None: config default

§rewards: Option<RawAddr>

Which wallet receives crank rewards.

If unspecified, sender receives the rewards.

§

NftProxy

Nft proxy messages. Only allowed to be called by this market’s position_token contract

Fields

§sender: RawAddr

Original caller of the NFT proxy.

§msg: ExecuteMsg

Message sent to the NFT proxy

§

LiquidityTokenProxy

liquidity token cw20 proxy messages. Only allowed to be called by this market’s liquidity_token contract

Fields

§sender: RawAddr

Original caller of the liquidity token proxy.

§kind: LiquidityTokenKind

Whether this was the LP or xLP proxy.

§msg: ExecuteMsg

Message sent to the liquidity token proxy.

§

TransferDaoFees

Transfer all available protocol fees to the dao account

§

CloseAllPositions

Begin force-closing all positions in the protocol.

This can only be performed by the market wind down wallet.

§

ProvideCrankFunds

Provide funds directly to the crank fees.

The person who calls this receives no benefits. It’s intended for the DAO to use to incentivize cranking.

§

SetManualPrice

Set manual price (mostly for testing)

Fields

§price: PriceBaseInQuote

Price of the base asset in terms of the quote.

§price_usd: PriceCollateralInUsd

Price of the collateral asset in terms of USD.

This is generally used for reporting of values like PnL and trade volume.

§

PerformDeferredExec

Perform a deferred exec

This should only ever be called from the market contract itself, any other call is guaranteed to fail.

Fields

§id: DeferredExecId

Which ID to execute

§price_point_timestamp: Timestamp

Which price point to use for this execution.

Trait Implementations§

source§

impl Clone for ExecuteMsg

source§

fn clone(&self) -> ExecuteMsg

Returns a copy 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 ExecuteMsg

source§

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

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

impl<'de> Deserialize<'de> for ExecuteMsg

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 ExecuteMsg

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(gen: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
§

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 ExecuteMsg

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for ExecuteMsg

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 StructuralPartialEq for ExecuteMsg

Auto Trait Implementations§

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
§

impl<U> As for U

§

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§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

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

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

source§

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

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> QueryResultExt for T
where T: Serialize,

source§

fn query_result(&self) -> Result<Binary, Error>

Convert the value to its JSON representation
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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>,

§

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

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

§

fn vzip(self) -> V

source§

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