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

*owner

String

Contract owner

oracle_contract

String

Oracle contract address

osmosis_proxy

String

Osmosis Proxy address

positions_contract

String

Position's contract address

governance_contract

String

Governance contract address

staking_contract

String

Staking contract address

twap_timeframe

u64

Timeframe for TWAPs

mbrn_denom

String

MBRN token full denom

initial_discount

Decimal

Starting discount of auctions

discount_increase_timeframe

u64

Timeframe in which the discount is increased

discount_increase

Decimal

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

*repayment_position_info

UserInfo

Position info that holds the bad debt

*send_to

String

Send captial to this address

auction_asset

Asset

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 }
}
KeyTypeDescription

auction_asset

AssetInfo

Auction asset denom

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

*owner

String

Contract owner

*oracle_contract

String

Oracle contract address

*osmosis_proxy

String

Osmosis Proxy address

*mbrn_denom

String

MBRN denom

*positions_contract

String

Positions contract address

*governance_contract

String

Governance contract address

*staking_contract

String

Staking contract address

*cdt_denom

String

CDT denom

*twap_timeframe

u64

TWAP timeframe for oracle queries

*initial_discount

Decimal

Initial auction MBRN price discount

*discount_increase_timeframe

u64

Timeframe in which the multiple of discount_increase increases

*discount_increase

Decimal

Increase in discount per unit of discount_increase_timeframe

*send_to_stakers

bool

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

*debt_asset

AssetInfo

Specific auction to return, list of 1

*limit

u64

Limit to the amount of returned responses

*start_after

u64

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

Last updated