mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-14 12:05:18 +00:00
dce631d3de
* Add generic accumulator * Add MultiRewardPeriodOfClaimType type to params * Add adapters wrapper * Add MultiRewardPeriodsOfClaimType to params * Add multireward period to genesis test * Rename MultiRewardPeriodOfClaimType to TypedMultiRewardPeriod * Use source adapters wrapper
138 lines
3.6 KiB
Protocol Buffer
138 lines
3.6 KiB
Protocol Buffer
syntax = "proto3";
|
|
package kava.incentive.v1beta1;
|
|
|
|
import "cosmos/base/v1beta1/coin.proto";
|
|
import "gogoproto/gogo.proto";
|
|
import "google/protobuf/timestamp.proto";
|
|
import "kava/incentive/v1beta1/claims.proto";
|
|
|
|
option go_package = "github.com/kava-labs/kava/x/incentive/types";
|
|
option (gogoproto.goproto_getters_all) = false;
|
|
|
|
// RewardPeriod stores the state of an ongoing reward
|
|
message RewardPeriod {
|
|
bool active = 1;
|
|
|
|
string collateral_type = 2;
|
|
|
|
google.protobuf.Timestamp start = 3 [
|
|
(gogoproto.nullable) = false,
|
|
(gogoproto.stdtime) = true
|
|
];
|
|
|
|
google.protobuf.Timestamp end = 4 [
|
|
(gogoproto.nullable) = false,
|
|
(gogoproto.stdtime) = true
|
|
];
|
|
|
|
cosmos.base.v1beta1.Coin rewards_per_second = 5 [(gogoproto.nullable) = false];
|
|
}
|
|
|
|
// MultiRewardPeriod supports multiple reward types
|
|
message MultiRewardPeriod {
|
|
bool active = 1;
|
|
|
|
string collateral_type = 2;
|
|
|
|
google.protobuf.Timestamp start = 3 [
|
|
(gogoproto.nullable) = false,
|
|
(gogoproto.stdtime) = true
|
|
];
|
|
|
|
google.protobuf.Timestamp end = 4 [
|
|
(gogoproto.nullable) = false,
|
|
(gogoproto.stdtime) = true
|
|
];
|
|
|
|
repeated cosmos.base.v1beta1.Coin rewards_per_second = 5 [
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// TypedMultiRewardPeriod stores mutiple reward types of a claim type
|
|
message TypedMultiRewardPeriod {
|
|
ClaimType claim_type = 1;
|
|
repeated MultiRewardPeriod reward_periods = 2 [
|
|
(gogoproto.castrepeated) = "MultiRewardPeriods",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// Multiplier amount the claim rewards get increased by, along with how long the
|
|
// claim rewards are locked
|
|
message Multiplier {
|
|
string name = 1;
|
|
|
|
int64 months_lockup = 2;
|
|
|
|
bytes factor = 3 [
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// MultipliersPerDenom is a map of denoms to a set of multipliers
|
|
message MultipliersPerDenom {
|
|
string denom = 1;
|
|
|
|
repeated Multiplier multipliers = 2 [
|
|
(gogoproto.castrepeated) = "Multipliers",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|
|
|
|
// Params
|
|
message Params {
|
|
repeated RewardPeriod usdx_minting_reward_periods = 1 [
|
|
(gogoproto.customname) = "USDXMintingRewardPeriods",
|
|
(gogoproto.castrepeated) = "RewardPeriods",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
|
|
repeated MultiRewardPeriod hard_supply_reward_periods = 2 [
|
|
(gogoproto.castrepeated) = "MultiRewardPeriods",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
|
|
repeated MultiRewardPeriod hard_borrow_reward_periods = 3 [
|
|
(gogoproto.castrepeated) = "MultiRewardPeriods",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
|
|
repeated MultiRewardPeriod delegator_reward_periods = 4 [
|
|
(gogoproto.castrepeated) = "MultiRewardPeriods",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
|
|
repeated MultiRewardPeriod swap_reward_periods = 5 [
|
|
(gogoproto.castrepeated) = "MultiRewardPeriods",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
|
|
repeated MultipliersPerDenom claim_multipliers = 6 [
|
|
(gogoproto.castrepeated) = "MultipliersPerDenoms",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
|
|
google.protobuf.Timestamp claim_end = 7 [
|
|
(gogoproto.nullable) = false,
|
|
(gogoproto.stdtime) = true
|
|
];
|
|
|
|
repeated MultiRewardPeriod savings_reward_periods = 8 [
|
|
(gogoproto.castrepeated) = "MultiRewardPeriods",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
|
|
repeated MultiRewardPeriod earn_reward_periods = 9 [
|
|
(gogoproto.castrepeated) = "MultiRewardPeriods",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
|
|
repeated TypedMultiRewardPeriod reward_periods = 10 [
|
|
(gogoproto.castrepeated) = "TypedMultiRewardPeriods",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
}
|