Campaign Manager

The campaign manager contract manages the shared settings of the campaign and the fees incurred in depositing and withdrawing campaign rewards.

Some of the fees are burned at a set rate, and some are paid as rewards to the governance stakers. The burn rate and non-burn volume collection wallet can be changed through governance voting.

All native tokens, cw20 tokens deposited into the campaign manager contract are considered fees. Tokens that can be exchanged for VKR are frequently exchanged for VKR and burned/transferred.

InstantiateMsg

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct InstantiateMsg {
    pub governance: String,
    pub terraswap_router: String,
    pub code_id: u64,
    pub add_pool_fee_rate: Decimal,
    pub add_pool_min_referral_reward_rate: Decimal,
    pub remove_pool_fee_rate: Decimal,
    pub fee_burn_ratio: Decimal,
    pub fee_recipient: String,
    pub deactivate_period: u64,
    pub key_denom: Denom,
    pub valkyrie_token: String,
    pub referral_reward_limit_option: ReferralRewardLimitOptionMsg,
}

Type

Description

governance

String

Contract address of governance

terraswap_router

String

Contract address of terraswap-router

code_id

u64

Campaign ID code_id

add_pool_fee_rate

Decimal

Fee rate of total deposit amount

add_pool_min_ referral_reward_rate

Decimal

Minimum ratio of Referral rewards in the reward pool. (If 0.2 then the participation: referral rewards is 8:2)

remove_pool_fee_rate

Decimal

Fee rate of total withdrawal amount

fee_burn_ratio

Decimal

Burn ratio

fee_recipient*

String

Destination Address for Withdraw Fee

deactivate_preiod

u64

Campaign deactivation period (based on the height of the last participation or the height of the activate message)

key_denom

Denom

Base currency denomination

valkyrie_token

String

Valkyrie token contract address

referral_reward_limit_option

ReferralRewardLimitOptionMsg

Limit of max referral rewards achievable

CampaignInstantiateMsg

This message is shown through ExecuteMsg::CreateCampaign when a campaign is created. We do not recommend creating a campaign contract without the assistance of the Campaign Manager.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct CampaignInstantiateMsg {
    pub governance: String,
    pub campaign_manager: String,
    pub admin: String,
    pub creator: String,
    pub config_msg: Binary,
    pub deposit_denom: Option<Denom>,
    pub deposit_amount: Uint128,
    pub deposit_lock_period: u64
    pub qualifier: Option<String>,
    pub qualification_description: Option<String>,
    pub executions: Vec<ExecutionMsg>,
    pub referral_reward_token: String,
}

Key

Type

Description

governance

String

Contract address of governance

campaign_manager

String

Contract address of campaign-manager

admin

String

Campaign manager address

creator

String

Campaign creator address

config_msg

Binary

Campaign configuration message (json format)

deposit_denom*

Denom

Campaign participation deposit currency unit

deposit_amount

Uint128

Campaign participation deposit currency Amount

deposit_lock_period

u64

Campaign participation deposit lock period

qualifier*

String

Contract address of qualifier

qualification_description*

String

Participation requirements description

execution

Vec<ExecutionMsg>

Message displayed upon participation

referral_reward_token

String

Referral reward token

* = optional

ExecuteMsg

Receive

Can be called during a CW20 token transfer when the Campaign Manager contract is the recipient.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    Receive {
        amount: Uint128,
        sender: Addr,
        msg: Option<Binary>,
    }
}

Key

Type

Description

Cw20ReceiveMsg

Uint128

Amount of tokens received

sender

Addr

Sender of token transfer

msg*

Binary

Base64-encoded JSON of receive hook

* = optional

UpdateConfig

Updates the configuration

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    UpdateConfig {
        governance: Option<String>,
        valkyrie_token: Option<String>,
        terraswap_router: Option<String>,
        code_id: Option<u64>,
        add_pool_fee_rate: Option<Decimal>,
        add_pool_min_referral_reward_rate: Option<Decimal>,
        remove_pool_fee_rate: Option<Decimal>,
        fee_burn_ratio: Option<Decimal>,
        fee_recipient: Option<String>,
        deactivate_period: Option<u64>,
        key_denom: Option<Denom>,
    }
}

Key

Type

Description

governance*

String

Contract address of governance

valkyrie_token*

String

Valkyrie token contract address

terraswap_router*

String

Contract address of terraswap-router

code_id*

u64

Campaign code ID

add_pool_fee_rate*

Decimal

Deposit fee rate

add_pool_min_ referral_reward_rate

Decimal

Minimum ratio of Referral rewards in the reward pool. (If 0.2 then the participation: referral rewards is 8:2)

remove_pool_fee_rate*

Decimal

Withdraw fee rate

fee_burn_ratio

Decimal

Burn ratio

fee_recipient*

String

Destination address for withdraw fee

deactivate_preiod*

u64

Campaign deactivation period (based on the height of the last participation or the height of the activate message)

key_denom*

Denom

Base currency denomination

* = optional

UpdateReferralRewardLimitOption

Updates the referral reward limit option

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    UpdateReferralRewardLimitOption {
        overflow_amount_recipient: Option<String>,
        base_count: Option<u8>,
        percent_for_governance_staking: Option<u16>,
    },
}

