Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: reards auction proto #2469

Merged
merged 10 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions proto/umee/auction/v1/auction.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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 {
// auction_duration is duration in seconds.
int64 auction_duration = 1;
// min_bid_increment (nominal) in the base denom for each consequitive bid.
int64 min_bid_increment = 2;
}
21 changes: 21 additions & 0 deletions proto/umee/auction/v1/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
syntax = "proto3";
package umee.auction.v1;

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 reward
uint32 reward_id = 2;
// latest highest bid
string highest_bidder = 3;
repeated cosmos.base.v1beta1.Coin reward_tokens = 4 [(gogoproto.nullable) = false];
}
45 changes: 45 additions & 0 deletions proto/umee/auction/v1/query.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
syntax = "proto3";
package umee.auction.v1;

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/{id}";
}
}

// 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];
}
50 changes: 50 additions & 0 deletions proto/umee/auction/v1/tx.proto
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;
// amount of the bid in the base tokens
cosmos.base.v1beta1.Coin bid_amount = 2 [(gogoproto.nullable) = false];
// the current auction ID being bid on. Fails if the ID is not an ID of the current auction.
uint32 id = 3;
}

// MsgRewardsBidResponse response type for Msg/RewardsBid
message MsgRewardsBidResponse {}
2 changes: 1 addition & 1 deletion proto/umee/ugov/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ message MsgGovUpdateInflationParams {
}

// GovUpdateInflationParamsResponse response type.
message GovUpdateInflationParamsResponse {}
message GovUpdateInflationParamsResponse {}
Loading
Loading