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
Rust
Copy #[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 ,
}
Contract address of governance
Contract address of terraswap-router
Fee rate of total deposit amount
add_pool_min_ referral_reward_rate
Minimum ratio of Referral rewards in the reward pool. (If 0.2 then the participation: referral rewards is 8:2)
Fee rate of total withdrawal amount
Destination Address for Withdraw Fee
Campaign deactivation period (based on the height of the last participation or the height of the activate message)
Base currency denomination
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.
Rust JSON
Copy #[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 ,
}
Copy {
"governance" : "terra1..." ,
"campaign_manger" : "terra1..." ,
"fund_manager" : "terra1..." ,
"admin" : "terra1..." ,
"creator" : "terra1..." ,
"config_msg" : "..." ,
"deposit_denom" : "VKR" ,
"deposit_amount" : 100 ,
"deposit_lock_period" : 7 ,
"qualifier" : "terra1..." ,
"qualification_description" : "this is..." ,
"executions" : [ "..." , ]
"referral_reward_token" : "..." ,
}
Contract address of governance
Contract address of campaign-manager
Campaign configuration message (json format)
Campaign participation deposit currency unit
Campaign participation deposit currency Amount
Campaign participation deposit lock period
Contract address of qualifier
qualification_description*
Participation requirements description
Message displayed upon participation
* = optional
ExecuteMsg
Receive
Can be called during a CW20 token transfer when the Campaign Manager contract is the recipient.
Rust JSON
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
#[serde(rename_all = "snake_case" )]
pub enum ExecuteMsg {
Receive {
amount : Uint128 ,
sender : Addr ,
msg : Option < Binary >,
}
}
Copy {
"receive" : {
"amount" : "10000000" ,
"sender" : "terra1..." ,
"msg" : "eyAiZXhlY3V0ZV9tc2ciOiAiYmxhaCBibGFoIiB9"
}
}
Amount of tokens received
Base64-encoded JSON of receive hook
* = optional
UpdateConfig
Updates the configuration
Rust JSON
Copy #[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 >,
}
}
Copy {
"UpdateConfig" : {
"governance" : "..." ,
"valkyrie_token" : "VKR"
"terraswap_router" : "..." ,
"code_id" : 1 ,
"add_pool_fee_rate" : 1 ,
"add_pool_min_referral_reward_rate" : 20 ,
"remove_pool_fee_rate" : 10 ,
"fee_burn_ratio" : 50 ,
"fee_recipient" : "terra1..." ,
"deactivate_period" : 30 ,
"key_denom" : "..." ,
}
}
Contract address of governance
Valkyrie token contract address
Contract address of terraswap-router
add_pool_min_ referral_reward_rate
Minimum ratio of Referral rewards in the reward pool. (If 0.2 then the participation: referral rewards is 8:2)
Destination address for withdraw fee
Campaign deactivation period (based on the height of the last participation or the height of the activate message)
Base currency denomination
* = optional
UpdateReferralRewardLimitOption
Updates the referral reward limit option
Rust JSON
Copy #[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 >,
},
}
Copy {
"referral_reward_limit_option" : {
"overflow_amount_recipient" : "..." ,
"base_count" : 2 ,
"percent_for_governance_staking" : 30
}
}
overflow_amount_recipient*
Destination address for added limit amount
min_referral_reward_amount = base_count * sum(referral_reward_scheme)
precent_for_governance_staking*
referral_reward_limit_amount = max(gov_staking_balance * percent_for_governance_staking / 100, min_referral_reward_amount)
* = optional
SetReuseOverflowAmount
Rust JSON
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
#[serde(rename_all = "snake_case" )]
pub enum ExecuteMsg {
SetReuseOverflowAmount {}
}
Copy {
"create_campaign" : {
"config_msg" : "..." ,
"collateral_denom" : "VKR" ,
"collateral_amount" : 100 ,
"collateral_lock_period" : 7 ,
"ticket_amount" : 1 ,
"qualifier" : "terra1..." ,
"qualification_description" : "this is..." ,
"executions" : [ "..." , ]
}
}
CreateCampaign
Rust JSON
Copy #[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 >,
},
}
Copy {
"create_campaign" : {
"config_msg" : "..." ,
"deposit_denom" : "VKR" ,
"deposit_amount" : 100 ,
"deposit_lock_period" : 7 ,
"qualifier" : "terra1..." ,
"qualification_description" : "this is..." ,
"executions" : [ "..." , ]
}
}
Campaign deposit denomination
Campaign deposit minimum amount
Campaign deposit lock period
Contract address of qualifier
qualification_description*
Campaign participation description
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
.
Rust JSON
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
#[serde(rename_all = "snake_case" )]
pub enum ExecuteMsg {
SpendFee {
amount : Option < Uint128 >,
},
}
Copy {
"create_campaign" : {
"config_msg" : "..." ,
"deposit_denom" : "VKR" ,
"deposit_amount" : 100 ,
"deposit_lock_period" : 7 ,
"qualifier" : "terra1..." ,
"qualification_description" : "this is..." ,
"executions" : [ "..." , ]
}
}
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.
Rust JSON
Copy #[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 >>,
},
}
Copy {
"create_campaign" : {
"config_msg" : "..." ,
"deposit_denom" : "VKR" ,
"deposit_amount" : 100 ,
"deposit_lock_period" : 7 ,
"qualifier" : "terra1..." ,
"qualification_description" : "this is..." ,
"executions" : [ "..." , ]
}
}
Amount to swap (if null, total amount)
QueryMsg
Config
Rust JSON
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
#[serde(rename_all = "snake_case" )]
pub enum QueryMsg {
Config {}
}
Response
Rust JSON
Copy #[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 ,
}
Copy {
"config_response" : {
"governance" : "..." ,
"valkyrie_token" : "VKR"
"terraswap_router" : "..." ,
"code_id" : 1 ,
"add_pool_fee_rate" : 1 ,
"add_pool_min_referral_reward_rate" : 20 ,
"remove_pool_fee_rate" : 10 ,
"fee_burn_ratio" : 50 ,
"fee_recipient" : "terra1..." ,
"deactivate_period" : 30 ,
"key_denom" : "..." ,
}
}
Contract address of governance
Valkyrie token contract address
Contract address of terraswap-router
add_pool_min_ referral_reward_rate
Minimum ratio of referral rewards in the reward pool. (If 0.2 then the participation: referral rewards is 8:2)
Destination address for withdraw fee
Campaign deactivation period (based on the height of the last participation or the height of the activate message)
Base currency denomination
ReferralRewardLimitOption
Rust JSON
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
#[serde(rename_all = "snake_case" )]
pub enum QueryMsg {
ReferralRewardLimitOption {}
}
Copy {
"referral_reward_limit_option" : { }
}
Response
Rust JSON
Copy #[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 ,
}
Copy {
"referral_reward_limit_option_response" :{
"overflow_amount_recipient" : "terra1..."
"base_count" : 2 ,
"percent_for_governance_staking" : 30 ,
} ,
}
overflow_amount_recipient*
Destination address for added limit amount
min_referral_reward_amount = base_count * sum(referral_reward_scheme)
precent_for_governance_staking*
referral_reward_limit_amount = max(gov_staking_balance * percent_for_governance_staking / 100, min_referral_reward_amount)
* = optional
Campaign
Rust JSON
Copy #[derive( Serialize , Deserialize , Clone , Debug , PartialEq , JsonSchema )]
#[serde(rename_all = "snake_case" )]
pub enum QueryMsg {
Campaign {
address : String ,
}
}
Copy {
"campaign" : {
"address" : "terra1..."
}
}
Campaign contract address
Response
Rust JSON
Copy pub struct CampaignResponse {
pub code_id : u64 ,
pub address : String ,
pub creator : String ,
pub created_height : u64 ,
}
Copy {
"campaign_response" : {
"code_id" : 0
"address" : "terra1..." ,
"creator" : "terra1..." ,
"created_height" : 2000 ,
}
}
Address of campaign contract
Address of creator wallet
Created campaign block height
Campaigns
QueryMsg
Rust JSON
Copy #[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 >,
}
}
Copy {
"campaigns" : {
"start_after" : "12344" ,
"limit" : "12344" ,
"order_by" : ,
}
}
Contract address of campaign to start query at
Maximum number of query entries
* = optional
Response
Rust JSON
Copy #[derive( Serialize , Deserialize , Clone , PartialEq , JsonSchema )]
pub struct CampaignsResponse {
pub campaigns : Vec < CampaignResponse >
}
Copy {
"campaigns" :[
{
"code_id" : 0
"address" : "terra1..." ,
"creator" : "terra1..." ,
"created_block" : 2000 ,
} ,
]
}