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

Feature: able to set an ID in limit_order_create operation #556

Open
rmawatson opened this issue Jan 3, 2018 · 11 comments
Open

Feature: able to set an ID in limit_order_create operation #556

rmawatson opened this issue Jan 3, 2018 · 11 comments

Comments

@rmawatson
Copy link

I am trying to traverse historical bitshares data and am having problems with associating fill_order and limit_order_cancel operations to their limit_order_create operations.

Both of limit_order_cancel and fill_order operations contain an order_id field in the json. But historical limit_order_create operations do not. It seems this order_id is only available and returned when the original order is created.

As a workaround I was hoping to use the order_id field in limit_order_cancel and fill_order and get_object() to get the original order. However get_object() returns nothing for 1.7.x type objects (limit order objects). Unless I am missing something, I am basically unable to link these operations.

@oxarbitrage
Copy link
Member

ill take a look and let you know what can we do.

@oxarbitrage oxarbitrage self-assigned this Jan 3, 2018
@abitmore
Copy link
Member

abitmore commented Jan 4, 2018

If an order get completely filled or cancelled, it will be removed from the object database, so get_object will return null. The order id is in the result or operation_result field after created.

@rmawatson
Copy link
Author

rmawatson commented Jan 4, 2018

its in the object result when created, but not included with the data stored in the blocks, so given a historical limit_order_create operation and various fill_order and limit_order_cancel (which include the order id in the json) there is no way to correlate them. All that would be needed is that the order_id is added to the stored limit_order_create.

@abitmore
Copy link
Member

@rmawatson thanks for the suggestion. It's a good idea, however, it's a blockchain, we can not simply add a field to an existing operation, although not impossible to upgrade the consensus protocol. If you have interest and time, try compose an more detailed solution and submit an issue to https://github.com/bitshares/bsips/, including how to add the field, how to maintain backward compatibility for both the back end and the front end and etc.

@abitmore abitmore changed the title order_id not available for historical limit_order_create operations Feature: able to set an ID in limit_order_create operation Jan 17, 2018
@abitmore abitmore added this to the Future Consensus-Changing Release milestone Jan 17, 2018
@oxarbitrage
Copy link
Member

an alternative to BSIP and hardfork can be to make use of WIP elasticsearch objects plugin to go after this issue. i think it is important to have some workaround to make that relation possible. #500

the problem is mainly the 1.7.X objects are removed after a fill cancel or at expiration. similar issue in proposal objects that were already added to that plugin i now added the limit order objects in this commit: fddf08d

with this the 1.7.X will be added to the database and never deleted allowing us to make the relation.

@xeroc
Copy link
Member

xeroc commented Feb 12, 2018

Assuming create-limit-order ooeration has an extension field, why not use that to allow custom identifier, together with a new index to track object id and custom identifier?

@oxarbitrage
Copy link
Member

hmm, i don't think it will be that easy.
when the limit order is created we have nothing to add as there is no cancel neither fill at that moment. update the limit order will mean to add a new operation. maybe i am wrong.

@abitmore
Copy link
Member

Assuming create-limit-order operation has an extension field, why not use that to allow custom identifier, together with a new index to track object id and custom identifier?

That's doable. Just a note: making use of extensions field requires a hard fork due to serialization change.

abitmore added a commit that referenced this issue Jul 27, 2019
Some bots place limit orders then try to cancel some of them before a new
block arrives. However, the order's id (in pending state) may be different
in individual nodes, thus caused the exceptions.

A potential solution to the order_id inconsistent issue:
#556
abitmore added a commit that referenced this issue Jul 27, 2019
Some bots place limit orders then try to cancel some of them before a
new block arrives. However, the order's id (in pending state) may be
different in individual nodes, thus caused the exceptions.

A potential solution to the order_id inconsistent issue:
#556
@abitmore
Copy link
Member

@sschiessl-bcp shared an article https://hackernoon.com/the-ideal-crypto-trading-api-b1bbb2675875 which indicates a client-decided ID is good.

@xeroc
Copy link
Member

xeroc commented Aug 5, 2019

So, adding a user-defined order-id would IMHO require

  • a hardfork to add the user-defined id to the create_limit_order operation
  • an index over user defined order id that maps to object ids
  • an API that allows to query for the object id by using the user-defined order id

Doesn't sound too complicated to me

@abitmore
Copy link
Member

abitmore commented Aug 5, 2019

@xeroc please continue the discussion in bitshares/bsips#185. If have the time / resource, write a BSIP.

manikey123 pushed a commit to manikey123/bitshares-core that referenced this issue Aug 12, 2019
Some bots place limit orders then try to cancel some of them before a
new block arrives. However, the order's id (in pending state) may be
different in individual nodes, thus caused the exceptions.

A potential solution to the order_id inconsistent issue:
bitshares#556
jmjatlanta pushed a commit that referenced this issue Sep 3, 2019
Some bots place limit orders then try to cancel some of them before a
new block arrives. However, the order's id (in pending state) may be
different in individual nodes, thus caused the exceptions.

A potential solution to the order_id inconsistent issue:
#556
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

4 participants