#[repr(C)]pub struct SymbolMeta {
pub tick_size_1e9: u64,
pub lot_size_1e8: u64,
pub min_qty_1e8: u64,
pub min_notional_1e9: u64,
pub price_precision: u8,
pub qty_precision: u8,
pub _pad: [u8; 6],
}Expand description
Symbol trading specifications from the exchange. Injected by runtime — prevents rejects from wrong lot size / tick size. Fields set to 0 mean “unknown” — helpers return input unchanged.
Fields§
§tick_size_1e9: u64Minimum price increment (1e9 scaled, e.g. 10_000_000 = $0.01). 0 = unknown.
lot_size_1e8: u64Minimum qty increment (1e8 scaled, e.g. 1_000_000 = 0.01 units). 0 = unknown.
min_qty_1e8: u64Minimum order quantity (1e8 scaled). 0 = unknown.
min_notional_1e9: u64Minimum order notional value (1e9 scaled, e.g. 10_000_000_000 = $10). 0 = no minimum.
price_precision: u8Price decimal precision (e.g. 2 = $100.00).
qty_precision: u8Quantity decimal precision (e.g. 8 = 0.00000001).
_pad: [u8; 6]Implementations§
Source§impl SymbolMeta
impl SymbolMeta
pub const EMPTY: Self
Sourcepub fn round_px(&self, px_1e9: u64) -> u64
pub fn round_px(&self, px_1e9: u64) -> u64
Round price DOWN to nearest tick. Returns raw if tick_size == 0 (unknown).
Sourcepub fn round_qty(&self, qty_1e8: i64) -> i64
pub fn round_qty(&self, qty_1e8: i64) -> i64
Round qty DOWN to nearest lot. Returns raw if lot_size == 0 (unknown).
Sourcepub fn check_notional(&self, qty_1e8: i64, px_1e9: u64) -> bool
pub fn check_notional(&self, qty_1e8: i64, px_1e9: u64) -> bool
Check min notional. Returns true if unknown (0) — skip check, don’t false-reject.
Sourcepub fn check_min_qty(&self, qty_1e8: i64) -> bool
pub fn check_min_qty(&self, qty_1e8: i64) -> bool
Check min quantity. Returns true if unknown (0).
Trait Implementations§
Source§impl Clone for SymbolMeta
impl Clone for SymbolMeta
Source§fn clone(&self) -> SymbolMeta
fn clone(&self) -> SymbolMeta
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more