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

Fix API editoffer bug: set fixed-price=0 on margin offers #6202

Merged
merged 1 commit into from
May 16, 2022

Conversation

ghubstan
Copy link
Contributor

This is causing erroneous PRICE_OUT_OF_TOLERANCE errors when trying to take offers having (fixed) price!=0, and isUsingMktPriceMargin=true in the payload.

The API daemon editoffer's treatment of (fixed) price and isUsingMktPriceMargin flag in the API has been inconsistent with the UI.

With this change: when isUsingMktPriceMargin=true, (fixed) price is set to 0 on the server. API clients, however, still receive and must show the calculated price when isUsingMktPriceMargin=true, making this fix hard to test in the client. The server will now throw an exception if (fixed) price and isUsingMktPriceMargin flag in the API are not properly set in the API server.

This fix is intended to prevent issues such as #6170 from happening for this reason. The offer maker edited offers with API, creating inconsistent state described above. It is hoped the user's offers can be fixed by editing them in the UI.

Based on master.

This is causing erroneous PRICE_OUT_OF_TOLERANCE errors when trying
to take offers having (fixed) price!=0, and isUsingMktPriceMargin=true
in the payload.

The API daemon editoffer's treatment of (fixed) price and
isUsingMktPriceMargin flag in the API has been inconsistent with the UI.

With this change:  when isUsingMktPriceMargin=true, (fixed) price is
set to 0 on the server.  API clients, however, still must show the
calculated price when isUsingMktPriceMargin=true, making this fix hard
to test in the client.  The server will now throw an exception if
(fixed) price and isUsingMktPriceMargin flag in the API are not
properly set in the API server.

This fix is intended to prevent issues such as
bisq-network#6170 from happening for
this reason.  The offer maker edited offers with API, creating
inconsistent state described above.  It is hoped the user's offers
can be fixed by editing them in the UI.

Based on `master`.
@ghubstan
Copy link
Contributor Author

This PR remains a draft pending further testing.

@ghubstan ghubstan changed the title [WIP] Fix API editoffer bug: set fixed-price=0 on margin offers Fix API editoffer bug: set fixed-price=0 on margin offers May 15, 2022
@ghubstan ghubstan marked this pull request as ready for review May 15, 2022 19:00
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.

utACK

@ripcurlx ripcurlx added this to the v1.9.2 milestone May 16, 2022
@ripcurlx ripcurlx merged commit 0925370 into bisq-network:master May 16, 2022
@ghubstan ghubstan deleted the fix-editoffer-price-bug branch May 16, 2022 19:30
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