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

Historical volume by balance manager #20285

Merged
merged 4 commits into from
Nov 18, 2024
Merged

Historical volume by balance manager #20285

merged 4 commits into from
Nov 18, 2024

Conversation

leecchh
Copy link
Contributor

@leecchh leecchh commented Nov 15, 2024

Description

Historical volume by balance manager

Endpoint 1: /get_historical_volume_by_balance_manager_id/:pool_ids/:balance_manager_id/:start_time/:end_time

pool_ids delimited by ",", start_time and end_time in unix ts seconds

Response format:
{pool_id_1: [maker_volume, taker_volume], pool_id_2: ...}

Example: /get_historical_volume_by_balance_manager_id/0xb663828d6217467c8a1838a03793da896cbe745b150ebd57d82f814ca579fc22,0xe05dafb5133bcffb8d59f4e12465dc0e9faeaa05e3e342a08fe135800e3e4407/0x344c2734b1d211bd15212bfb7847c66a3b18803f3f5ab00f5ff6f87b6fe6d27d/1731260703/1731692703

Response example:
{"0xe05dafb5133bcffb8d59f4e12465dc0e9faeaa05e3e342a08fe135800e3e4407":[2036945300000000,17349400000000],"0xb663828d6217467c8a1838a03793da896cbe745b150ebd57d82f814ca579fc22":[14206210000000,3690000000]}

Endpoint 2: /get_historical_volume_by_balance_manager_id_with_interval/:pool_ids/:balance_manager_id/:start_time/:end_time/:interval

pool_ids delimited by ",", start_time, end_time, and interval in unix ts seconds. If start time is 5, end time is 10, and interval is 2, response will include volume from 5-7 and 7-9 with the start time of the periods as keys.

Response format:
{time_1: {pool_id_1: [maker_volume, taker_volume], pool_id_2: ...}, time_2: {pool_id_1: [maker_volume, taker_volume], pool_id_2: ...}

Example:
/get_historical_volume_by_balance_manager_id_with_interval/0xb663828d6217467c8a1838a03793da896cbe745b150ebd57d82f814ca579fc22,0xe05dafb5133bcffb8d59f4e12465dc0e9faeaa05e3e342a08fe135800e3e4407/0x344c2734b1d211bd15212bfb7847c66a3b18803f3f5ab00f5ff6f87b6fe6d27d/1731460703/1731692703/86400

Response example:
{"1731460703000":{"0xe05dafb5133bcffb8d59f4e12465dc0e9faeaa05e3e342a08fe135800e3e4407":[505887400000000,2051300000000],"0xb663828d6217467c8a1838a03793da896cbe745b150ebd57d82f814ca579fc22":[703740000000,0]},"1731547103000":{"0xe05dafb5133bcffb8d59f4e12465dc0e9faeaa05e3e342a08fe135800e3e4407":[336777500000000,470600000000],"0xb663828d6217467c8a1838a03793da896cbe745b150ebd57d82f814ca579fc22":[2665470000000,0]}}

Test plan

How did you test the new or updated feature?

Tested locally

Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • Indexer: Adds the endpoints /get_historical_volume_by_balance_manager_id/:pool_ids/:balance_manager_id/:start_time/:end_time and /get_historical_volume_by_balance_manager_id_with_interval/:pool_ids/:balance_manager_id/:start_time/:end_time/:interval for DeepBook indexer.
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • REST API:

Copy link

vercel bot commented Nov 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Nov 15, 2024 6:41pm
sui-kiosk ⬜️ Ignored (Inspect) Nov 15, 2024 6:41pm
sui-typescript-docs ⬜️ Ignored (Inspect) Nov 15, 2024 6:41pm

@leecchh leecchh temporarily deployed to sui-typescript-aws-kms-test-env November 15, 2024 18:41 — with GitHub Actions Inactive
@leecchh leecchh merged commit d56e282 into main Nov 18, 2024
54 of 58 checks passed
@leecchh leecchh deleted the tlee/historical-volume-bm branch November 18, 2024 20:36
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.

2 participants