Auction
Contract that auctions discounted MBRN to repay bad debts in the Positions contract or discounted fees swapped for a governance desired asset.
Auctions are initiated by the Positions contract, Staking contract and Governance. The discount increases overtime to ensure the auction is fulfilled.
InstantiateMsg
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct InstantiateMsg {
pub owner: Option<String>,
pub oracle_contract: String,
pub osmosis_proxy: String,
pub positions_contract: String,
pub governance_contract: String,
pub staking_contract: String,
pub twap_timeframe: u64,
pub mbrn_denom: String,
pub initial_discount: Decimal,
pub discount_increase_timeframe: u64,
pub discount_increase: Decimal,
}
Key | Type | Description |
---|
| | |
| | |
| | |
| | Position's contract address |
| | Governance contract address |
| | |
| | |
| | |
| | Starting discount of auctions |
discount_increase_timeframe
| | Timeframe in which the discount is increased |
| | Increase in discount per unit of discount_increase_timeframe |
* = optional
ExecuteMsg
StartAuction
Start or add to ongoing auction
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
StartAuction {
repayment_position_info: Option<UserInfo>,
send_to: Option<String>,
auction_asset: Asset,
}
}
pub struct UserInfo {
pub basket_id: Uint128,
pub position_id: Uint128,
pub position_owner: String,
}
pub struct Asset{
pub info: AssetInfo,
pub amount: Uint128,
}
Key | Type | Description |
---|
| | Position info that holds the bad debt |
| | Send captial to this address |
| | Asset info + amount to swap for |
RemoveAuction
Remove ongoing auction
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
RemoveAuction {}
}
SwapForMBRN
Swap for discounted MBRN with CDT
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
SwapForMBRN {}
}
SwapForFee
Swap for discounted fees with the configuration's desired asset
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
SwapWithMBRN { auction_asset: AssetInfo }
}
UpdateConfig
Update contract configurations
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
UpdateConfig(UpdateConfig)
}
pub struct UpdateConfig {
pub owner: Option<String>,
pub oracle_contract: Option<String>,
pub osmosis_proxy: Option<String>,
pub mbrn_denom: Option<String>,
pub positions_contract: Option<String>,
pub governance_contract: Option<String>,
pub staking_contract: Option<String>,
pub cdt_denom: Option<String>,
pub twap_timeframe: Option<u64>,
pub initial_discount: Option<Decimal>,
pub discount_increase_timeframe: Option<u64>,
pub discount_increase: Option<Decimal>,
pub send_to_stakers: Option<bool>,
}
Key | Type | Description |
---|
| | |
| | |
| | |
| | |
| | Positions contract address |
| | Governance contract address |
| | |
| | |
| | TWAP timeframe for oracle queries |
| | Initial auction MBRN price discount |
*discount_increase_timeframe
| | Timeframe in which the multiple of discount_increase increases |
| | Increase in discount per unit of discount_increase_timeframe |
| | True to send FeeAuction assets to Stakers, defaults to Governance |
* = optional
QueryMsg
Config
Return Config
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Config {}
}
pub struct Config {
pub owner: Addr,
pub oracle_contract: Addr,
pub osmosis_proxy: Addr,
pub mbrn_denom: String,
pub positions_contract: Addr,
pub governance_contract: Addr,
pub staking_contract: Addr,
pub cdt_denom: String,
pub twap_timeframe: u64,
pub initial_discount: Decimal,
pub discount_increase_timeframe: u64, //in seconds
pub discount_increase: Decimal, //% increase
pub send_to_stakers: bool,
}
OngoingFeeAuctions
Returns list of ongoing FeeAuctions
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
OngoingFeeAuctions {
debt_asset: Option<AssetInfo>,
limit: Option<u64>,
start_after: Option<u64>,
}
}
//Returns list of FeeAuction
pub struct FeeAuction {
pub auction_asset: Asset,
pub auction_start_time: u64,
}
Key | Type | Description |
---|
| | Specific auction to return, list of 1 |
| | Limit to the amount of returned responses |
| | Asset to filter out of responses |
* = optional
DebtAuction
Returns DebtAuction info
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
DebtAuction {}
}
pub struct DebtAuction {
pub remaining_recapitalization: Uint128,
pub repayment_positions: Vec<RepayPosition>,
pub send_to: Vec<AuctionRecipient>,
pub auction_start_time: u64,
}