Skip to content

Conversation

0xBoringWozniak
Copy link
Member

This pull request introduces changes to the hyperliquid/convert.go file, focusing on improving the accuracy of order price and size rounding. The most important changes include adding new rounding functions and modifying existing functions to use these new utilities.

New Functions for Rounding:

  • Added RoundOrderSize function to round the order size to the nearest tick size.
  • Added RoundOrderPrice function to round the order price to the nearest tick size, considering significant figures and allowed decimals.

Modifications to Existing Functions:

  • Modified OrderRequestToWire function to use RoundOrderPrice and RoundOrderSize instead of FloatToWire.
  • Modified ModifyOrderRequestToWire function to use RoundOrderPrice and RoundOrderSize instead of FloatToWire.

Reference

ilya-hontarau@696a083

@0xBoringWozniak 0xBoringWozniak added the enhancement New feature or request label Feb 5, 2025
@0xBoringWozniak 0xBoringWozniak self-assigned this Feb 5, 2025
@0xBoringWozniak 0xBoringWozniak merged commit 67e033d into main Feb 5, 2025
@0xBoringWozniak 0xBoringWozniak deleted the feature-add-round-methods branch February 5, 2025 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant