Search…
Collector
The Collector accumulates fee rewards generated from CDP withdrawal within the protocol, and converts them into UST in order to purchase MIR from the MIR-UST Terraswap pool. The MIR is then sent to the Gov Contract to supply trading fee rewards for MIR stakers.

InitMsg

Rust
JSON
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
pub struct InitMsg {
3
pub distribution_contract: HumanAddr,
4
pub terraswap_factory: HumanAddr,
5
pub mirror_token: HumanAddr,
6
pub base_denom: String,
7
pub aust_token: HumanAddr,
8
pub anchor_market: HumanAddr,
9
pub bluna_token: HumanAddr,
10
pub bluna_swap_denom: String,
11
}
Copied!
1
{
2
"distribution_contract": "terra1...",
3
"terraswap_factory": "terra1...",
4
"mirror_token": "terra1...",
5
"base_denom": "uusd", // native Terra token
6
"aust_token": "terra1...", //aUST params
7
"anchor_market": "terra1...",
8
"bluna_token": "terra1...", //bLuna params
9
"bluna_swap_denom": "uusd"
10
}
Copied!
Key
Type
Description
distribution_contract
HumanAddr
Contract address of Mirror Governance
terraswap_factory
HumanAddr
Contract address of Terraswap Factory
mirror_token
HumanAddr
Contract address of Mirror Token (MIR)
base_denom
String
Base denomination (native Terra token denom)
aust_token
HumanAddr
Address of aUST token contract
anchor_market
HumanAddr
Address of Anchor Market contract
bluna_token
HumanAddr
Address of bLuna token contract
bluna_swap_denom
String
Base denomination which bLuna to be swapped into (uusd)

HandleMsg

UpdateConfig

Updates the configuration of Collector contrat. Can only be called by owner.
Rust
JSON
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
#[serde(rename_all = "snake_case")]
3
pub enum HandleMsg {
4
UpdateConfig {
5
owner: Option<HumanAddr>,
6
distribution_contract: Option<HumanAddr>,
7
terraswap_factory: Option<HumanAddr>,
8
mirror_token: Option<HumanAddr>,
9
base_denom: Option<String>,
10
aust_token: Option<HumanAddr>,
11
anchor_market: Option<HumanAddr>,
12
bluna_token: Option<HumanAddr>,
13
bluna_swap_denom: Option<String>,
14
},
Copied!
1
{
2
"update_config": {
3
"owner": "terra1...",
4
"distribution_contract": "terra1...",
5
"terraswap_factory": "terra1...",
6
"mirror_token": "terra1...",
7
"base_denom": "uusd", // native Terra token
8
"aust_token": "terra1...", //aUST params
9
"anchor_market": "terra1...",
10
"bluna_token": "terra1...", //bLuna params
11
"bluna_swap_denom": "uusd"
12
}
13
}
Copied!
Key
Type
Description
owner*
HumanAddr
Address of the contract owner*
distribution_contract*
HumanAddr
Contract address of Mirror Governance
terraswap_factory*
HumanAddr
Contract address of Terraswap Factory
mirror_token*
HumanAddr
Contract address of Mirror Token (MIR)
base_denom*
String
Base denomination (native Terra token denom)
aust_token*
HumanAddr
Address of aUST token contract
anchor_market*
HumanAddr
Address of Anchor Market contract
bluna_token*
HumanAddr
Address of bLuna token contract
bluna_swap_denom*
String
Base denomination which bLuna to be swapped into (uusd)
*= optional

Convert

Depending on asset_token, performs one of the following:
  • if asset_token is an mAsset Luna or Anchor sells the contract's balance of that mAsset for UST on Terraswap
  • if asset_token is the UST token, buys MIR off the MIR/UST Terraswap pool with the contract's UST balance
  • if asset_token is aUST, or bLuna sells the token based on registered anchor_market or bluna_swap_denom
Rust
JSON
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
#[serde(rename_all = "snake_case")]
3
pub enum HandleMsg {
4
Convert {
5
asset_token: HumanAddr,
6
}
7
}
Copied!
1
{
2
"convert": {
3
"asset_token": "terra1..."
4
}
5
}
Copied!
Key
Type
Description
asset_token
HumanAddr
Contract address of asset to convert

LunaSwapHook

Hook to swap Luna token to MIR.
Rust
JSON
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
#[serde(rename_all = "snake_case")]
3
pub enum HandleMsg {
4
LunaSwapHook {}
5
}
Copied!
1
{
2
"send": {}
3
}
Copied!

QueryMsg

Config

Get the Mirror Collector contract configuration.
Rust
JSON
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
#[serde(rename_all = "snake_case")]
3
pub enum QueryMsg {
4
Config {}
5
}
Copied!

Response

1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
pub struct ConfigResponse {
3
pub owner: HumanAddr,
4
pub distribution_contract: HumanAddr, // collected rewards receiver
5
pub terraswap_factory: HumanAddr,
6
pub mirror_token: HumanAddr,
7
pub base_denom: String,
8
pub aust_token: HumanAddr,
9
pub anchor_market: HumanAddr,
10
pub bluna_token: HumanAddr,
11
pub bluna_swap_denom: String,
12
}
Copied!
Key
Type
Description
owner
HumanAddr
Address of the contract owner*
distribution_contract
HumanAddr
Contract address of Mirror Governance
terraswap_factory
HumanAddr
Contract address of Terraswap Factory
mirror_token
HumanAddr
Contract address of Mirror Token (MIR)
base_denom
String
Base denomination (native Terra token denom)
aust_token
HumanAddr
Address of aUST token contract
anchor_market
HumanAddr
Address of Anchor Market contract
bluna_token
HumanAddr
Address of bLuna token contract
bluna_swap_denom
String
Base denomination which bLuna to be swapped into (uusd)
1
{
2
"config": {}
3
}
Copied!

Response

1
{
2
"config_response": {
3
"owner": "terra1...",
4
"distribution_contract": "terra1...",
5
"terraswap_factory": "terra1...",
6
"mirror_token": "terra1...",
7
"base_denom": "uusd", // native Terra token
8
"aust_token": "terra1...", //aUST params
9
"anchor_market": "terra1...",
10
"bluna_token": "terra1...", //bLuna params
11
"bluna_swap_denom": "uusd"
12
}
13
}
Copied!
Key
Type
Description
owner
HumanAddr
Address of the contract owner*
distribution_contract
HumanAddr
Contract address of Mirror Governance
terraswap_factory
HumanAddr
Contract address of Terraswap Factory
mirror_token
HumanAddr
Contract address of Mirror Token (MIR)
base_denom
String
Base denomination (native Terra token denom)
aust_token
HumanAddr
Address of aUST token contract
anchor_market
HumanAddr
Address of Anchor Market contract
bluna_token
HumanAddr
Address of bLuna token contract
bluna_swap_denom
String
Base denomination which bLuna to be swapped into (uusd)
Last modified 5mo ago