Skip to content

Conversation

narumiruna
Copy link
Contributor

No description provided.

@@ -255,9 +256,9 @@ func (s *Strategy) generateOrder(ctx context.Context) (*types.SubmitOrder, error
}

if side == types.SideTypeBuy {
quantity = fixedpoint.Min(quantity, balances[s.QuoteCurrency].Available.Div(ticker.Sell))
quantity = fixedpoint.Min(quantity, balances[s.QuoteCurrency].Available.Div(ticker.Sell)).Round(market.VolumePrecision, fixedpoint.Down)
Copy link
Owner

Choose a reason for hiding this comment

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

I think you can use:

market.RoundDownQuantityByPrecision

and

market.RoundUpQuantityByPrecision

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@narumiruna narumiruna force-pushed the narumi/rebalance-round-down-qty branch from edfeaab to 0eb3856 Compare July 9, 2024 04:08
@narumiruna narumiruna enabled auto-merge July 9, 2024 04:21
@narumiruna narumiruna merged commit be27d32 into main Jul 9, 2024
@narumiruna narumiruna deleted the narumi/rebalance-round-down-qty branch July 9, 2024 04:21
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.

2 participants