2022-01-08 00:39:27 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
package kava.incentive.v1beta1;
|
|
|
|
|
|
|
|
import "cosmos/base/v1beta1/coin.proto";
|
2022-11-22 23:22:07 +00:00
|
|
|
import "cosmos_proto/cosmos.proto";
|
|
|
|
import "gogoproto/gogo.proto";
|
2022-01-08 00:39:27 +00:00
|
|
|
|
|
|
|
option go_package = "github.com/kava-labs/kava/x/incentive/types";
|
|
|
|
option (gogoproto.goproto_getters_all) = false;
|
|
|
|
|
|
|
|
// -------------- Base Claim Types, Reward Indexes --------------
|
|
|
|
|
|
|
|
// BaseClaim is a claim with a single reward coin types
|
|
|
|
message BaseClaim {
|
|
|
|
bytes owner = 1 [
|
|
|
|
(cosmos_proto.scalar) = "cosmos.AddressBytes",
|
2022-11-22 23:22:07 +00:00
|
|
|
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"
|
2022-01-08 00:39:27 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
cosmos.base.v1beta1.Coin reward = 2 [(gogoproto.nullable) = false];
|
|
|
|
}
|
|
|
|
|
|
|
|
// BaseMultiClaim is a claim with multiple reward coin types
|
|
|
|
message BaseMultiClaim {
|
|
|
|
bytes owner = 1 [
|
|
|
|
(cosmos_proto.scalar) = "cosmos.AddressBytes",
|
2022-11-22 23:22:07 +00:00
|
|
|
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"
|
2022-01-08 00:39:27 +00:00
|
|
|
];
|
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
repeated cosmos.base.v1beta1.Coin reward = 2 [
|
|
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// RewardIndex stores reward accumulation information
|
|
|
|
message RewardIndex {
|
|
|
|
string collateral_type = 1;
|
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
bytes reward_factor = 2 [
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// RewardIndexesProto defines a Protobuf wrapper around a RewardIndexes slice
|
|
|
|
message RewardIndexesProto {
|
2022-11-22 23:22:07 +00:00
|
|
|
repeated RewardIndex reward_indexes = 1 [
|
|
|
|
(gogoproto.castrepeated) = "RewardIndexes",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
2022-11-05 00:08:51 +00:00
|
|
|
// TypedRewardIndexes defines a RewardIndexes slice with its corresponding
|
|
|
|
// claim and collateral type
|
|
|
|
message TypedRewardIndexes {
|
2022-11-22 23:22:07 +00:00
|
|
|
ClaimType claim_type = 1;
|
|
|
|
string collateral_type = 2;
|
|
|
|
repeated RewardIndex reward_indexes = 3 [
|
|
|
|
(gogoproto.castrepeated) = "RewardIndexes",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-11-05 00:08:51 +00:00
|
|
|
}
|
|
|
|
|
2022-01-08 00:39:27 +00:00
|
|
|
// MultiRewardIndex stores reward accumulation information on multiple reward types
|
|
|
|
message MultiRewardIndex {
|
|
|
|
string collateral_type = 1;
|
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
repeated RewardIndex reward_indexes = 2 [
|
|
|
|
(gogoproto.castrepeated) = "RewardIndexes",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// MultiRewardIndexesProto defines a Protobuf wrapper around a MultiRewardIndexes slice
|
|
|
|
message MultiRewardIndexesProto {
|
2022-11-22 23:22:07 +00:00
|
|
|
repeated MultiRewardIndex multi_reward_indexes = 1 [
|
|
|
|
(gogoproto.castrepeated) = "MultiRewardIndexes",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// -------------- Custom Claim Types --------------
|
|
|
|
|
|
|
|
// USDXMintingClaim is for USDX minting rewards
|
|
|
|
message USDXMintingClaim {
|
2022-11-22 23:22:07 +00:00
|
|
|
BaseClaim base_claim = 1 [
|
|
|
|
(gogoproto.embed) = true,
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
repeated RewardIndex reward_indexes = 2 [
|
|
|
|
(gogoproto.castrepeated) = "RewardIndexes",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// HardLiquidityProviderClaim stores the hard liquidity provider rewards that can be claimed by owner
|
|
|
|
message HardLiquidityProviderClaim {
|
2022-11-22 23:22:07 +00:00
|
|
|
BaseMultiClaim base_claim = 1 [
|
|
|
|
(gogoproto.embed) = true,
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
repeated MultiRewardIndex supply_reward_indexes = 2 [
|
|
|
|
(gogoproto.castrepeated) = "MultiRewardIndexes",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
repeated MultiRewardIndex borrow_reward_indexes = 3 [
|
|
|
|
(gogoproto.castrepeated) = "MultiRewardIndexes",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// DelegatorClaim stores delegation rewards that can be claimed by owner
|
|
|
|
message DelegatorClaim {
|
2022-11-22 23:22:07 +00:00
|
|
|
BaseMultiClaim base_claim = 1 [
|
|
|
|
(gogoproto.embed) = true,
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
repeated MultiRewardIndex reward_indexes = 2 [
|
|
|
|
(gogoproto.castrepeated) = "MultiRewardIndexes",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SwapClaim stores the swap rewards that can be claimed by owner
|
|
|
|
message SwapClaim {
|
2022-11-22 23:22:07 +00:00
|
|
|
BaseMultiClaim base_claim = 1 [
|
|
|
|
(gogoproto.embed) = true,
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
repeated MultiRewardIndex reward_indexes = 2 [
|
|
|
|
(gogoproto.castrepeated) = "MultiRewardIndexes",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
2022-04-01 14:17:03 +00:00
|
|
|
|
|
|
|
// SavingsClaim stores the savings rewards that can be claimed by owner
|
|
|
|
message SavingsClaim {
|
2022-11-22 23:22:07 +00:00
|
|
|
BaseMultiClaim base_claim = 1 [
|
|
|
|
(gogoproto.embed) = true,
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-04-01 14:17:03 +00:00
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
repeated MultiRewardIndex reward_indexes = 2 [
|
|
|
|
(gogoproto.castrepeated) = "MultiRewardIndexes",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-04-01 14:17:03 +00:00
|
|
|
}
|
2022-09-22 18:26:08 +00:00
|
|
|
|
|
|
|
// EarnClaim stores the earn rewards that can be claimed by owner
|
|
|
|
message EarnClaim {
|
2022-11-22 23:22:07 +00:00
|
|
|
BaseMultiClaim base_claim = 1 [
|
|
|
|
(gogoproto.embed) = true,
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-09-22 18:26:08 +00:00
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
repeated MultiRewardIndex reward_indexes = 2 [
|
|
|
|
(gogoproto.castrepeated) = "MultiRewardIndexes",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-09-22 18:26:08 +00:00
|
|
|
}
|
2022-10-28 00:45:32 +00:00
|
|
|
|
|
|
|
// ClaimType is the type of claim
|
|
|
|
enum ClaimType {
|
|
|
|
option (gogoproto.goproto_enum_prefix) = false;
|
|
|
|
|
2022-11-03 18:49:53 +00:00
|
|
|
// indicates an invalid claim type
|
|
|
|
CLAIM_TYPE_UNSPECIFIED = 0;
|
|
|
|
// claim type for hard borrow rewards
|
|
|
|
CLAIM_TYPE_HARD_BORROW = 1;
|
|
|
|
// claim type for hard supply rewards
|
|
|
|
CLAIM_TYPE_HARD_SUPPLY = 2;
|
|
|
|
// claim type for delegator rewards
|
|
|
|
CLAIM_TYPE_DELEGATOR = 3;
|
|
|
|
// claim type for earn rewards
|
|
|
|
CLAIM_TYPE_EARN = 4;
|
|
|
|
// claim type for savings rewards
|
|
|
|
CLAIM_TYPE_SAVINGS = 5;
|
|
|
|
// claim type for swap rewards
|
|
|
|
CLAIM_TYPE_SWAP = 6;
|
|
|
|
// claim type for usdx minting rewards
|
2022-10-28 00:45:32 +00:00
|
|
|
CLAIM_TYPE_USDX_MINTING = 7;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Claim stores any generic rewards that can be claimed by owner
|
|
|
|
message Claim {
|
|
|
|
ClaimType type = 1;
|
|
|
|
|
|
|
|
bytes owner = 2 [
|
|
|
|
(cosmos_proto.scalar) = "cosmos.AddressBytes",
|
2022-11-22 23:22:07 +00:00
|
|
|
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"
|
2022-10-28 00:45:32 +00:00
|
|
|
];
|
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
repeated cosmos.base.v1beta1.Coin reward = 3 [
|
|
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-10-28 00:45:32 +00:00
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
repeated MultiRewardIndex reward_indexes = 4 [
|
|
|
|
(gogoproto.castrepeated) = "MultiRewardIndexes",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-10-28 00:45:32 +00:00
|
|
|
}
|