cryptonomex / graphene

MIT License
1.05k stars 337 forks source link

Implement market snapshot plugin #643

Closed abitmore closed 7 years ago

abitmore commented 8 years ago

In forum discussion "Subsidizing Market Liquidity", at first BM proposed a proposal to subsidize "makers" of filled orders, then comes a more widely accepted concept which is to subsidize open orders, started from this link, and discussions about implementation in this link, this link, this link and more.

According to the discussion, it's good to implement a plugin to provide basic data (market snapshots), then develop subsidization algorithms on the top.

A market snapshot is a set of objects (e.g. {feed price, ask orders, bid orders}) on a given market (trading pair) at a given time point.

The plugin tracks configured markets and exposes a set of APIs, so client applications can get a list of snapshots of specified market combined with specified time range.

I'm working on this.

roadscape commented 8 years ago

Plain snapshots might not be enough to implement liquidity scoring; we may need to track orders continuously instead of at intervals.

IMO, it's easy enough to get an orderbook 'snapshot' thru the API. The hard part besides scoring is accurately tracking how long orders were on the book. How often do you think these snapshots will need to be taken to get fair measurements?

abitmore commented 8 years ago

@roadscape thanks for joining the discussion.

Plain snapshots might not be enough to implement liquidity scoring; we may need to track orders continuously instead of at intervals.

Yes, the idea is to take snapshots continuously, so it's able to fetch a snapshot of any time point, or a list of snapshots of any time range.

IMO, it's easy enough to get an orderbook 'snapshot' thru the API. The hard part besides scoring is accurately tracking how long orders were on the book. How often do you think these snapshots will need to be taken to get fair measurements?

Check every block, when there is a change made to the market, take a snapshot. I've described how to calculate scores based on the snapshots in this link.

vikramrajkumar commented 7 years ago

This issue was moved to bitshares/bitshares-core#205