When step size is available then adjust total amount (with fee included) by the step size using TradingService#roundByStep #309
No reviewers
Labels
No labels
blocked
breaking
bug
dependencies
duplicate
enhancement
good first issue
help wanted
question
tech debt
testing
wontfix
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set.
Reference
scion/arbitrader!309
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "adjust-fee-by-step-size"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, exchanges with
FeeComputationset toCLIENTdo not perform theroundByStep()adjustment which my lead toorg.knowm.xchange.exceptions.OrderNotValidException: Filter failure: LOT_SIZE (HTTP status code: 400)when performing a trade.In this pull we call
roundByStepusingCurrencyPairMetaData#getAmountStepSize().Do not merge this PR just yet. I will run this code changes for a while to see if it really fixed the
OrderNotValidException@ -470,9 +470,9 @@ public class TradingService {.multiply(exchangeService.getExchangeFee(exchange, currencyPair, true)).setScale(BTC_SCALE, RoundingMode.HALF_EVEN);This doesn't seem right to do
roundByStep()insideaddFees(). We do it once ingetVolumeForEntryPosition()and then possiblyaddFees()changes the value. I think instead we should move theroundByStep()out intoentryPosition()afteraddFees()so that we do the rounding as the last step, in one place, right before submitting the orders. Same idea for exiting the positions.@ -470,9 +470,9 @@ public class TradingService {.multiply(exchangeService.getExchangeFee(exchange, currencyPair, true)).setScale(BTC_SCALE, RoundingMode.HALF_EVEN);Yeah, good point. I will commit the changes in a moment
Ready to merge, I have ran it for a few days. No major issues.