fix: uNtl should be int64 to avoid scientific notation#142
Open
zhouziyan wants to merge 1 commit intosonirico:masterfrom
Open
fix: uNtl should be int64 to avoid scientific notation#142zhouziyan wants to merge 1 commit intosonirico:masterfrom
zhouziyan wants to merge 1 commit intosonirico:masterfrom
Conversation
sonirico
previously requested changes
Mar 14, 2026
Owner
sonirico
left a comment
There was a problem hiding this comment.
One fix needed before merging: int64(amount * 1000000) truncates toward zero due to IEEE-754 float representation. For example, 100.2 * 1000000 = 100199999.999... → int64(...) = 100199999 instead of 100200000.
Change to:
import "math"
Ntli: int64(math.Round(amount * 1000000)),Everything else is correct — the type change, the scaling, and preserving the sign (docs confirm ntli sign controls add/remove direction; isBuy has no effect until hedge mode).
Dismissing — review was premature, pending further analysis.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
According to the API docs:
"ntli": int representing amount to add or remove with 6 decimals, e.g. 1000000 for 1 usd
Type of Change
Testing
make testand all checks pass