Skip to content

Conversation

dboyliao
Copy link
Collaborator

No description provided.

@dboyliao dboyliao marked this pull request as ready for review April 11, 2025 02:54
@dboyliao dboyliao requested review from bailantaotao and c9s April 11, 2025 02:54
@dboyliao dboyliao force-pushed the dboy/fix-bitget-trade-amount branch from 8a43c8e to b9139c3 Compare April 11, 2025 02:56
minQuantity = v
} else {
log.Warnf("fail to convert min trade amount %s for %s, setting it to 0: %v", s.MinTradeAmount, s.Symbol, err)
minQuantity = fixedpoint.NewFromFloat(0.0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use the min fixedpoint like "1e-8"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering trading, I think 0 is a safer value to use as min amount.

if v, err := fixedpoint.NewFromString(s.MaxTradeAmount); err == nil {
maxQuantity = v
} else {
log.Warnf("fail to convert max trade amount %s for %s, setting it to unlimited (Inf): %v", s.MaxTradeAmount, s.Symbol, err)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you hint the input s.MaxTradeAmount can overflow in the log message.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I include the err in the log message.
It should be clear enough it's overflow or anything else that cause the parsing failure.

@dboyliao dboyliao requested a review from gx578007 April 11, 2025 03:28
@dboyliao dboyliao enabled auto-merge April 11, 2025 03:40
@dboyliao dboyliao merged commit 2a09dc2 into main Apr 11, 2025
3 checks passed
@dboyliao dboyliao deleted the dboy/fix-bitget-trade-amount branch April 11, 2025 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants