-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: reards auction proto * lint * update genesis * fix * add usd rewards * update params * add events * update genesis * update * Apply suggestions from code review Co-authored-by: Sai Kumar <[email protected]> --------- Co-authored-by: Sai Kumar <[email protected]>
- Loading branch information
1 parent
6dccda9
commit 6c5b613
Showing
12 changed files
with
3,814 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
syntax = "proto3"; | ||
package umee.auction.v1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "github.com/umee-network/umee/v6/x/auction"; | ||
option (gogoproto.goproto_getters_all) = false; | ||
|
||
// RewardsParams defines parameters for the rewards auction. | ||
message RewardsParams { | ||
// bid_duration is duration of the bid phase in seconds. | ||
int64 bid_duration = 1; | ||
// Duration (in seconds) at the end of each auction, when we start collecting revenues for | ||
// the next auction. | ||
int64 revenu_collection_shift = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
syntax = "proto3"; | ||
package umee.auction.v1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
import "cosmos/base/v1beta1/coin.proto"; | ||
|
||
option go_package = "github.com/umee-network/umee/v6/x/auction"; | ||
|
||
option (gogoproto.goproto_getters_all) = false; | ||
|
||
// EventRewardsAuctionResult is emitted at the end of each auction that has at least one bidder. | ||
message EventRewardsAuctionResult { | ||
uint32 id = 1; | ||
string bidder = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; | ||
// Auctioned tokens. | ||
repeated cosmos.base.v1beta1.Coin rewards = 4 [(gogoproto.nullable) = false]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
syntax = "proto3"; | ||
package umee.auction.v1; | ||
|
||
import "google/protobuf/timestamp.proto"; | ||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "gogoproto/gogo.proto"; | ||
import "umee/auction/v1/auction.proto"; | ||
|
||
option go_package = "github.com/umee-network/umee/v6/x/auction"; | ||
|
||
option (gogoproto.goproto_getters_all) = false; | ||
// option (gogoproto.equal_all) = false; | ||
|
||
// GenesisState defines the x/auction module's genesis state. | ||
message GenesisState { | ||
RewardsParams rewards_params = 1 [(gogoproto.nullable) = false]; | ||
// Latest active (in bid phase) reward auction. | ||
uint32 reward_auction_id = 2; | ||
// Latest highest bid. | ||
string highest_bidder = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; | ||
// Tokens collected for the current auction. | ||
repeated cosmos.base.v1beta1.Coin current_rewards = 4 [(gogoproto.nullable) = false]; | ||
// Tokens collected for the next auction, while the current reward auction is still in the | ||
// bid phase. | ||
repeated cosmos.base.v1beta1.Coin next_rewards = 5 [(gogoproto.nullable) = false]; | ||
google.protobuf.Timestamp current_rewards_auction_end = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
syntax = "proto3"; | ||
package umee.auction.v1; | ||
|
||
import "google/protobuf/timestamp.proto"; | ||
import "google/api/annotations.proto"; | ||
import "gogoproto/gogo.proto"; | ||
import "umee/auction/v1/auction.proto"; | ||
import "cosmos/base/v1beta1/coin.proto"; | ||
|
||
option go_package = "github.com/umee-network/umee/v6/x/auction"; | ||
|
||
// Query defines the gRPC querier service. | ||
service Query { | ||
// QueryRewardParams queries parameters for the reward auciton. | ||
rpc RewardParams(QueryRewardParams) returns (QueryRewardParamsResponse) { | ||
option (google.api.http).get = "/umee/auction/v1/rewards/params"; | ||
} | ||
// RewardAuction queries the information of the auction by ID. If ID is ommitted, returns | ||
// current reward auction params. | ||
rpc RewardAuction(QueryRewardAuction) returns (QueryRewardAuctionResponse) { | ||
option (google.api.http).get = "/umee/auction/v1/rewards"; | ||
} | ||
} | ||
|
||
// Query type for Query/RewardParams | ||
message QueryRewardParams {} | ||
|
||
// Response type for Query/RewardParams | ||
message QueryRewardParamsResponse { | ||
RewardsParams params = 1 [(gogoproto.nullable) = false]; | ||
} | ||
|
||
// Query type for QueryRewardAuction | ||
message QueryRewardAuction { | ||
// If zero or not present, the current auction is returned | ||
uint32 id = 1; | ||
} | ||
|
||
// Response type for Query/RewardAuctionResponse | ||
message QueryRewardAuctionResponse { | ||
uint32 id = 1; | ||
// highest bidder | ||
string bidder = 2; | ||
repeated cosmos.base.v1beta1.Coin rewards = 3 [(gogoproto.nullable) = false]; | ||
cosmos.base.v1beta1.Coin usd_rewards = 4 [(gogoproto.nullable) = false]; | ||
google.protobuf.Timestamp ends_at = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
syntax = "proto3"; | ||
package umee.auction.v1; | ||
|
||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
import "cosmos/msg/v1/msg.proto"; | ||
import "gogoproto/gogo.proto"; | ||
import "umee/auction/v1/auction.proto"; | ||
|
||
option go_package = "github.com/umee-network/umee/v6/x/auction"; | ||
option (gogoproto.goproto_getters_all) = false; | ||
|
||
// Msg defines the x/auction module's Msg service. | ||
service Msg { | ||
// | ||
// Rewards auction: bid umee for protocol rewards | ||
// | ||
|
||
// Allows x/gov to update rewards auction parameters. | ||
rpc GovSetRewardsParams(MsgGovSetRewardsParams) returns (MsgGovSetRewardsParamsResponse); | ||
// Places a bid for a reword auction. Must be higher than the previous bid by at least | ||
// RewardParams.RewardsParams. | ||
rpc RewardsBid(MsgRewardsBid) returns (MsgRewardsBidResponse); | ||
} | ||
|
||
// MsgGovSetRewardsParams updates rewards auction parameters. | ||
message MsgGovSetRewardsParams { | ||
option (cosmos.msg.v1.signer) = "authority"; | ||
|
||
// authority must be the address of the governance account. | ||
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; | ||
RewardsParams params = 2 [(gogoproto.nullable) = false]; | ||
} | ||
|
||
// MsgGovSetRewardsParamsResponse defines the Msg/GovSetRewardsParams response type. | ||
message MsgGovSetRewardsParamsResponse {} | ||
|
||
// MsgRewardsBid places a bid for a reword auction. | ||
message MsgRewardsBid { | ||
option (cosmos.msg.v1.signer) = "sender"; | ||
|
||
string sender = 1; | ||
// the current auction ID being bid on. Fails if the ID is not an ID of the current auction. | ||
uint32 id = 2; | ||
// amount of the bid in the base tokens | ||
cosmos.base.v1beta1.Coin bid_amount = 3 [(gogoproto.nullable) = false]; | ||
} | ||
|
||
// MsgRewardsBidResponse response type for Msg/RewardsBid | ||
message MsgRewardsBidResponse {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.