/** * Hyperliquid order size and price formatting for exchange submission. * * These encode Hyperliquid-specific order submission rules. Getting size/price * formatting wrong causes rejected orders. * * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/tick-and-lot-size */ /** * Derive the maximum number of price decimal places for a given asset. * * @param szDecimals - The asset's szDecimals (from market meta) * @param market - Optional market type (e.g. 'spot'). Defaults to perps rules. * @returns Maximum allowed price decimals * @public */ export declare function getMaxPriceDecimals(szDecimals: number, market?: string): number; /** * Format a size value for order submission. * * Per Hyperliquid docs (tick-and-lot-size): * - Size must be rounded to the asset's szDecimals * - Trailing zeroes must be removed for signing * * @param size - The size value to format * @param szDecimals - Number of decimal places allowed for this asset (from meta) * @returns Size as a string with correct precision, no trailing zeros * @public */ export declare function formatOrderSize(size: number, szDecimals: number): string; /** * Format a price value for order submission. * * Per Hyperliquid docs (tick-and-lot-size): * - Maximum 5 significant figures * - Max decimals = MAX_DECIMALS - szDecimals (6 for perps, 8 for spot) * - Integer prices always allowed regardless of significant figures * - Trailing zeroes must be removed for signing * * Rounding is half-up (away from zero at exact halfway) on the true decimal * value, not on the binary float — (1.005).toFixed(2) would give '1.00'. * * @param price - The price value to format * @param szDecimals - The asset's szDecimals (affects max price decimals) * @param market - Optional market type (e.g. 'spot'). Defaults to perps rules. * @returns Price as a string with correct precision, no trailing zeros * @public */ export declare function formatOrderPrice(price: number, szDecimals: number, market?: string): string; //# sourceMappingURL=orderFormatting.d.ts.map