LWDEV-10476 Pre-trade control: configurable max value and calculated max volume#266
Open
barsukovskii wants to merge 7 commits intomasterfrom
Open
LWDEV-10476 Pre-trade control: configurable max value and calculated max volume#266barsukovskii wants to merge 7 commits intomasterfrom
barsukovskii wants to merge 7 commits intomasterfrom
Conversation
# Conflicts: # src/main/kotlin/com/lykke/matching/engine/matching/MatchingEngine.kt # src/main/kotlin/com/lykke/matching/engine/services/AssetOrderBook.kt # src/test/kotlin/com/lykke/matching/engine/services/validator/business/LimitOrderBusinessValidatorTest.kt
olpapchenko
reviewed
Apr 24, 2019
| private int accuracy; | ||
| private Double minVolume; | ||
| private Double minInvertedVolume; | ||
| private Double maxVolume; |
Contributor
There was a problem hiding this comment.
is there option to configure max volume on back office ? if yes - we should create a ticket to remove it. Also, maybe we should perform dictionary table cleanup - remove unused max volume column?
| } | ||
|
|
||
| fun validateMaxVolume(order: Order, | ||
| assetPair: AssetPair, |
| } | ||
| } | ||
|
|
||
| fun calculateMaxVolume(assetPair: AssetPair, orderBook: AssetOrderBook): MaxOrderVolumeInfo? { |
Contributor
There was a problem hiding this comment.
why we have to pass order book and asset pair? mid price and max value enough
|
|
||
| private fun performInputValidation(orderContext: LimitOrderExecutionContext): OrderValidationResult { | ||
| private fun performInputValidation(orderContext: LimitOrderExecutionContext, | ||
| assetPair: AssetPair?): OrderValidationResult { |
Contributor
There was a problem hiding this comment.
why asset pair is moved to the parameter ?
| fun getAskPrice() = askOrderBook.peek()?.price ?: BigDecimal.ZERO | ||
| fun getBidPrice() = bidOrderBook.peek()?.price ?: BigDecimal.ZERO | ||
|
|
||
| fun getMidPrice(): BigDecimal? { |
Contributor
There was a problem hiding this comment.
add test for this method
| assetPair: AssetPair, | ||
| orderBook: AssetOrderBook) { | ||
| val maxVolumeInfo = calculateMaxVolume(assetPair, orderBook) ?: return | ||
| if (order.getAbsVolume() > maxVolumeInfo.maxVolume) { |
Contributor
|
Not sure on limit orders - what if
|
# Conflicts: # src/main/kotlin/com/lykke/matching/engine/order/process/StopLimitOrderProcessor.kt # src/main/kotlin/com/lykke/matching/engine/services/validators/business/StopOrderBusinessValidator.kt # src/main/kotlin/com/lykke/matching/engine/services/validators/business/impl/LimitOrderBusinessValidatorImpl.kt # src/main/kotlin/com/lykke/matching/engine/services/validators/business/impl/StopOrderBusinessValidatorImpl.kt # src/main/kotlin/com/lykke/matching/engine/services/validators/common/OrderValidationUtils.kt
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.
No description provided.