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

Rust
#[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.
Rust
JSON
#[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,
}
{
"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": "...",
}
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.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
Receive {
amount: Uint128,
sender: Addr,
msg: Option<Binary>,
}
}
{
"receive": {
"amount": "10000000",
"sender": "terra1...",
"msg": "eyAiZXhlY3V0ZV9tc2ciOiAiYmxhaCBibGFoIiB9"
}
}
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
Rust
JSON
#[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>,
}
}
{
"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": "...",
}
}
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
Rust
JSON
#[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>,
},
}
{
"referral_reward_limit_option": {
"overflow_amount_recipient" : "...",
"base_count":2,
"percent_for_governance_staking" : 30
}
}
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

Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
SetReuseOverflowAmount {}
}
{
"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
#[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>,
},
}
{
"create_campaign": {
"config_msg": "...",
"deposit_denom": "VKR",
"deposit_amount": 100,
"deposit_lock_period": 7,
"qualifier": "terra1...",
"qualification_description": "this is...",
"executions": ["...",]
}
}
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.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
SpendFee {
amount: Option<Uint128>,
},
}
{
"create_campaign": {
"config_msg": "...",
"deposit_denom": "VKR",
"deposit_amount": 100,
"deposit_lock_period": 7,
"qualifier": "terra1...",
"qualification_description": "this is...",
"executions": ["...",]
}
}
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.
Rust
JSON
#[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>>,
},
}
{
"create_campaign": {
"config_msg": "...",
"deposit_denom": "VKR",
"deposit_amount": 100,
"deposit_lock_period": 7,
"qualifier": "terra1...",
"qualification_description": "this is...",
"executions": ["...",]
}
}
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

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

Response

Rust
JSON
#[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,
}
{
"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": "...",
}
}
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

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

Response

Rust
JSON
#[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,
}
{
"referral_reward_limit_option_response":{
"overflow_amount_recipient": "terra1..."
"base_count" : 2,
"percent_for_governance_staking" : 30,
},
}
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

Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Campaign {
address: String,
}
}
{
"campaign" : {
"address": "terra1..."
}
}
Key
Type
Description
address
String
Campaign contract address

Response

Rust
JSON
pub struct CampaignResponse {
pub code_id: u64,
pub address: String,
pub creator: String,
pub created_height: u64,
}
{
"campaign_response": {
"code_id": 0
"address" : "terra1...",
"creator" : "terra1...",
"created_height" : 2000,
}
}
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

Rust
JSON
#[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>,
}
}
{
"campaigns" : {
"start_after": "12344",
"limit": "12344",
"order_by": ,
}
}
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

Rust
JSON
#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema)]
pub struct CampaignsResponse {
pub campaigns: Vec<CampaignResponse>
}
{
"campaigns":[
{
"code_id": 0
"address" : "terra1...",
"creator" : "terra1...",
"created_block" : 2000,
},
]
}
Key
Type
Description
campaigns
Vec<CampaignResponse>
List of campaign