|
| 1 | +syntax = "proto3"; |
| 2 | + |
| 3 | +package pstake.liquidstake.v1beta1; |
| 4 | + |
| 5 | +import "gogoproto/gogo.proto"; |
| 6 | +import "cosmos_proto/cosmos.proto"; |
| 7 | + |
| 8 | +option go_package = "github.com/persistenceOne/persistenceCore/v16/x/liquidstake/types"; |
| 9 | + |
| 10 | +// Params defines the set of params for the liquidstake module. |
| 11 | +message Params { |
| 12 | + option (gogoproto.goproto_getters) = false; |
| 13 | + option (gogoproto.goproto_stringer) = false; |
| 14 | + |
| 15 | + // LiquidBondDenom specifies the denomination of the token receiving after |
| 16 | + // liquid stake, The value is calculated through NetAmount. |
| 17 | + string liquid_bond_denom = 1; |
| 18 | + |
| 19 | + // WhitelistedValidators specifies the validators elected to become Active |
| 20 | + // Liquid Validators. |
| 21 | + repeated WhitelistedValidator whitelisted_validators = 2 |
| 22 | + [ (gogoproto.nullable) = false ]; |
| 23 | + |
| 24 | + // UnstakeFeeRate specifies the fee rate when liquid unstake is requested, |
| 25 | + // unbonded by subtracting it from unbondingAmount |
| 26 | + string unstake_fee_rate = 3 [ |
| 27 | + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", |
| 28 | + (gogoproto.nullable) = false |
| 29 | + ]; |
| 30 | + |
| 31 | + // LsmDisabled allows to block any msgs that convert staked tokens into |
| 32 | + // stkXPRT through LSM. |
| 33 | + bool lsm_disabled = 4; |
| 34 | + |
| 35 | + // MinLiquidStakingAmount specifies the minimum number of coins to be staked |
| 36 | + // to the active liquid validators on liquid staking to minimize decimal loss |
| 37 | + // and consider gas efficiency. |
| 38 | + string min_liquid_stake_amount = 5 [ |
| 39 | + (gogoproto.customtype) = "cosmossdk.io/math.Int", |
| 40 | + (gogoproto.nullable) = false |
| 41 | + ]; |
| 42 | + |
| 43 | + // CwLockedPoolAddress defines the bech32-encoded address of |
| 44 | + // a CW smart-contract representing a time locked LP (e.g. Superfluid LP). |
| 45 | + string cw_locked_pool_address = 6 |
| 46 | + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; |
| 47 | + |
| 48 | + // FeeAccountAddress defines the bech32-encoded address of |
| 49 | + // a an account responsible for accumulating protocol fees. |
| 50 | + string fee_account_address = 7 |
| 51 | + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; |
| 52 | + |
| 53 | + // AutocompoundFeeRate specifies the fee rate for auto redelegating the stake |
| 54 | + // rewards. The fee is taken in favour of the fee account (see |
| 55 | + // FeeAccountAddress). |
| 56 | + string autocompound_fee_rate = 8 [ |
| 57 | + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", |
| 58 | + (gogoproto.nullable) = false |
| 59 | + ]; |
| 60 | + |
| 61 | + // WhitelistAdminAddress the bech32-encoded address of an admin authority |
| 62 | + // that is allowed to update whitelisted validators or pause liquidstaking |
| 63 | + // module entirely. The key is controlled by an offchain process that is |
| 64 | + // selecting validators based on a criteria. Pausing of the module can be |
| 65 | + // required during important migrations or failures. |
| 66 | + string whitelist_admin_address = 9 |
| 67 | + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; |
| 68 | + |
| 69 | + // ModulePaused is a safety toggle that allows to stop main module functions |
| 70 | + // such as stake/unstake/stake-to-lp and the BeginBlocker logic. |
| 71 | + bool module_paused = 10; |
| 72 | +} |
| 73 | + |
| 74 | +// ValidatorStatus enumerates the status of a liquid validator. |
| 75 | +enum ValidatorStatus { |
| 76 | + option (gogoproto.goproto_enum_prefix) = false; |
| 77 | + |
| 78 | + // VALIDATOR_STATUS_UNSPECIFIED defines the unspecified invalid status. |
| 79 | + VALIDATOR_STATUS_UNSPECIFIED = 0 |
| 80 | + [ (gogoproto.enumvalue_customname) = "ValidatorStatusUnspecified" ]; |
| 81 | + // VALIDATOR_STATUS_ACTIVE defines the active, valid status |
| 82 | + VALIDATOR_STATUS_ACTIVE = 1 |
| 83 | + [ (gogoproto.enumvalue_customname) = "ValidatorStatusActive" ]; |
| 84 | + // VALIDATOR_STATUS_INACTIVE defines the inactive, invalid status |
| 85 | + VALIDATOR_STATUS_INACTIVE = 2 |
| 86 | + [ (gogoproto.enumvalue_customname) = "ValidatorStatusInactive" ]; |
| 87 | +} |
| 88 | + |
| 89 | +// WhitelistedValidator consists of the validator operator address and the |
| 90 | +// target weight, which is a value for calculating the real weight to be derived |
| 91 | +// according to the active status. |
| 92 | +message WhitelistedValidator { |
| 93 | + option (gogoproto.goproto_getters) = false; |
| 94 | + |
| 95 | + // validator_address defines the bech32-encoded address that whitelisted |
| 96 | + // validator |
| 97 | + string validator_address = 1 |
| 98 | + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; |
| 99 | + |
| 100 | + // target_weight specifies the target weight for liquid staking, unstaking |
| 101 | + // amount, which is a value for calculating the real weight to be derived |
| 102 | + // according to the active status |
| 103 | + string target_weight = 2 [ |
| 104 | + (gogoproto.customtype) = "cosmossdk.io/math.Int", |
| 105 | + (gogoproto.nullable) = false |
| 106 | + ]; |
| 107 | +} |
| 108 | + |
| 109 | +// LiquidValidator defines a Validator that can be the target of LiquidStaking |
| 110 | +// and LiquidUnstaking, Active, Weight, etc. fields are derived as functions to |
| 111 | +// deal with by maintaining consistency with the state of the staking module. |
| 112 | +message LiquidValidator { |
| 113 | + option (gogoproto.equal) = false; |
| 114 | + option (gogoproto.goproto_getters) = false; |
| 115 | + |
| 116 | + // operator_address defines the address of the validator's operator; bech |
| 117 | + // encoded in JSON. |
| 118 | + string operator_address = 1 |
| 119 | + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; |
| 120 | +} |
| 121 | + |
| 122 | +// LiquidValidatorState is type LiquidValidator with state added to return to |
| 123 | +// query results. |
| 124 | +message LiquidValidatorState { |
| 125 | + option (gogoproto.equal) = false; |
| 126 | + option (gogoproto.goproto_getters) = false; |
| 127 | + |
| 128 | + // operator_address defines the address of the validator's operator; bech |
| 129 | + // encoded in JSON. |
| 130 | + string operator_address = 1 |
| 131 | + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; |
| 132 | + |
| 133 | + // weight specifies the weight for liquid staking, unstaking amount |
| 134 | + string weight = 2 [ |
| 135 | + (gogoproto.customtype) = "cosmossdk.io/math.Int", |
| 136 | + (gogoproto.nullable) = false |
| 137 | + ]; |
| 138 | + |
| 139 | + // status is the liquid validator status |
| 140 | + ValidatorStatus status = 3; |
| 141 | + |
| 142 | + // del_shares define the delegation shares of the validator |
| 143 | + string del_shares = 4 [ |
| 144 | + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", |
| 145 | + (gogoproto.nullable) = false |
| 146 | + ]; |
| 147 | + |
| 148 | + // liquid_tokens define the token amount worth of delegation shares of the |
| 149 | + // validator (slashing applied amount) |
| 150 | + string liquid_tokens = 5 [ |
| 151 | + (gogoproto.customtype) = "cosmossdk.io/math.Int", |
| 152 | + (gogoproto.nullable) = false |
| 153 | + ]; |
| 154 | +} |
| 155 | + |
| 156 | +// NetAmountState is type for net amount raw data and mint rate, This is a value |
| 157 | +// that depends on the several module state every time, so it is used only for |
| 158 | +// calculation and query and is not stored in kv. |
| 159 | +message NetAmountState { |
| 160 | + option (gogoproto.equal) = false; |
| 161 | + option (gogoproto.goproto_getters) = true; |
| 162 | + |
| 163 | + // mint_rate is stkXPRTTotalSupply / NetAmount |
| 164 | + string mint_rate = 1 [ |
| 165 | + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", |
| 166 | + (gogoproto.nullable) = false |
| 167 | + ]; |
| 168 | + |
| 169 | + // btoken_total_supply returns the total supply of stk/uxprt (stkXPRT denom) |
| 170 | + string stkxprt_total_supply = 2 [ |
| 171 | + (gogoproto.customtype) = "cosmossdk.io/math.Int", |
| 172 | + (gogoproto.nullable) = false |
| 173 | + ]; |
| 174 | + |
| 175 | + // net_amount is proxy account's native token balance + total liquid tokens + |
| 176 | + // total remaining rewards + total unbonding balance |
| 177 | + string net_amount = 3 [ |
| 178 | + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", |
| 179 | + (gogoproto.nullable) = false |
| 180 | + ]; |
| 181 | + |
| 182 | + // total_del_shares define the delegation shares of all liquid validators |
| 183 | + string total_del_shares = 4 [ |
| 184 | + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", |
| 185 | + (gogoproto.nullable) = false |
| 186 | + ]; |
| 187 | + |
| 188 | + // total_liquid_tokens define the token amount worth of delegation shares of |
| 189 | + // all liquid validator (slashing applied amount) |
| 190 | + string total_liquid_tokens = 5 [ |
| 191 | + (gogoproto.customtype) = "cosmossdk.io/math.Int", |
| 192 | + (gogoproto.nullable) = false |
| 193 | + ]; |
| 194 | + |
| 195 | + // total_remaining_rewards define the sum of remaining rewards of proxy |
| 196 | + // account by all liquid validators |
| 197 | + string total_remaining_rewards = 6 [ |
| 198 | + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", |
| 199 | + (gogoproto.nullable) = false |
| 200 | + ]; |
| 201 | + |
| 202 | + // total_unbonding_balance define the unbonding balance of proxy account by |
| 203 | + // all liquid validator (slashing applied amount) |
| 204 | + string total_unbonding_balance = 7 [ |
| 205 | + (gogoproto.customtype) = "cosmossdk.io/math.Int", |
| 206 | + (gogoproto.nullable) = false |
| 207 | + ]; |
| 208 | + |
| 209 | + // proxy_acc_balance define the balance of proxy account for the native token |
| 210 | + string proxy_acc_balance = 8 [ |
| 211 | + (gogoproto.customtype) = "cosmossdk.io/math.Int", |
| 212 | + (gogoproto.nullable) = false |
| 213 | + ]; |
| 214 | +} |
0 commit comments