Key

Type

Description

overflow_amount_recipient*

String

Destination address for added limit amount

base_count*

u8

min_referral_reward_amount = base_count * sum(referral_reward_scheme)

precent_for_governance_staking*

u16

referral_reward_limit_amount = max(gov_staking_balance * percent_for_governance_staking / 100, min_referral_reward_amount)

* = optional

SetReuseOverflowAmount

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    SetReuseOverflowAmount {}
}

CreateCampaign

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    CreateCampaign {
        config_msg: Binary,
        deposit_denom: Option<Denom>,
        deposit_amount: Option<Uint128>,
        deposit_lock_period: Option<u64>,
        qualifier: Option<String>,
        qualification_description: Option<String>,
        executions: Vec<ExecutionMsg>,
    },
}

Key

Type

Description

config_msg

Binary

Campaign configuration

deposit_denom*

Denom

Campaign deposit denomination

deposit_amount*

Uint128

Campaign deposit minimum amount

deposit_lock_period*

u64

Campaign deposit lock period

qualifier*

String

Contract address of qualifier

qualification_description*

String

Campaign participation description

executions

Vec<ExecutionMsg>

Successful participation msg

* = optional

Spend Fee

When this message is executed, it is burned by the ratio of fee_burn_ratio among the set values, and the remaining amount is sent to fee_recipient.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    SpendFee {
        amount: Option<Uint128>,
    },
}

Key

Type

Description

amount*

Uint128

Amount to be burned/transferred (if null, all amounts)

Swap Fee

Swap the native token or cw20 token that the campaign manager has for VKR using terraswap. Therefore, the token (or denom-VKR pair) specified in route must be registered in terraswap.

route means token swap route. For example, if you want to swap uluna to VKR without an uluna-VKR pair, enter [uluna, uusd] in route in the order. This will swap uluna to uusd and again swap uusd to VKR.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    SwapFee {
        denom: Denom,
        amount: Option<Uint128>,
        route: Option<Vec<Denom>>,
    },
}

Key

Type

Description

denom

Denom

Tokens to be swapped

amount*

Uint128

Amount to swap (if null, total amount)

route*

Vec<Denom>

Swap path

QueryMsg

Config

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    Config {}
}

Response

#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema)]
pub struct ConfigResponse {
    pub governance: String,
    pub valkyrie_token: String,
    pub terraswap_router: String,
    pub code_id: u64,
    pub add_pool_fee_rate: Decimal,
    pub add_pool_min_referral_reward_rate: Decimal,
    pub remove_pool_fee_rate: Decimal,
    pub fee_burn_ratio: Decimal,
    pub fee_recipient: String,
    pub deactivate_period: u64,
    pub key_denom: Denom,
}

Key

Type

Description

governance

String

Contract address of governance

valkyrie_token

String

Valkyrie token contract address

terraswap_router

String

Contract address of terraswap-router

code_id*

u64

Campaign code ID

add_pool_fee_rate

Decimal

Deposit fee rate

add_pool_min_ referral_reward_rate

Decimal

Minimum ratio of referral rewards in the reward pool. (If 0.2 then the participation: referral rewards is 8:2)

remove_pool_fee_rate

Decimal

Withdraw fee rate

fee_burn_ratio

Decimal

Burn ratio

fee_recipient

String

Destination address for withdraw fee

deactivate_preiod

u64

Campaign deactivation period (based on the height of the last participation or the height of the activate message)

key_denom

Denom

Base currency denomination

ReferralRewardLimitOption

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    ReferralRewardLimitOption {}
}

Response

#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema)]
pub struct ReferralRewardLimitOptionResponse {
    pub overflow_amount_recipient: Option<String>,
    pub base_count: u8,
    pub percent_for_governance_staking: u16,
}

Key

Type

Description

overflow_amount_recipient*

String

Destination address for added limit amount

base_count*

u8

min_referral_reward_amount = base_count * sum(referral_reward_scheme)

precent_for_governance_staking*

u16

referral_reward_limit_amount = max(gov_staking_balance * percent_for_governance_staking / 100, min_referral_reward_amount)

* = optional

Campaign

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    Campaign {
        address: String,
    }
}

Key

Type

Description

address

String

Campaign contract address

Response

pub struct CampaignResponse {
    pub code_id: u64,
    pub address: String,
    pub creator: String,
    pub created_height: u64,
}

Key

Type

Description

code_id

Uint64

Smart contract code id

address

String

Address of campaign contract

creator

String

Address of creator wallet

created_height

Uint64

Created campaign block height

Campaigns

QueryMsg

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    Campaigns {
        start_after: Option<String>,
        limit: Option<u32>,
        order_by: Option<OrderBy>,
    }
}

Key

Type

Description

start_after*

String

Contract address of campaign to start query at

limit*

u32

Maximum number of query entries

order_by*

OrderBy

Order to make query

* = optional

Response

#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema)]
pub struct CampaignsResponse {
    pub campaigns: Vec<CampaignResponse>
}

Key

Type

Description

campaigns

Vec<CampaignResponse>

List of campaign

Last updated