Fund

The Fund is a derivative version of Synthetix Staking Rewards, distributing protocol revenue to veSEILOR stakers.

Config

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct FundConfig {
    pub gov: Addr,
    pub ve_seilor_addr: Addr,
    pub seilor_addr: Addr,
    pub kusd_denom: String,
    pub kusd_reward_addr: Addr,
    pub kusd_reward_total_amount: Uint128,
    pub kusd_reward_total_paid_amount: Uint128,
    // Sum of (reward rate * dt * 1e18 / total supply)
    pub reward_per_token_stored: Uint128,
    // uint256 immutable exitCycle = 30 days;
    pub exit_cycle: Uint64,
    // uint256 public claimAbleTime;
    pub claim_able_time: Uint64,
    pub new_gov: Option<Addr>,
    pub token_cap: Option<Uint128>,
}

InitMsg

InstantiateMsg

#[cw_serde]
pub struct InstantiateMsg {
    pub gov: Option<Addr>,
    pub ve_seilor_addr: Addr,
    pub seilor_addr: Addr,
    pub kusd_denom: String,
    pub kusd_reward_addr: Addr,
    pub exit_cycle: Uint64,
    pub claim_able_time: Uint64,
}
{
  "gov": "sei1...",
  "ve_seilor_addr": "sei1...",
  "seilor_addr": "sei1...",
  "kusd_denom": "factor/sei1.../KUSD",
  "kusd_reward_addr": "sei2...",
  "exit_cycle": "2592000",
  "claim_able_time": "1687190400"
}

ExecuteMsg

UpdateFundConfig

#[cw_serde]
pub enum ExecuteMsg {
    UpdateFundConfig { update_config_msg: UpdateConfigMsg },
}

#[cw_serde]
pub struct UpdateConfigMsg {
    pub gov: Option<Addr>,
    pub ve_seilor_addr: Option<Addr>,
    pub seilor_addr: Option<Addr>,
    pub kusd_denom: Option<String>,
    pub kusd_reward_addr: Option<Addr>,
    pub claim_able_time: Option<Uint64>,
}
{
  "update_fund_config":
   {
      "update_config_msg": 
      {
         "gov": "sei1...",
         "ve_seilor_addr": "sei1...",
         "seilor_addr": "sei1...",
         "kusd_denom": "factor/sei1.../KUSD",
         "kusd_reward_addr": "sei2...",
         "claim_able_time": "1687190400"
      }
   }
}

RefreshReward

Update user reward.

#[cw_serde]
pub enum ExecuteMsg {
    RefreshReward { account: Addr },
}
{
  "refresh_reward": {
    "account": "sei1..."
  }
}

Stake

Stake SEILOR.

#[cw_serde]
pub enum ExecuteMsg {
    Stake { amount: Uint128 },
}
{
  "stake": {
    "amount": "1000000000000000000"
  }
}

Withdraw

#[cw_serde]
pub enum ExecuteMsg {
    Withdraw { amount: Uint128 },
}
{
  "withdraw": {
    "amount": "1000000000000000000"
  }
}

ReStake

#[cw_serde]
pub enum ExecuteMsg {
    ReStake {},
}
{
  "re_stake": {}
}

GetReward

#[cw_serde]
pub enum ExecuteMsg {
    GetReward {},
}
{
  "get_reward": {}
}

NotifyRewardAmount

#[cw_serde]
pub enum ExecuteMsg {
    NotifyRewardAmount { reward: Uint128 },
}
{
  "notify_reward_amount": {
    "reward": "1000000000000000000"
  }
}

SetVeFundMinter

#[cw_serde]
pub enum ExecuteMsg {
    SetVeFundMinter {
        minter: Addr,
        is_ve_minter: bool,
    },
}
{
  "set_ve_fund_minter": {
    "minter": "sei1...",
    "is_ve_minter": true
  }
}

VeFundMint

#[cw_serde]
pub enum ExecuteMsg {
    VeFundMint {
        user: Addr,
        amount: Uint128,
    },
}
{
  "ve_fund_mint": {
    "user": "sei1...",
    "amount": "1000000000000000000"
  }
}

QueryMsg

FundConfig

#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
    #[returns(FundConfigResponse)]
    FundConfig {},
}
{
  "fund_config": {}
}

FundConfigResponse

