Skip to main content

Module rounding

Module rounding 

Source
Expand description

Where prices and sizes may sit on a perp or a spot pair: a price keeps at most 6 - szDecimals places on a perp and 8 - szDecimals on spot, then five significant figures unless it is whole; a size keeps szDecimals. A market order’s bound is the reference moved by the slippage. HIP-4 outcomes have their own grid (crate::markets::outcomes::px).

Structs§

Grid
One asset’s grid: its size decimals, and whether its prices take the perp or the spot ceiling.

Constants§

MAX_SLIPPAGE
The most slippage a market order is let take: half the price.
MINIMUM_ORDER_VALUE
The venue refuses an order worth less than this, in the quote.
PERP_PRICE_PLACES
Places a perp price may use before its size decimals are taken off.
SIGNIFICANT_FIGURES
A price keeps at most this many significant figures, unless it is whole.
SPOT_PRICE_PLACES
Places a spot price may use before its size decimals are taken off.