Expand description
Cross-cutting parsing helpers shared between HTTP and WebSocket layers.
Lighter’s wire payloads encode prices and order sizes as integer multiples
of a per-market tick. The number of decimal places (price_decimals and
size_decimals) is published once per market in the orderBookDetails
REST response. The helpers here turn those mantissa/precision pairs into
Nautilus [Price] and [Quantity] without a floating-point round-trip.
Constants§
- MAX_
DECIMALS - Maximum decimal places that fit into Nautilus [
Price] / [Quantity].
Functions§
- parse_
micros_ to_ nanos - Converts a Unix microsecond timestamp into [
UnixNanos]. - parse_
millis_ to_ nanos - Converts a Unix millisecond timestamp into [
UnixNanos]. - parse_
optional_ millis_ to_ nanos - Converts a signed Unix millisecond timestamp into [
UnixNanos]. - parse_
price - Converts a decimal string into a Nautilus [
Price] at the requested precision. - parse_
price_ from_ ticks - Converts a Lighter price tick count into a Nautilus [
Price]. - parse_
quantity - Converts a decimal string into a non-negative Nautilus [
Quantity]. - parse_
quantity_ from_ ticks - Converts a Lighter base-amount tick count into a Nautilus [
Quantity]. - parse_
secs_ to_ nanos - Converts a Unix second timestamp into [
UnixNanos]. - price_
from_ decimal - Converts a [
Decimal] into a Nautilus [Price] at the requested precision. - quantity_
from_ decimal - Converts a [
Decimal] into a non-negative Nautilus [Quantity] at the requested precision.