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

ERROR PRICE_OUT_OF_TOLERANCE #6170

Closed
bitcointerra opened this issue Apr 26, 2022 · 36 comments
Closed

ERROR PRICE_OUT_OF_TOLERANCE #6170

bitcointerra opened this issue Apr 26, 2022 · 36 comments

Comments

@bitcointerra
Copy link

bitcointerra commented Apr 26, 2022

abr-26 [BisqDaemonMain] WARN b.core.offer.OpenOfferManager: Received AckMessage with error state for OfferAvailabilityResponse with offerId ORDER ID and errorMessage=An error occurred at task: ProcessOfferAvailabilityResponse
Take offer attempt rejected because of: PRICE_OUT_OF_TOLERANCE

This error occurs when accepting my offer.

Version 1.8.4

@ghost
Copy link

ghost commented Apr 26, 2022

@bitcointerra What is the currency of the offer?

@bitcointerra
Copy link
Author

Hi, XMR

@ghost
Copy link

ghost commented Apr 27, 2022

During times of high price volatility this can happen, that your peers price is more than 2% different to yours. Sometimes this issue can be caused by a pricenode that has gone stale, but all 5 of our pricenodes are displaying a consistent XMR price.

I was not able to find any XMR offers that give the PRICE_OUT_OF_TOLERANCE error at this moment.

If the problem still happening for you, restart Bisq and try again. Do you get this error from several offers? If it is with one particular offer, or user, consider posting the offerId here where it can be looked into.

@bitcointerra
Copy link
Author

This error occurs when accepting my offer. I'm using bisq_daemon

@ghost
Copy link

ghost commented Apr 27, 2022

@bitcointerra Ok, so sounds like your node is rejecting the taker's price. Is yours a fixed price or variable (market price) offer?

Please check your log and let us know what you find, looking for similar messages to these:

Takers price does not match offer price.
Price at take-offer time:
Taker's trade price is too far away from our calculated price based on the market price.

Please report the values it tells you for takers price and makers price in the log at that point, and the offer id.
Is the onion address of the taker always the same?

@bitcointerra
Copy link
Author

Hi,
Variable (market price) offer

log below

mai-05 [BisqDaemonMain] WARN b.c.o.OpenOfferManager: Received AckMessage with error state for OfferAvailabilityResponse with offerId and errorMessage=An error occurred at task: ProcessOfferAvailabilityResponse
Take offer attempt rejected because of: PRICE_OUT_OF_TOLERANCE

Is the onion address of the taker always not the same! I tested it with another bisq client.

@bitcointerra
Copy link
Author

Hi,

ID Offer ieveqhar-db1d612e-9918-4a33-9ee3-647f750fc653-184
All offers are having the same problem.

@ghost
Copy link

ghost commented May 6, 2022

I checked the offer just now and it looks ok: no error when starting to take the offer.
If you want to post a smaller offer (about 0.01 BTC) I can try taking it to check the error.

@bitcointerra
Copy link
Author

The error continues. Please test now.

@ghost
Copy link

ghost commented May 7, 2022

I did. When clicking "Take offer", it says everything is good to continue. I cannot go further due to the large amounts in the offers, see my previous comment.

@bitcointerra
Copy link
Author

Sorry. I was testing the fixed price. Now see the error. Please test now. ID offer SbPymDJP-fa5f0400-7e90-4348-8c54-495990cfbca0-184 or ieveqhar-db1d612e-9918-4a33-9ee3-647f750fc653-184

@ghost
Copy link

ghost commented May 7, 2022

Yes, now when I send OfferAvailabilityRequest your node is replying with OfferAvailabilityResponse containing status PRICE_OUT_OF_TOLERANCE. There's no other information in that message, but in the log file of your bisq_daemon it should write an explanation of which prices were being used resulting in the tolerance being too far apart. It would be good to know what prices the daemon complains about. In the meantime I can try running a bisq_daemon locally to try and reproduce the error.

@ghost
Copy link

ghost commented May 7, 2022

Please look in bisq.log of the daemon for the makersPrice= and takersPrice=.
e.g.

Price at take-offer time: id=5873138, currency=XMR, takersPrice=567161, makersPrice=567171, deviation=0.0017631366907022716%

When the prices are too far different you'll get a PRICE_OUT_OF_TOLERANCE error.
Perhaps the pricenode you're connecting to has issues, but lets see what prices it is complaining about.

@bitcointerra
Copy link
Author

bisq.log

@bitcointerra
Copy link
Author

Take offer attempt rejected because of: PRICE_OUT_OF_TOLERANCE
mai.-07 15:13:32.587 [BisqDaemonMain] INFO b.c.o.OpenOfferManager: Received OfferAvailabilityRequest from xk7q7muaqqqxahttp5r4y3e65x6ffr24ahcpk2pvpttxxyo375sbxxyd.onion:9999 with offerId SbPymDJP-fa5f0400-7e90-4348-8c54-495990cfbca0-184 and uid 60d50ce6-a410-4ccc-8050-9ed6e57a409c
mai.-07 15:13:32.835 [BisqDaemonMain] INFO b.c.offer.Offer: Price at take-offer time: id=SbPymDJP, currency=XMR, takersPrice=588933, makersPrice=605099, deviation=2.6716289400577464%
mai.-07 15:13:32.835 [BisqDaemonMain] WARN b.c.offer.Offer: Taker's trade price is too far away from our calculated price based on the market price.
takersPrice=588933
makersPrice=605099

