pub enum ExecuteMsg {
Show 31 variants Owner(ExecuteOwnerMsg), Receive { sender: RawAddr, amount: Uint128, msg: Binary, }, OpenPosition { slippage_assert: Option<SlippageAssert>, leverage: LeverageToBase, direction: DirectionToBase, max_gains: Option<MaxGainsInQuote>, stop_loss_override: Option<PriceBaseInQuote>, take_profit: Option<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, max_gains: Option<MaxGainsInQuote>, stop_loss_override: Option<PriceBaseInQuote>, take_profit: Option<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>>, }, 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

Fields

§sender: RawAddr

Owner of funds sent to the contract

§amount: Uint128

Amount of funds sent

§msg: Binary

Must parse to a ExecuteMsg

cw20

§

OpenPosition

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

§max_gains: Option<MaxGainsInQuote>
👎Deprecated: Use take_profit instead

Maximum gains of new position

§stop_loss_override: Option<PriceBaseInQuote>

Stop loss price of new position

§take_profit: Option<TakeProfitTrader>

Take profit price of new position if max_gains is None, this must be Some

Open a new position

§

UpdatePositionAddCollateralImpactLeverage

Fields

§id: PositionId

ID of position to update

Add collateral to a position, causing leverage to decrease

The amount of collateral to add must be attached as funds

§

UpdatePositionAddCollateralImpactSize

Fields

§id: PositionId

ID of position to update

§slippage_assert: Option<SlippageAssert>

Assertion that the price has not moved too far

Add collateral to a position, causing notional size to increase

The amount of collateral to add must be attached as funds

§

UpdatePositionRemoveCollateralImpactLeverage

Fields

§id: PositionId

ID of position to update

§amount: NonZero<Collateral>

Amount of funds to remove from the position

Remove collateral from a position, causing leverage to increase

§

UpdatePositionRemoveCollateralImpactSize

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

Remove collateral from a position, causing notional size to decrease

§

UpdatePositionLeverage

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

Modify the leverage of the position

This will impact the notional size of the position

§

UpdatePositionMaxGains

Fields

§id: PositionId

ID of position to update

§max_gains: MaxGainsInQuote

New max gains of the position

Modify the max gains of a position

§

UpdatePositionTakeProfitPrice

Fields

§id: PositionId

ID of position to update

§price: TakeProfitTrader

New take profit price of the position

Modify the take profit price of a position

§

UpdatePositionStopLossPrice

Fields

§id: PositionId

ID of position to update

§stop_loss: StopLoss

New stop loss price of the position, or remove

Update the stop loss price of a position

§

SetTriggerOrder

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

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

§

PlaceLimitOrder

Fields

§trigger_price: PriceBaseInQuote

Price when the order should trigger

§leverage: LeverageToBase

Leverage of new position

§direction: DirectionToBase

Direction of new position

§max_gains: Option<MaxGainsInQuote>
👎Deprecated: Use take_profit instead

Maximum gains of new position

§stop_loss_override: Option<PriceBaseInQuote>

Stop loss price of new position

§take_profit: Option<TakeProfitTrader>

Take profit price of new position if max_gains is None, this must be Some

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

§

CancelLimitOrder

Fields

§order_id: OrderId

ID of the order

Cancel an open limit order

§

ClosePosition

Fields

§id: PositionId

ID of position to close

§slippage_assert: Option<SlippageAssert>

Assertion that the price has not moved too far

Close a position

§

DepositLiquidity

Fields

§stake_to_xlp: bool

Should we stake the resulting LP tokens into xLP?

Defaults to false.

Deposits send funds into the unlocked liquidity fund Returns [LiquidityDepositResponseData] as response data

§

ReinvestYield

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.

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

§

WithdrawLiquidity

Fields

§lp_amount: Option<NonZero<LpToken>>

Amount of LP tokens to burn

Withdraw liquidity calculated from specified lp_amount

§

ClaimYield

Fields

Claims accrued yield based on LP share allocation

§

StakeLp

Fields

§amount: Option<NonZero<LpToken>>

Amount of LP tokens to convert into xLP.

Stake some existing LP tokens into xLP

None means stake all LP tokens.

§

UnstakeXlp

Fields

§amount: Option<NonZero<LpToken>>

Amount of xLP tokens to convert into LP

Begin unstaking xLP into LP

None means unstake all xLP tokens.

§

StopUnstakingXlp

Fields

Stop an ongoing xLP unstaking process.

§

CollectUnstakedLp

Fields

Collect any LP tokens that have been unstaked from xLP.

§

Crank

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.

Crank a number of times

§

NftProxy

Fields

§sender: RawAddr

Original caller of the NFT proxy.

§msg: ExecuteMsg

Message sent to the NFT proxy

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

§

LiquidityTokenProxy

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.

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

§

TransferDaoFees

Fields

Transfer all available protocol fees to the dao account

§

CloseAllPositions

Fields

Begin force-closing all positions in the protocol.

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

§

ProvideCrankFunds

Fields

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

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.

Set manual price (mostly for testing)

§

PerformDeferredExec

Fields

§id: DeferredExecId

Which ID to execute

§price_point_timestamp: Timestamp

Which price point to use for this execution.

Perform a deferred exec

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

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 Twhere 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) -> Twhere 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 Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for Twhere 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 Twhere 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.

§

impl<T> QueryResultExt for Twhere T: Serialize,

§

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

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