hypercall_db/types/
orders.rs1use chrono::NaiveDateTime;
7use hypercall_types::{OrderStatus, Side, TimeInForce, WalletAddress};
8use rust_decimal::Decimal;
9use serde::{Deserialize, Serialize};
10
11#[derive(Debug, Clone, Serialize, Deserialize)]
14pub struct OrderInfoRecord {
15 pub order_id: i64,
16 pub wallet_address: WalletAddress,
17 pub symbol: String,
18 pub side: Side,
19 pub price: Decimal,
20 pub size: Decimal,
21 pub tif: TimeInForce,
22 pub client_id: Option<String>,
23 pub is_perp: bool,
24 pub underlying: Option<String>,
25 pub reduce_only: Option<bool>,
26 pub nonce: Option<i64>,
27 pub signature: Option<String>,
28 pub mmp_enabled: bool,
29 pub timestamp: i64,
31 pub status: OrderStatus,
32 pub filled_size: Decimal,
33 pub created_at: Option<NaiveDateTime>,
34 pub updated_at: NaiveDateTime,
35}
36
37#[derive(Debug, Clone)]
40pub struct PersistOrderInfo {
41 pub order_id: i64,
42 pub wallet_address: WalletAddress,
43 pub symbol: String,
44 pub side: Side,
45 pub price: Decimal,
46 pub size: Decimal,
47 pub tif: TimeInForce,
48 pub client_id: Option<String>,
49 pub is_perp: bool,
50 pub underlying: Option<String>,
51 pub reduce_only: Option<bool>,
52 pub nonce: Option<i64>,
53 pub signature: Option<String>,
54 pub mmp_enabled: bool,
55 pub timestamp: i64,
56}
57
58#[derive(Debug, Clone)]
61pub struct PersistOrderAction {
62 pub timestamp: i64,
63 pub wallet: WalletAddress,
64 pub action: String,
65 pub symbol: String,
66 pub price: Decimal,
67 pub size: Decimal,
68 pub side: Side,
69 pub tif: TimeInForce,
70 pub client_id: Option<String>,
71}
72
73#[derive(Debug, Clone)]
75pub struct FillSideEffects {
76 pub trade_id: u64,
77 pub taker_ledger_delta: Decimal,
78 pub maker_ledger_delta: Decimal,
79 pub taker_premium_delta: Decimal,
80 pub maker_premium_delta: Decimal,
81 pub underlying_notional: Option<Decimal>,
82}