backend redesign

This commit is contained in:
2026-03-11 18:47:11 -04:00
parent 8ff277c8c6
commit e99ef5d2dd
210 changed files with 12147 additions and 155 deletions

48
protobuf/tick.proto Normal file
View File

@@ -0,0 +1,48 @@
syntax = "proto3";
message Tick {
// Unique identifier for the trade
string trade_id = 1;
// Market identifier (matches Market.market_id)
string ticker = 2;
// Timestamp in microseconds since epoch
uint64 timestamp = 3;
// Price (must be adjusted by tick_denom from Market metadata)
int64 price = 4;
// Base asset amount (must be adjusted by base_denom from Market metadata)
int64 amount = 5;
// Quote asset amount (must be adjusted by quote_denom from Market metadata)
int64 quote_amount = 6;
// Side: true = taker buy (market buy), false = taker sell (market sell)
bool taker_buy = 7;
// Position effect: true = close position, false = open position
// Only relevant for derivatives/futures markets
optional bool to_close = 8;
// Sequence number for ordering (if provided by exchange)
optional uint64 sequence = 9;
// Additional flags for special trade types
optional TradeFlags flags = 10;
}
message TradeFlags {
// Liquidation trade
bool is_liquidation = 1;
// Block trade (large OTC trade)
bool is_block_trade = 2;
// Maker side was a post-only order
bool maker_post_only = 3;
// Trade occurred during auction
bool is_auction = 4;
}