pub struct HyperliquidDataConverter { /* private fields */ }Expand description
Manages precision configuration and converts Hyperliquid data to standard Nautilus formats
Implementations§
Source§impl HyperliquidDataConverter
impl HyperliquidDataConverter
Sourcepub fn normalize_order_for_symbol(
&mut self,
symbol: &str,
price: Decimal,
qty: Decimal,
) -> Result<(Decimal, Decimal), String>
pub fn normalize_order_for_symbol( &mut self, symbol: &str, price: Decimal, qty: Decimal, ) -> Result<(Decimal, Decimal), String>
Normalize an order’s price and quantity for Hyperliquid
This is a convenience method that uses the instrument configuration to apply proper normalization and validation.
Sourcepub fn configure_instrument(
&mut self,
symbol: &str,
config: HyperliquidInstrumentInfo,
)
pub fn configure_instrument( &mut self, symbol: &str, config: HyperliquidInstrumentInfo, )
Configure precision for an instrument
Sourcepub fn convert_http_snapshot(
&self,
data: &HyperliquidL2Book,
instrument_id: InstrumentId,
ts_init: UnixNanos,
) -> Result<OrderBookDeltas, ConversionError>
pub fn convert_http_snapshot( &self, data: &HyperliquidL2Book, instrument_id: InstrumentId, ts_init: UnixNanos, ) -> Result<OrderBookDeltas, ConversionError>
Convert Hyperliquid HTTP L2Book snapshot to OrderBookDeltas
Sourcepub fn convert_ws_snapshot(
&self,
data: &WsBookData,
instrument_id: InstrumentId,
ts_init: UnixNanos,
) -> Result<OrderBookDeltas, ConversionError>
pub fn convert_ws_snapshot( &self, data: &WsBookData, instrument_id: InstrumentId, ts_init: UnixNanos, ) -> Result<OrderBookDeltas, ConversionError>
Convert Hyperliquid WebSocket book data to OrderBookDeltas
Sourcepub fn convert_delta_update(
&self,
instrument_id: InstrumentId,
sequence: u64,
ts_event: UnixNanos,
ts_init: UnixNanos,
bid_updates: &[(String, String)],
ask_updates: &[(String, String)],
bid_removals: &[String],
ask_removals: &[String],
) -> Result<OrderBookDeltas, ConversionError>
pub fn convert_delta_update( &self, instrument_id: InstrumentId, sequence: u64, ts_event: UnixNanos, ts_init: UnixNanos, bid_updates: &[(String, String)], ask_updates: &[(String, String)], bid_removals: &[String], ask_removals: &[String], ) -> Result<OrderBookDeltas, ConversionError>
Convert price/size changes to OrderBookDeltas This would be used for incremental WebSocket updates if Hyperliquid provided them
Trait Implementations§
Source§impl Debug for HyperliquidDataConverter
impl Debug for HyperliquidDataConverter
Auto Trait Implementations§
impl Freeze for HyperliquidDataConverter
impl RefUnwindSafe for HyperliquidDataConverter
impl Send for HyperliquidDataConverter
impl Sync for HyperliquidDataConverter
impl Unpin for HyperliquidDataConverter
impl UnsafeUnpin for HyperliquidDataConverter
impl UnwindSafe for HyperliquidDataConverter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more