@ghost
Copy link

ghost commented May 7, 2022

Thanks. In that example the takers price is correct. It appears the price node you connect to is ok; however even using the same pricenode and attempting to take your offer produces the out of tolerance error.

One thing looks odd about your offers - they contain both a fixed price AND a market price. This does not happen with other offers and I wonder if that is the cause of the problem. Could you describe the process you use to edit the offer details, given that you're using bisq_daemon. I'd like to be able to reproduce the same issue and perhaps the method of editing offer details has something to do with it.

@bitcointerra
Copy link
Author

Hi, thanks for support.

https://github.com/ripcurlx/bisq-api-examples/blob/main/cli/bisq_api.py
I use this library.
I didn't understand. Do we have 2 prices for the same offer? What am I doing wrong?

@ghubstan
Copy link
Member

ghubstan commented May 7, 2022

One thing looks odd about your offers - they contain both a fixed price AND a market price. ... Could you describe the process you use to edit the offer details, given that you're using bisq_daemon.

This could be some problem with the API CLI's editoffer method. I am watching this problem but it will be hard to reproduce it on my side (I have no XMR or wallet).

This might be too much detail here, but about fixed price AND a market price: There is a value for both the (fixed) price field, and the market_price_margin_pct field on the API's offer object, but the use_market_based_price flag determines the price model (fixed or margin based). See https://bisq-network.github.io/slate/#offerinfo

I am also wondering if there is something different about the way the API and Desktop use the price feed. Here's the cleartext price feed: https://price.bisq.wiz.biz/getAllMarketPrices.

@ghubstan
Copy link
Member

ghubstan commented May 7, 2022

https://github.com/ripcurlx/bisq-api-examples/blob/main/cli/bisq_api.py
I use this library.
I didn't understand. Do we have 2 prices for the same offer? What am I doing wrong?

You are probably not doing anything wrong.

But here is another possible problem source: the CLI console output parsing Python API example you are using is out of date, and there have been changes to the API that may (probably) broke the example you are using.

There is a new set of examples in bisq-network repo https://github.com/bisq-network/bisq-api-reference.
Instead of parsing CLI console output text, the new Python examples use the protobuf objects, with all the offer object fields described in the API reference, i.e., https://bisq-network.github.io/slate/#offerinfo.

You can look at your client-side offer object in your debugger. That would be very useful in sorting out this problem.
See if you can run the getoffer example shown in the API reference: https://bisq-network.github.io/slate/?python#rpc-method-getoffer.

That example script lives here: https://github.com/bisq-network/bisq-api-reference/blob/main/python-examples/bisq/rpccalls/get_offer.py

