-
Notifications
You must be signed in to change notification settings - Fork 36
/
orders.proto
78 lines (69 loc) · 4.08 KB
/
orders.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
syntax = "proto3";
package provenance.exchange.v1;
option go_package = "github.com/provenance-io/provenance/x/exchange";
option java_package = "io.provenance.exchange.v1";
option java_multiple_files = true;
import "cosmos/base/v1beta1/coin.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
// Order associates an order id with one of the order types.
message Order {
option (gogoproto.goproto_getters) = false;
// order_id is the numerical identifier for this order.
uint64 order_id = 1;
// order is the specifics of this order.
oneof order {
// ask_order is the information about this order if it represents an ask order.
AskOrder ask_order = 2;
// bid_order is the information about this order if it represents a bid order.
BidOrder bid_order = 3;
}
}
// AskOrder represents someone's desire to sell something at a minimum price.
message AskOrder {
option (gogoproto.goproto_getters) = false;
// market_id identifies the market that this order belongs to.
uint32 market_id = 1;
// seller is the address of the account that owns this order and has the assets to sell.
string seller = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// assets are the things that the seller wishes to sell.
// A hold is placed on this until the order is filled or cancelled.
cosmos.base.v1beta1.Coin assets = 3 [(gogoproto.nullable) = false];
// price is the minimum amount that the seller is willing to accept for the assets. The seller's settlement
// proportional fee (and possibly the settlement flat fee) is taken out of the amount the seller receives,
// so it's possible that the seller will still receive less than this price.
cosmos.base.v1beta1.Coin price = 4 [(gogoproto.nullable) = false];
// seller_settlement_flat_fee is the flat fee for sellers that will be charged during settlement. If this denom is the
// same denom as the price, it will come out of the actual price received. If this denom is different, the amount must
// be in the seller's account and a hold is placed on it until the order is filled or cancelled.
cosmos.base.v1beta1.Coin seller_settlement_flat_fee = 5;
// allow_partial should be true if partial fulfillment of this order should be allowed, and should be false if the
// order must be either filled in full or not filled at all.
bool allow_partial = 6;
// external_id is an optional string used to externally identify this order. Max length is 100 characters.
// If an order in this market with this external id already exists, this order will be rejected.
string external_id = 7;
}
// BidOrder represents someone's desire to buy something at a specific price.
message BidOrder {
option (gogoproto.goproto_getters) = false;
// market_id identifies the market that this order belongs to.
uint32 market_id = 1;
// buyer is the address of the account that owns this order and has the price to spend.
string buyer = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// assets are the things that the buyer wishes to buy.
cosmos.base.v1beta1.Coin assets = 3 [(gogoproto.nullable) = false];
// price is the amount that the buyer will pay for the assets.
// A hold is placed on this until the order is filled or cancelled.
cosmos.base.v1beta1.Coin price = 4 [(gogoproto.nullable) = false];
// buyer_settlement_fees are the fees (both flat and proportional) that the buyer will pay (in addition to the price)
// when the order is settled. A hold is placed on this until the order is filled or cancelled.
repeated cosmos.base.v1beta1.Coin buyer_settlement_fees = 5
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
// allow_partial should be true if partial fulfillment of this order should be allowed, and should be false if the
// order must be either filled in full or not filled at all.
bool allow_partial = 6;
// external_id is an optional string used to externally identify this order. Max length is 100 characters.
// If an order in this market with this external id already exists, this order will be rejected.
string external_id = 7;
}