Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update trigger price validation #6109

Merged
merged 2 commits into from Mar 21, 2022
Merged

Update trigger price validation #6109

merged 2 commits into from Mar 21, 2022

Conversation

ghost
Copy link

@ghost ghost commented Mar 17, 2022

Fixes #5979

@alkum
Copy link
Contributor

alkum commented Mar 17, 2022

ACK.

Tested with a -5% market deviation and cutoff price of 41 000 USD.

Before this PR:
Screenshot from 2022-03-17 20-15-16

After PR:
Screenshot from 2022-03-17 20-32-43

@@ -72,7 +72,8 @@ public static MonetaryValidator getPriceValidator(boolean isFiatCurrency) {
}

public static InputValidator.ValidationResult isTriggerPriceValid(String triggerPriceAsString,
Price price,
Copy link
Contributor

@ripcurlx ripcurlx Mar 21, 2022

Choose a reason for hiding this comment

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

I'd rather use the MarketPrice object exposing the currencyCode property instead of adding another parameter. WDYT?

Copy link
Author

Choose a reason for hiding this comment

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

Good idea - fixed

@ripcurlx
Copy link
Contributor

@xyzmaker123 Did you also check the trigger price actual execution code? I'd surprised, if only changing the UI validation will do the work as expected.

@ghost
Copy link
Author

ghost commented Mar 21, 2022

Did you also check the trigger price actual execution code? I'd surprised, if only changing the UI validation will do the work as expected.

@ripcurlx I roughly reviewed it. I think changing validation criteria is enough - we basically add more flexibility to user to set trigger price possible values, but execution logic doesn't change.

@ripcurlx
Copy link
Contributor

True - just looked at the code myself. There doesn't seem to be any special handling that matches the one of the validation before.

Copy link
Contributor

@ripcurlx ripcurlx left a comment

Choose a reason for hiding this comment

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

ACK - tested UI validation on Regtest. Behavior for positiv difference to market does not change only for negative difference (against your advantage).

@ripcurlx ripcurlx added this to the v1.8.5 milestone Mar 21, 2022
@ripcurlx ripcurlx merged commit a384071 into bisq-network:master Mar 21, 2022
@ghost ghost mentioned this pull request Mar 25, 2022
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.

Negative "Below % from market price" + "Deactivate offer if" doesn't work in some situation
2 participants