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

Add liquidity pool statistics and new APIs #2297

Merged
merged 11 commits into from
Dec 29, 2020
Merged

Add liquidity pool statistics and new APIs #2297

merged 11 commits into from
Dec 29, 2020

Conversation

abitmore
Copy link
Member

@abitmore abitmore commented Oct 25, 2020

For issue #2280.

  • Added some liquidity pool statistics in market history plugin
  • Extended existing liquidity pool APIs with an optional with_statistics parameter
    • list_liquidity_pools( limit, start_pool_id, with_statistics )
    • get_liquidity_pools_by_asset_a( asset, limit, start_pool_id, with_statistics )
    • get_liquidity_pools_by_asset_b( asset, limit, start_pool_id, with_statistics )
    • get_liquidity_pools_by_both_assets( asset_a, asset_b, limit, start_pool_id, with_statistics )
    • get_liquidity_pools_by_share_asset( assets_vector, subscribe, with_statistics )
    • get_liquidity_pools_by_owner( account, limit, start_share_asset_id, with_statistics )
  • Added a new database API
    • get_liquidity_pools( pool_IDs, subscribe, with_statistics )
  • Added history APIs
    • history_api::get_liquidity_pool_history( pool_id, start_time, stop_time, limit, operation_type )
    • history_api::get_liquidity_pool_history_by_sequence( pool_id, start_sequence, stop_time, limit, operation_type )

@abitmore abitmore added this to the 5.1.0 - Feature Release milestone Oct 25, 2020
@abitmore abitmore linked an issue Oct 25, 2020 that may be closed by this pull request
17 tasks
@abitmore abitmore marked this pull request as ready for review November 11, 2020 00:18
@abitmore abitmore changed the title Add liquidity pool statistics Add liquidity pool statistics and new APIs Nov 11, 2020
@abitmore abitmore force-pushed the lp-market-his branch 3 times, most recently from 032e5b8 to 6d87ac2 Compare November 15, 2020 14:33
@sschiessl-bcp
Copy link

sschiessl-bcp commented Mar 18, 2021

What does the comment on the market history plugin mean?
Can I fetch liquidity pool in bucket-style like market history somehow?

I'm showing calculated price right now since I did not want to recreate bucket logic yet
image

@abitmore
Copy link
Member Author

The bucket logic hasn't been done for liquidity pools. What you have are described in OP.

@sschiessl-bcp
Copy link

sschiessl-bcp commented Mar 21, 2021

The bucket logic hasn't been done for liquidity pools. What you have are described in OP.

Are there any plans to add it with next API upgrade, or would you oppose a PR adding it?

@abitmore
Copy link
Member Author

@sschiessl-bcp No plan yet. Just haven't got time, and didn't see a strong use case. If you really want it, I can add it when got time.
BTW I think it's not hard to get the data via ES / Kibana and they're more flexible.

@sschiessl-bcp
Copy link

BTW I think it's not hard to get the data via ES / Kibana and they're more flexible.

No, not hard. But then all existing code that works with market history is directly compatible, which would be nice.

For the explorer, I recreated it now, just FYI
https://blocksights.info/#/pools/1.19.61

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.

Liquidity Pool Statistics
2 participants