Distribution Model
The Distribution Model contract manages the calculation of the ANC emission rate, using fed in deposit rate information. At the time of protocol genesis, the emission rate adjusts to double when the deposit rate is below the targeted rate and decreases by 10% if the deposit rate is above the targeted rate. Further descriptions on the ANC emission rate control mechanism can be found here.

Config

Key
Type
Description
owner
CanonicalAddr
Address of contract owner
emission_cap
Decimal256
Maximum per-block ANC emission rate
emission_floor
Decimal256
Minimum per-block ANC emission rate
increment_multiplier
Decimal256
Rate multiplier when increasing emission
decrement_multiplier
Decimal256
Rate multiplier when decreasing emission

InstantiateMsg

Rust
JSON
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
pub struct InstantiateMsg {
3
pub owner: String,
4
pub emission_cap: Decimal256,
5
pub emission_floor: Decimal256,
6
pub increment_multiplier: Decimal256,
7
pub decrement_multiplier: Decimal256,
8
}
Copied!
1
{
2
"owner": "terra1...",
3
"emission_cap": "10000",
4
"emission_floor": "1000",
5
"increment_multiplier": "2.0",
6
"decrement_multiplier": "0.9"
7
}
Copied!
Key
Type
Description
owner
String
Address of contract owner
emission_cap
Decimal256
Maximum per-block ANC emission rate
emission_floor
Decimal256
Minimum per-block ANC emission rate
increment_multiplier
Decimal256
Rate multiplier when increasing emission
decrement_multiplier
Decimal256
Rate multiplier when decreasing emission

ExecuteMsg

UpdateConfig

Updates the Distribution Model contract configuration.
Rust
JSON
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
#[serde(rename_all = "snake_case")]
3
pub enum ExecuteMsg {
4
UpdateConfig {
5
owner: Option<String>,
6
emission_cap: Option<Decimal256>,
7
emission_floor: Option<Decimal256>,
8
increment_multiplier: Option<Decimal256>,
9
decrement_multiplier: Option<Decimal256>,
10
}
11
}
Copied!
1
{
2
"update_config": {
3
"owner": "terra1...",
4
"emission_cap": "10000",
5
"emission_floor": "1000",
6
"increment_multiplier": "2.0",
7
"decrement_multiplier": "0.9"
8
}
9
}
Copied!
Key
Type
Description
owner*
String
Address of new owner
emission_cap*
Decimal256
New maximum per-block ANC emission rate
emission_floor*
Decimal256
New minimum per-block ANC emission rate
increment_multiplier*
Decimal256
New rate multiplier when increasing emission
decrement_multiplier*
Decimal256
New rate multiplier when decreasing emission
* = optional

QueryMsg

Config

Gets the Distribution Model 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!
1
{
2
"config": {}
3
}
Copied!
Key
Type
Description

ConfigResponse

Rust
JSON
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
pub struct ConfigResponse {
3
pub owner: String,
4
pub emission_cap: Decimal256,
5
pub emission_floor: Decimal256,
6
pub increment_multiplier: Decimal256,
7
pub decrement_multiplier: Decimal256,
8
}
Copied!
1
{
2
"owner": "terra1...",
3
"emission_cap": "10000",
4
"emission_floor": "1000",
5
"increment_multiplier": "2.0",
6
"decrement_multiplier": "0.9"
7
}
Copied!
Key
Type
Description
owner
String
Address of contract owner
emission_cap
Decimal256
Maximum per-block ANC emission rate
emission_floor
Decimal256
Minimum per-block ANC emission rate
increment_multiplier
Decimal256
Rate multiplier when increasing emission
decrement_multiplier
Decimal256
Rate multiplier when decreasing emission

ANCEmissionRate

Gets the ANC emission rate, calculated based on deposit rate situations.
Rust
JSON
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
#[serde(rename_all = "snake_case")]
3
pub enum QueryMsg {
4
ANCEmissionRate {
5
deposit_rate: Decimal256,
6
target_deposit_rate: Decimal256,
7
threshold_deposit_rate: Decimal256,
8
current_emission_rate: Decimal256,
9
}
10
}
Copied!
1
{
2
"anc_emission_rate": {
3
"deposit_rate": "0.0001",
4
"target_deposit_rate": "0.00015",
5
"threshol_deposit_rate": "0.00010",
6
"current_emission_rate": "5000"
7
}
8
}
Copied!
Key
Type
Description
deposit_rate
Decimal256
Average per-block deposit rate during the last epoch
target_deposit_rate
Decimal256
Target per-block deposit rate of Anchor
threshold_deposit_rate
Decimal256
Minimum per-block deposit rate supported by Anchor
current_emission_rate
Decimal256
Current per-block ANC emission rate

ANCEmissionRateResponse

Rust
JSON
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
pub struct ANCEmissionRateResponse {
3
pub emission_rate: Decimal256,
4
}
Copied!
1
{
2
"emission_rate": "10000"
3
}
Copied!
Key
Type
Description
emission_rate
Decimal256
Calculated per-block ANC emission rate
Last modified 17d ago