2022-01-08 00:39:27 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
package kava.auction.v1beta1;
|
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
import "cosmos/base/v1beta1/coin.proto";
|
2022-01-08 00:39:27 +00:00
|
|
|
import "cosmos_proto/cosmos.proto";
|
2022-11-22 23:22:07 +00:00
|
|
|
import "gogoproto/gogo.proto";
|
2022-01-08 00:39:27 +00:00
|
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
|
|
|
|
option go_package = "github.com/kava-labs/kava/x/auction/types";
|
|
|
|
option (gogoproto.goproto_getters_all) = false;
|
|
|
|
|
|
|
|
// BaseAuction defines common attributes of all auctions
|
|
|
|
message BaseAuction {
|
|
|
|
option (cosmos_proto.implements_interface) = "Auction";
|
|
|
|
|
|
|
|
uint64 id = 1 [(gogoproto.customname) = "ID"];
|
|
|
|
|
|
|
|
string initiator = 2;
|
|
|
|
|
|
|
|
cosmos.base.v1beta1.Coin lot = 3 [(gogoproto.nullable) = false];
|
|
|
|
|
|
|
|
bytes bidder = 4 [
|
|
|
|
(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 bid = 5 [(gogoproto.nullable) = false];
|
|
|
|
|
|
|
|
bool has_received_bids = 6;
|
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
google.protobuf.Timestamp end_time = 7 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.stdtime) = true
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
google.protobuf.Timestamp max_end_time = 8 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.stdtime) = true
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SurplusAuction is a forward auction that burns what it receives from bids.
|
|
|
|
// It is normally used to sell off excess pegged asset acquired by the CDP system.
|
|
|
|
message SurplusAuction {
|
|
|
|
option (cosmos_proto.implements_interface) = "Auction";
|
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
BaseAuction base_auction = 1 [
|
|
|
|
(gogoproto.embed) = true,
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// DebtAuction is a reverse auction that mints what it pays out.
|
|
|
|
// It is normally used to acquire pegged asset to cover the CDP system's debts that were not covered by selling
|
|
|
|
// collateral.
|
|
|
|
message DebtAuction {
|
|
|
|
option (cosmos_proto.implements_interface) = "Auction";
|
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
BaseAuction base_auction = 1 [
|
|
|
|
(gogoproto.embed) = true,
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
|
|
|
|
cosmos.base.v1beta1.Coin corresponding_debt = 2 [(gogoproto.nullable) = false];
|
|
|
|
}
|
|
|
|
|
|
|
|
// CollateralAuction is a two phase auction.
|
|
|
|
// Initially, in forward auction phase, bids can be placed up to a max bid.
|
|
|
|
// Then it switches to a reverse auction phase, where the initial amount up for auction is bid down.
|
|
|
|
// Unsold Lot is sent to LotReturns, being divided among the addresses by weight.
|
|
|
|
// Collateral auctions are normally used to sell off collateral seized from CDPs.
|
|
|
|
message CollateralAuction {
|
|
|
|
option (cosmos_proto.implements_interface) = "Auction";
|
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
BaseAuction base_auction = 1 [
|
|
|
|
(gogoproto.embed) = true,
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
|
|
|
|
cosmos.base.v1beta1.Coin corresponding_debt = 2 [(gogoproto.nullable) = false];
|
|
|
|
|
|
|
|
cosmos.base.v1beta1.Coin max_bid = 3 [(gogoproto.nullable) = false];
|
|
|
|
|
|
|
|
WeightedAddresses lot_returns = 4 [(gogoproto.nullable) = false];
|
|
|
|
}
|
|
|
|
|
|
|
|
// WeightedAddresses is a type for storing some addresses and associated weights.
|
|
|
|
message WeightedAddresses {
|
|
|
|
repeated bytes addresses = 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 bytes weights = 2 [
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|