Instructions for setting up the Python examples (building the API's gRPC stubs) are in https://github.com/bisq-network/bisq-api-reference/blob/main/python-examples/run-setup.sh.

I said all that because I did not think I could look at this in my debugger tonight, but I did. (I don't expect you to have to debug code when calling support... but it's double-plus-good if you can;-)

I looked at the offer from the API CLI and get_offer.py example @ 8-May, ~00:30 UTC.

Here is what I found:
1

2

If working correctly, this offer was either (a) created as a fixed-price offer, and/or (b) changed from a mkt-price-margin based offer by an edit.

The fixed-price on the offer @ 8-May ~ 00:30 UTC was 0.00586782 BTC.
Then, @ ! 00:42 UTC is was different: 0.00586376 BTC.
A fixed-price offer's price should not be changing. This is a bug I will look into tomorrow+.

@bitcointerra
Copy link
Author

I updated the code. So far no errors. thanks @ghubstan

@bitcointerra
Copy link
Author

Now see the error. Please test now again. ID offer SbPymDJP-fa5f0400-7e90-4348-8c54-495990cfbca0-184 or ieveqhar-db1d612e-9918-4a33-9ee3-647f750fc653-184

Captura de tela de 2022-05-07 15-37-05

Code now base

@bitcointerra
Copy link
Author

bisq1.log

@bitcointerra
Copy link
Author

mai.-08 04:14:24.823 [BisqDaemonMain] WARN b.c.offer.Offer: Taker's trade price is too far away from our calculated price based on the market price.
takersPrice=593060
makersPrice=600580
mai.-08 04:14:24.823 [BisqDaemonMain] WARN b.c.o.OpenOfferManager: Trade price check failed because takers price is outside out tolerance.
mai.-08 04:14:24.823 [BisqDaemonMain] INFO b.c.o.OpenOfferManager: Send OfferAvailabilityResponse with offerId ieveqhar-db1d612e-9918-4a33-9ee3-647f750fc653-184 and uid bbfee6da-7975-488d-a79d-3ea89fa11034 to peer ljazuqz24fjhhm47sa35laa6yyyp4e65feuywytdqyedowsc4vgwheid.onion:9999

@ghubstan
Copy link
Member

ghubstan commented May 8, 2022

@bitcointerra do you have a matrix acct & client, where we could DM each other about this?

  1. Did you create offer SbPymDJP-fa5f0400-7e90-4348-8c54-495990cfbca0-184 with the API, using the https://github.com/ripcurlx/bisq-api-examples/blob/main/cli/bisq_api.py library?
  2. Did you edit this offer with the API, using the https://github.com/ripcurlx/bisq-api-examples/blob/main/cli/bisq_api.py library?

@bitcointerra
Copy link
Author

@ghubstan
I'm using the library you posted last.
bisq-api-reference
https://github.com/bisq-network/bisq-api-reference
Update my vide for this library

@ghubstan
Copy link
Member

ghubstan commented May 8, 2022

Thanks for updating to new python lib... But did you create and edit that offer with https://github.com/ripcurlx/bisq-api-examples/blob/main/cli/bisq_api.py?

@bitcointerra
Copy link
Author

@ghubstan I didn't create by this ripcurlx library. But I edited a few times.

@ghubstan
Copy link
Member

ghubstan commented May 8, 2022

FYI: Right now, SbPymDJP-fa5f0400-7e90-4348-8c54-495990cfbca0-184 is a margin price based offer, and it's price should move with XMR market price. And it is, when I call CLI's getoffer. Is that how you edited this offer the last time? Setting a margin % (not a fixed-price)?

Can we DM on matrix instead of talking about so many (of your) offer's details here? (If determined, any final conclusion about the problem source and the fix will be posted here.)

@ghubstan
Copy link
Member

ghubstan commented May 8, 2022

And do not use the ripcurlx library anymore. It was fine when released, but not now.

@bitcointerra
Copy link
Author

Ok, my id in matrix is BITCOINTERRA

@ghubstan
Copy link
Member

ghubstan commented May 9, 2022

@ 9-May, ~ 18h15 UTC, my node was able to SendOfferAvailabilityRequest: Send OfferAvailabilityRequest with offerId SbPymDJP-fa5f0400-7e90-4348-8c54-495990cfbca0-184 and uid 1c56d06b-e9b3-497a-98e6-ccc70f69deeb to peer oicmognfxgyxmd7hnircaf5i7kx5vsjaq2dmpnowolcq25r4ugqpf4qd.onion:9999
...
...
TxValidator: Maker tx validation : SUCCESS

(There was no PRICE_OUT_OF_TOLERANCE error.)

@bitcointerra
Copy link
Author

Please, Try now. PRICE_OUT_OF_TOLERANCE again

@ghubstan
Copy link
Member

ghubstan commented May 9, 2022

@ ~ 19h40 UTC, the OfferAvailabilityRequest was successful on my node:

May-09 16:38:39.801 [JavaFX Application Thread] INFO b.c.o.a.OfferAvailabilityProtocol: Send AckMessage for OfferAvailabilityResponse to peer oicmognfxgyxmd7hnircaf5i7kx5vsjaq2dmpnowolcq25r4ugqpf4qd.onion:9999 with offerId SbPymDJP-fa5f0400-7e90-4348-8c54-495990cfbca0-184 and sourceUid 4064fd10-0396-4328-87fe-37521ea9d404
May-09 16:38:39.804 [JavaFX Application Thread] INFO b.c.o.a.OfferAvailabilityProtocol: AckMessage for OfferAvailabilityResponse arrived at makersNodeAddress oicmognfxgyxmd7hnircaf5i7kx5vsjaq2dmpnowolcq25r4ugqpf4qd.onion:9999. offerId=SbPymDJP-fa5f0400-7e90-4348-8c54-495990cfbca0-184, sourceUid=4064fd10-0396-4328-87fe-37521ea9d404
May-09 16:38:40.063 [JavaFX Application Thread] INFO b.core.offer.OpenOfferManager: Received AckMessage for OfferAvailabilityRequest with offerId SbPymDJP-fa5f0400-7e90-4348-8c54-495990cfbca0-184 and uid c8f6c151-9e37-4743-a870-a7a9044babd7
...
...
May-09 16:38:42.376 [JavaFX Application Thread] INFO b.c.p.mempool.TxValidator: Maker tx validation : SUCCESS

I do not doubt you are seeing the problem, but I cannot reproduce on my end, yet.

@bitcointerra
Copy link
Author

Came back. No mistakes. High volatility. Thanks for support

ghubstan added a commit to ghubstan/bisq that referenced this issue May 14, 2022
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`.
@github-actions
Copy link

github-actions bot commented Sep 5, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions
Copy link

This issue has been automatically closed because of inactivity. Feel free to reopen it if you think it is still relevant.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants