Skip to main content

liquid_finance/staking/
handle_msg.rs

1use cosmwasm_std::Uint128;
2use cw20::Cw20ReceiveMsg;
3use schemars::JsonSchema;
4use serde::{Deserialize, Serialize};
5
6use super::init_msg::DelegationPercentage;
7
8#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
9#[serde(rename_all = "snake_case")]
10pub enum ExecuteMsg {
11    /// Moves native tokens sent along the message to the staking pool, and gives back liquid tokens
12    /// to the sender (or to the address sender put into the optional to param).
13    Stake { to: Option<String> },
14    /// Gives sender his claimable unstaked native token, should be called after sender’s
15    /// unstaking request is processed.
16    Claim {},
17    /// Updates admin’s addresses, only the admin can call this.
18    SetAdmin { admin: Option<String>, pause_admin: Option<String>, },
19    /// Updates contract state, only the pause admin can call this.
20    SetContractState { state: bool },
21    /// Set the liquid token address, only the admin can call this.
22    /// This can only be called once after deploying the liquid token contract.
23    SetLiquidToken { address: String },
24    /// Update the configs relate to the incentives handling of staking rewards, only the admin can call this.
25    SetRewardsConfig {
26        swap_contract_addr: Option<String>,
27        treasury_contract_addr: Option<String>,
28        team_wallet_addr: Option<String>,
29        commission_percentage: Option<u16>,
30        team_percentage: Option<u16>,
31        liquidity_percentage: Option<u16>,
32    },
33    /// Update the limits in process unstaking requests, only the admin can call this.
34    SetLimitConfig {
35        maximum_processed: Option<Uint128>,
36        processed_time: Option<u64>,
37        unstaking_time: Option<u64>,
38        mint_cap: Option<Uint128>,
39    },
40    /// Update the validators whitelist, only the admin can call this.
41    SetDelegations { delegations: Vec<DelegationPercentage> },
42    /// bond available coin or unbond to process unstaking requests
43    BondUnbondValidators {},
44    /// use available coin to process unstaking requests
45    ProcessUnstakingQueue {},
46    /// bot or users call this to distribute staking rewards
47    DistributeRewards {},
48    /// bot or users call this daily to multicall the following: DistributeRewards, ProcessUnstakingQueue, BondUnbondValidators
49    BotRoutine {},
50
51    /// handle Send messages from cw20 token contract, only the liquid token contract can call this.
52    /// This is for the unstaking process.
53    Receive(Cw20ReceiveMsg),
54}
55
56#[derive(Serialize, Deserialize, JsonSchema)]
57pub struct MigrateMsg {}