2022-03-31 10:00:02 +00:00
|
|
|
syntax = "proto3";
|
2024-03-06 06:31:09 +00:00
|
|
|
|
|
|
|
package cerc.auction.v1;
|
|
|
|
|
2022-03-31 10:00:02 +00:00
|
|
|
import "gogoproto/gogo.proto";
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
import "cosmos/base/v1beta1/coin.proto";
|
|
|
|
|
2024-04-01 14:23:34 +00:00
|
|
|
option go_package = "git.vdb.to/cerc-io/laconicd/x/auction";
|
2022-03-31 10:00:02 +00:00
|
|
|
|
|
|
|
// Params defines the auction module parameters
|
2024-09-25 13:21:04 +00:00
|
|
|
message Params {}
|
2022-03-31 10:00:02 +00:00
|
|
|
|
|
|
|
// Auction represents a sealed-bid on-chain auction
|
|
|
|
message Auction {
|
|
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
|
2024-03-12 05:37:24 +00:00
|
|
|
string id = 1;
|
2024-09-25 13:21:04 +00:00
|
|
|
|
|
|
|
// Auction kind (vickrey | provider)
|
|
|
|
string kind = 2 [ (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" ];
|
|
|
|
|
|
|
|
string status = 3;
|
2024-03-06 06:31:09 +00:00
|
|
|
|
2022-03-31 10:00:02 +00:00
|
|
|
// Address of the creator of the auction
|
2024-09-25 13:21:04 +00:00
|
|
|
string owner_address = 4;
|
2024-03-06 06:31:09 +00:00
|
|
|
|
2022-03-31 10:00:02 +00:00
|
|
|
// Timestamp at which the auction was created
|
2024-09-25 13:21:04 +00:00
|
|
|
google.protobuf.Timestamp create_time = 5 [
|
2024-03-12 05:37:24 +00:00
|
|
|
(gogoproto.stdtime) = true,
|
2022-03-31 10:00:02 +00:00
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"create_time\" yaml:\"create_time\""
|
|
|
|
];
|
2024-03-06 06:31:09 +00:00
|
|
|
|
2022-03-31 10:00:02 +00:00
|
|
|
// Timestamp at which the commits phase concluded
|
2024-09-25 13:21:04 +00:00
|
|
|
google.protobuf.Timestamp commits_end_time = 6 [
|
2024-03-12 05:37:24 +00:00
|
|
|
(gogoproto.stdtime) = true,
|
2022-03-31 10:00:02 +00:00
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"commits_end_time\" yaml:\"commits_end_time\""
|
|
|
|
];
|
2024-03-06 06:31:09 +00:00
|
|
|
|
2022-03-31 10:00:02 +00:00
|
|
|
// Timestamp at which the reveals phase concluded
|
2024-09-25 13:21:04 +00:00
|
|
|
google.protobuf.Timestamp reveals_end_time = 7 [
|
2024-03-12 05:37:24 +00:00
|
|
|
(gogoproto.stdtime) = true,
|
2022-03-31 10:00:02 +00:00
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"reveals_end_time\" yaml:\"reveals_end_time\""
|
|
|
|
];
|
2024-03-06 06:31:09 +00:00
|
|
|
|
2022-03-31 10:00:02 +00:00
|
|
|
// Commit and reveal fees must both be paid when committing a bid
|
|
|
|
// Reveal fee is returned only if the bid is revealed
|
2024-09-25 13:21:04 +00:00
|
|
|
cosmos.base.v1beta1.Coin commit_fee = 8 [
|
2022-03-31 10:00:02 +00:00
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\""
|
|
|
|
];
|
2024-09-25 13:21:04 +00:00
|
|
|
cosmos.base.v1beta1.Coin reveal_fee = 9 [
|
2022-03-31 10:00:02 +00:00
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\""
|
|
|
|
];
|
2024-03-06 06:31:09 +00:00
|
|
|
|
2022-03-31 10:00:02 +00:00
|
|
|
// Minimum acceptable bid amount for a valid commit
|
2024-09-25 13:21:04 +00:00
|
|
|
// Only applicable in vickrey auctions
|
|
|
|
cosmos.base.v1beta1.Coin minimum_bid = 10 [
|
2022-03-31 10:00:02 +00:00
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\""
|
|
|
|
];
|
2024-03-06 06:31:09 +00:00
|
|
|
|
2024-09-25 13:21:04 +00:00
|
|
|
// Addresses of the winners
|
|
|
|
// (single winner for vickrey auction)
|
|
|
|
// (multiple winners for provider auctions)
|
|
|
|
repeated string winner_addresses = 11;
|
2024-03-06 06:31:09 +00:00
|
|
|
|
2024-09-25 13:21:04 +00:00
|
|
|
// Winning bids, i.e. the best bids
|
|
|
|
repeated cosmos.base.v1beta1.Coin winning_bids = 12 [
|
2022-03-31 10:00:02 +00:00
|
|
|
(gogoproto.nullable) = false,
|
2024-09-25 13:21:04 +00:00
|
|
|
(gogoproto.moretags) = "json:\"winning_bids\" yaml:\"winning_bids\""
|
2022-03-31 10:00:02 +00:00
|
|
|
];
|
2024-03-06 06:31:09 +00:00
|
|
|
|
2024-09-25 13:21:04 +00:00
|
|
|
// Auction winning price
|
|
|
|
// vickrey auction: second highest bid, paid by the winner
|
|
|
|
// provider auction: higest bid amongst winning_bids, paid by auction creator
|
|
|
|
// to each winner
|
|
|
|
cosmos.base.v1beta1.Coin winning_price = 13 [
|
2022-03-31 10:00:02 +00:00
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"winning_price\" yaml:\"winning_price\""
|
|
|
|
];
|
2024-09-25 13:21:04 +00:00
|
|
|
|
|
|
|
// Maximum acceptable bid amount for a valid commit
|
|
|
|
// Only applicable in provider auctions
|
|
|
|
cosmos.base.v1beta1.Coin max_price = 14 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"max_price\" yaml:\"max_price\""
|
|
|
|
];
|
|
|
|
|
|
|
|
// Number of desired providers (num of auction winners)
|
|
|
|
// Only applicable in provider auctions
|
|
|
|
int32 num_providers = 15;
|
|
|
|
|
|
|
|
bool funds_released = 16 [
|
|
|
|
(gogoproto.moretags) =
|
|
|
|
"json:\"funds_released\" yaml:\"funds_released\"" ];
|
2022-03-31 10:00:02 +00:00
|
|
|
}
|
|
|
|
|
2024-03-12 05:37:24 +00:00
|
|
|
// Auctions represent all the auctions in the module
|
2022-03-31 10:00:02 +00:00
|
|
|
message Auctions {
|
|
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
|
2024-03-12 05:37:24 +00:00
|
|
|
repeated Auction auctions = 1 [ (gogoproto.nullable) = false ];
|
2022-03-31 10:00:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Bid represents a sealed bid (commit) made during the auction
|
|
|
|
message Bid {
|
|
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
|
2024-03-12 05:37:24 +00:00
|
|
|
string auction_id = 1;
|
|
|
|
string bidder_address = 2;
|
|
|
|
string status = 3;
|
|
|
|
string commit_hash = 4;
|
2024-03-06 06:31:09 +00:00
|
|
|
|
2024-03-12 05:37:24 +00:00
|
|
|
google.protobuf.Timestamp commit_time = 5 [
|
|
|
|
(gogoproto.stdtime) = true,
|
2022-03-31 10:00:02 +00:00
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"commit_time\" yaml:\"commit_time\""
|
|
|
|
];
|
2024-03-06 06:31:09 +00:00
|
|
|
|
2022-03-31 10:00:02 +00:00
|
|
|
cosmos.base.v1beta1.Coin commit_fee = 6 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\""
|
|
|
|
];
|
2024-03-06 06:31:09 +00:00
|
|
|
|
2022-03-31 10:00:02 +00:00
|
|
|
google.protobuf.Timestamp reveal_time = 7 [
|
2024-03-12 05:37:24 +00:00
|
|
|
(gogoproto.stdtime) = true,
|
2022-03-31 10:00:02 +00:00
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"reveal_time\" yaml:\"reveal_time\""
|
|
|
|
];
|
2024-03-06 06:31:09 +00:00
|
|
|
|
2022-03-31 10:00:02 +00:00
|
|
|
cosmos.base.v1beta1.Coin reveal_fee = 8 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\""
|
|
|
|
];
|
2024-03-06 06:31:09 +00:00
|
|
|
|
2022-03-31 10:00:02 +00:00
|
|
|
cosmos.base.v1beta1.Coin bid_amount = 9 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"bid_amount\" yaml:\"bid_amount\""
|
2024-03-06 06:31:09 +00:00
|
|
|
];
|
2022-03-31 10:00:02 +00:00
|
|
|
}
|