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
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>
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
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>
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
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
Deposits send funds into the unlocked liquidity fund Returns [LiquidityDepositResponseData] as response data
ReinvestYield
Fields
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
Withdraw liquidity calculated from specified lp_amount
ClaimYield
Fields
Claims accrued yield based on LP share allocation
StakeLp
Stake some existing LP tokens into xLP
None means stake all LP tokens.
UnstakeXlp
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
Crank a number of times
NftProxy
Fields
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
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
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
impl Clone for ExecuteMsg
source§fn clone(&self) -> ExecuteMsg
fn clone(&self) -> ExecuteMsg
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ExecuteMsg
impl Debug for ExecuteMsg
source§impl<'de> Deserialize<'de> for ExecuteMsg
impl<'de> Deserialize<'de> for ExecuteMsg
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 ExecuteMsg
impl JsonSchema for ExecuteMsg
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(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moresource§impl PartialEq for ExecuteMsg
impl PartialEq for ExecuteMsg
source§fn eq(&self, other: &ExecuteMsg) -> bool
fn eq(&self, other: &ExecuteMsg) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for ExecuteMsg
impl Serialize for ExecuteMsg
impl StructuralPartialEq for ExecuteMsg
Auto Trait Implementations§
impl RefUnwindSafe for ExecuteMsg
impl Send for ExecuteMsg
impl Sync for ExecuteMsg
impl Unpin for ExecuteMsg
impl UnwindSafe for ExecuteMsg
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere T: CastFrom<U>,
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