@loafmarkets/shared-types 1.0.34 → 1.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/proto/trading.proto +45 -78
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loafmarkets/shared-types",
3
- "version": "1.0.34",
3
+ "version": "1.0.37",
4
4
  "description": "Shared contracts for Loaf Markets frontend, backend, and matching engine.",
5
5
  "type": "module",
6
6
  "private": false,
@@ -8,18 +8,20 @@ message Order {
8
8
  uint32 user_id = 2;
9
9
  uint32 property_id = 3;
10
10
  uint64 price = 4;
11
- uint32 quantity = 5;
12
- uint32 quantity_remaining = 6;
13
- OrderSide side = 7;
14
- OrderType type = 8;
15
- TimeInForce time_in_force = 9;
16
- int64 deadline = 10;
17
- string signature = 11;
18
- string wallet_address = 12;
19
- string nonce = 13;
20
- int64 created_at = 14;
21
- int64 maker_fee = 15;
22
- int64 taker_fee = 16;
11
+ uint32 price_multiplier = 5; // 1, 100, 1000
12
+ uint32 quantity = 6;
13
+ uint32 quantitiy_multiplier = 7; // 1, 100, 1000
14
+ uint32 quantity_remaining = 8;
15
+ OrderSide side = 9;
16
+ OrderType type = 10;
17
+ TimeInForce time_in_force = 11;
18
+ int64 deadline = 12;
19
+ string signature = 13;
20
+ string wallet_address = 14;
21
+ string nonce = 15;
22
+ int64 created_at = 16;
23
+ int64 maker_fee = 17;
24
+ int64 taker_fee = 18;
23
25
 
24
26
  }
25
27
 
@@ -40,15 +42,6 @@ enum TimeInForce {
40
42
  GTD = 3;
41
43
  }
42
44
 
43
- // enum OrderStatus {
44
- // PENDING = 0;
45
- // PARTIALLY_FILLED = 1;
46
- // FILLED = 2;
47
- // CANCELLED = 3;
48
- // REJECTED = 4;
49
- // }
50
-
51
-
52
45
  // Trade execution
53
46
  message TradeExecution {
54
47
  uint64 trade_id = 1;
@@ -56,28 +49,30 @@ message TradeExecution {
56
49
  uint64 sell_order_id = 3;
57
50
  uint32 property_id = 4;
58
51
  string property_token_address = 5;
59
- double price = 6;
60
- double quantity = 7;
61
- double buyer_fee = 8;
62
- double seller_fee = 9;
63
- string buyer_wallet = 10;
64
- string seller_wallet = 11;
65
- OrderSide side = 12;
66
- int64 timestamp = 13;
67
- int64 deadline = 14;
68
- string buyer_nonce = 15;
69
- string seller_nonce = 16;
70
- string buyer_signature = 17;
71
- string seller_signature = 18;
72
- string cpp_signature = 19;
73
- uint64 buy_price = 20;
74
- uint32 buy_quantity = 21;
75
- uint32 buy_quantity_remaining = 22;
76
- int64 buy_deadline = 23;
77
- uint64 sell_price = 24;
78
- uint32 sell_quantity = 25;
79
- uint32 sell_quantity_remaining = 26;
80
- int64 sell_deadline = 27;
52
+ uint64 price = 6;
53
+ uint32 price_multiplier = 7; // 1, 100, 1000
54
+ uint64 quantity = 8;
55
+ uint32 quantity_multiplier = 9; // 1, 100, 1000
56
+ double buyer_fee = 10;
57
+ double seller_fee = 11;
58
+ string buyer_wallet = 12;
59
+ string seller_wallet = 13;
60
+ OrderSide side = 14;
61
+ int64 timestamp = 15;
62
+ int64 deadline = 16;
63
+ string buyer_nonce = 17;
64
+ string seller_nonce = 18;
65
+ string buyer_signature = 19;
66
+ string seller_signature = 20;
67
+ string cpp_signature = 21;
68
+ uint64 buy_price = 22;
69
+ uint32 buy_quantity = 23;
70
+ uint32 buy_quantity_remaining = 24;
71
+ int64 buy_deadline = 25;
72
+ uint64 sell_price = 26;
73
+ uint32 sell_quantity = 27;
74
+ uint32 sell_quantity_remaining = 28;
75
+ int64 sell_deadline = 29;
81
76
  }
82
77
 
83
78
  // Order book
@@ -89,8 +84,10 @@ message PriceLevel {
89
84
 
90
85
  message OrderBookSnapshot {
91
86
  uint32 property_id = 1;
92
- repeated PriceLevel bids = 2;
93
- repeated PriceLevel asks = 3;
87
+ uint32 price_multiplier = 2;
88
+ uint32 quantity_multiplier = 3;
89
+ repeated PriceLevel bids = 4;
90
+ repeated PriceLevel asks = 5;
94
91
  }
95
92
 
96
93
  // Quote book
@@ -133,6 +130,8 @@ message SubmitOrderRequest {
133
130
  string nonce = 12;
134
131
  int64 maker_fee = 13;
135
132
  int64 taker_fee = 14;
133
+ int32 price_multiplier = 15;
134
+ int32 quantity_multiplier = 16;
136
135
  }
137
136
 
138
137
  message SubmitOrderResponse {
@@ -163,36 +162,4 @@ message OrderCancelled {
163
162
  int64 timestamp = 3;
164
163
  }
165
164
 
166
- // --------------------------------------------------------------
167
- // Service 2: TradingService (for Market Maker)
168
- // --------------------------------------------------------------
169
-
170
- // service TradingService {
171
- // rpc StreamTradingData(stream MarketMakerMessage) returns (stream EngineMessage);
172
- // }
173
-
174
- // message MarketMakerMessage {
175
- // oneof message {
176
- // MarketMakerRegistration registration = 1;
177
- // Quote quote = 2;
178
- // TradeAck trade_ack = 3;
179
- // }
180
- // }
181
-
182
- // message EngineMessage {
183
- // oneof message {
184
- // Order order = 1;
185
- // TradeExecution trade_execution = 2;
186
- // }
187
- // }
188
-
189
- // message MarketMakerRegistration {
190
- // string market_maker_id = 1;
191
- // repeated string property_ids = 2;
192
- // }
193
-
194
- // message TradeAck {
195
- // string trade_id = 1;
196
- // bool acknowledged = 2;
197
- // string error_message = 3;
198
- // }
165
+ //