#[cw_serde]
pub struct FundConfigResponse {
    pub gov: Addr,
    pub ve_seilor_addr: Addr,
    pub seilor_addr: Addr,
    pub kusd_denom: String,
    pub kusd_reward_addr: Addr,
    pub kusd_reward_total_amount: Uint128,
    pub kusd_reward_total_paid_amount: Uint128,
    // Sum of (reward rate * dt * 1e18 / total supply)
    pub reward_per_token_stored: Uint128,
    // uint256 immutable exitCycle = 30 days;
    pub exit_cycle: Uint64,
    // uint256 public claimAbleTime;
    pub claim_able_time: Uint64,
}
{
  "gov": "sei1...",
  "ve_seilor_addr": "sei1...",
  "seilor_addr": "sei1...",
  "kusd_denom": "factor/sei1.../kUSD",
  "kusd_reward_addr": "sei2...",
  "kusd_reward_total_amount": "1000000000000000000",
  "kusd_reward_total_paid_amount": "1000000000000000000",
  "reward_per_token_stored": "1000000000000000000",
  "exit_cycle": "2592000",
  "claim_able_time": "1687190400"
}

GetClaimAbleSeilor

#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
    #[returns(GetClaimAbleSeilorResponse)]
    GetClaimAbleSeilor { user: Addr },
}
{
  "get_claim_able_seilor": {
    "user": "sei1..."
  }
}

GetClaimAbleSeilorResponse

#[cw_serde]
pub struct GetClaimAbleSeilorResponse {
    pub amount: Uint128,
}
{
  "amount": "1000000000000000000"
}

GetReservedSeilorForVesting

#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
    #[returns(GetReservedSeilorForVestingResponse)]
    GetReservedSeilorForVesting { user: Addr },
}
{
  "get_reserved_seilor_for_vesting": {
    "user": "sei1..."
  }
}

GetReservedSeilorForVestingResponse

#[cw_serde]
pub struct GetReservedSeilorForVestingResponse {
    pub amount: Uint128,
}
{
  "amount": "1000000000000000000"
}

Earned

#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
    #[returns(EarnedResponse)]
    Earned { account: Addr },
}
{
  "earned": {
    "account": "sei1..."
  }
}

EarnedResponse

#[cw_serde]
pub struct EarnedResponse {
    pub amount: Uint128,
}
{
  "amount": "1000000000000000000"
}

GetClaimAbleKusd

#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
    #[returns(GetClaimAbleKusdResponse)]
    GetClaimAbleKusd { account: Addr },
}
{
  "get_claim_able_kusd": {
    "account": "sei1..."
  }
}

GetClaimAbleKusdResponse

#[cw_serde]
pub struct GetClaimAbleKusdResponse {
    pub amount: Uint128,
}
{
  "amount": "1000000000000000000"
}

GetUserRewardPerTokenPaid

#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
    #[returns(UserRewardPerTokenPaidResponse)]
    GetUserRewardPerTokenPaid { account: Addr },
}
{
  "get_user_reward_per_token_paid": {
    "account": "sei1..."
  }
}

GetUserRewardPerTokenPaidResponse

#[cw_serde]
pub struct UserRewardPerTokenPaidResponse {
    pub user_reward_per_token_paid: Uint128,
}
{
  "user_reward_per_token_paid": "1000000000000000000"
}

GetUserRewards

#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
    #[returns(UserRewardsResponse)]
    GetUserRewards { account: Addr },
}
{
  "get_user_rewards": {
    "account": "sei1..."
  }
}

UserRewardsResponse

#[cw_serde]
pub struct UserRewardsResponse {
    pub user_rewards: Uint128,
}
{
  "user_rewards": "1000000000000000000"
}

GetUserTime2fullRedemption

#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
    #[returns(UserTime2fullRedemptionResponse)]
    GetUserTime2fullRedemption { account: Addr },
}
{
  "get_user_time2full_redemption": {
    "account": "sei1..."
  }
}

UserTime2fullRedemptionResponse

#[cw_serde]
pub struct UserTime2fullRedemptionResponse {
    pub user_time2full_redemption: Uint64,
}
{
  "user_time2full_redemption": "1000000000000000000"
}

GetUserUnstakeRate

#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
    #[returns(UserUnstakeRateResponse)]
    GetUserUnstakeRate { account: Addr },
}
{
  "get_user_unstake_rate": {
    "account": "sei1..."
  }
}

UserUnstakeRateResponse

#[cw_serde]
pub struct UserUnstakeRateResponse {
    pub user_unstake_rate: Uint256,
}
{
  "user_unstake_rate": "1000000000000000000"
}

GetUserLastWithdrawTime

#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
    #[returns(UserLastWithdrawTimeResponse)]
    GetUserLastWithdrawTime { account: Addr },
}
{
  "get_user_last_withdraw_time": {
    "account": "sei1..."
  }
}

UserLastWithdrawTimeResponse

#[cw_serde]
pub struct UserLastWithdrawTimeResponse {
    pub user_last_withdraw_time: Uint64,
}
{
  "user_last_withdraw_time": "1000000000000000000"
}

IsVeFundMinter

#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
    #[returns(bool)]
    IsVeFundMinter { minter: Addr },
}
{
  "is_ve_fund_minter": {
    "minter": "sei1..."
  }
}

Return true or false.

Last updated