Margin Proxy

Looped leverage contract that interacts w/ the Positions contract for the user

InstantiateMsg

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct InstantiateMsg {
    pub owner: Option<String>,
    pub apollo_router_contract: String,
    pub positions_contract: String,
    pub max_slippage: Decimal,
}
Key
Type
Description

*owner

String

Contract owner, defaults to info.sender

apollo_router_contract

String

Apollo DEX router contract

positions_contract

String

Positions contract

max_slippage

Decimal

Max slippage for asset swaps

* = optional

ExecuteMsg

Deposit

Deposits asset into a contract owned Position in the Positions contract

Key
Type
Description

*position_id

Uint128

Position ID, creates new position if not passed

* = optional

Loop

Loop credit sales to buy more collateral on leverage

Key
Type
Description

position_id

Uint128

Position ID

*num_loops

u64

Max number of loops

target_LTV

Decimal

LTV to use to loop position

* = optional

ClosePosition

Close position and send excess credit and leftover collateral to the owner

Key
Type
Description

position_id

Uint128

Position ID

max_spread

Decimal

Spread used to ensure collateral sold repays the debt amount

UpdateConfig

Update contract configuration

Key
Type
Description

*owner

String

Contract owner

*positions_contract

String

Positions contract

*apollo_router_contract

String

Apollo DEX router contract

*max_slippage

Decimal

Max slippage for collateral sales when looping

* = optional

QueryMsg

Config

Returns contract configuration

GetUserPositions

Returns user's positions hosted by this contract

Key
Type
Description

user

String

User address that owns the positions

Last updated