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

Public order options: pause and renew #87

Closed
Reckless-Satoshi opened this issue Apr 9, 2022 · 2 comments
Closed

Public order options: pause and renew #87

Reckless-Satoshi opened this issue Apr 9, 2022 · 2 comments
Labels
enhancement 🆙 New feature or request
Milestone

Comments

@Reckless-Satoshi
Copy link
Collaborator

Reckless-Satoshi commented Apr 9, 2022

Facilitate public order management by introducing two features:

  1. Pause public order: A maker can hide at will a public order from the book. Example use: if a maker cannot attend for X hours a public order, he can hide it. No risk for him to lose his bond for not replying to a taker and no time wasted for the taker, same effect as if he cancels and re-create. Yet, it is way easier to pause & un-pause than cancelling and creating an order anew.

  2. Renew public order: simple, you click on renew, a new maker bond is shown, once locked the order stays alive for 24 more hours. If the order expires while public, the "renew button" stays visible for 3 more hours. If the telegram notifications are enabled, the telegram bot sends a message with an invoice to renew the order (new maker bond) payable in the next 3 hours from order expiration. Once locked, the order goes back to being public in the book (no need to open the RoboSats site).

Thanks @decentralizedb, @zehks and Kote in the community channel @robosats_es for brainstorming and giving shape to these features.

@Reckless-Satoshi Reckless-Satoshi added this to the Future milestone Apr 9, 2022
@Reckless-Satoshi Reckless-Satoshi added the enhancement 🆙 New feature or request label Apr 9, 2022
@zehks
Copy link

zehks commented Apr 9, 2022

Awesome feature.

An easy approach could be to use the current status flag the orders have. The public and available orders currently have an status value equals to 1. A paused order could have another different value (-1, 2, 3.. I don't know the existing values yet).
With this approach, a minimum change in the backend is required.

When listing orders, avoid the ones with status equal to "paused value".
To prevent taking this order with an alternative client, an additional condition should be added on the backend to check if it is a permitted action (i.e the order is not paused).

@Reckless-Satoshi
Copy link
Collaborator Author

Reckless-Satoshi commented Apr 9, 2022

@zehks Indeed! Sounds like the most sensible approach. All the status values can be seen here https://github.com/Reckless-Satoshi/robosats/blob/6044583b2882b5ab9b78f42b32ce6bb46a930a10/api/models.py#L162-L181
The API only allows users to take orders that are Public (order.status == 1), so if a paused order has another value, it will of course not show in the book and not be available to be taken . So far, the status 3 (Deleted) has no use and will probably never be used (orders are either cancelled or expired), so it might be a good idea to repurpose it into PAU = 2, "Paused". Then write the logics for pausing and un-pausing the order and the frontend elements and dialogs.

I do not consider this a high priority feature though, so it will take some time until this task is taken by me. Contributions to implement this features are very welcomed as always. Though pulling off this feature requires a good understanding of api/views.py, api/models.py & api/logics.py that are probably the 3 files that require the most study time before any attempt to modify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🆙 New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants