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

Coinmarketcap Deepbook Endpoints #20453

Merged
merged 34 commits into from
Dec 4, 2024
Merged

Coinmarketcap Deepbook Endpoints #20453

merged 34 commits into from
Dec 4, 2024

Conversation

leecchh
Copy link
Contributor

@leecchh leecchh commented Nov 27, 2024

Description

Modified Endpoint 1:
/get_historical_volume/:pool_id -> /historical_volume/pool_name
Response will display pool as pool_name

Example call:
/historical_volume/SUI_USDC,DEEP_USDC?start_time=1733152516&end_time=1733238917

Example response:
{"DEEP_USDC":24033500000000,"SUI_USDC":2647584300000000}

New Endpoint 1: /all_historical_volume
Retrieves the pools stored in db and return volume for all pools within time range

Example Call:
/all_historical_volume?start_time=1733152516&end_time=1733238917

Example Response:
{"DEEP_USDC":23658150000000,"DEEP_SUI":5311220000000,"TYPUS_SUI":662314300000000,"SUI_USDC":3365051200000000,"WUSDC_USDC":7960304900000,"NS_USDC":783869300000,"NS_SUI":379958200000}

New Endpoint 2: /orderbook/:pool_name
More information: https://docs.google.com/document/d/1S4urpzUnO2t7DmS_1dc4EL4tgnnbTObPYXvDeBnukCg/edit?tab=t.0#bookmark=kix.ojdax1m5sg58

Required path:
pool_name: "LTC_BTC"

Optional params:
level (1 or 2): Level 1 – Only the best bid and ask. Level 2 – Arranged by best bids and asks.
depth: Not defined or 0 = full order book Depth = 100 means 50 for each bid/ask side. Cannot be 1.
All bids and asks returned are sorted by best to worst

Example call:
/orderbook/SUI_USDC?depth=4

Example output:
{"timestamp":"1733252111939","bids":[["3.796","958.5"],["3.795","5000"]],"asks":[["3.799","1000"],["3.801","7238"]]}

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 /all_historical_volume and /orderbook/:pool_name endpoints to the DeepBook Indexer API. /all_historical_volume retrieves the pools stored in the database and returns volume for all pools within a time range. /orderbook/:pool_name retrieves the level and depth of the requested order book pool. The PR also updates the /get_historical_volume/:pool_id endpoint to read /historical_volume/pool_name.
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • REST API:

Copy link

vercel bot commented Nov 27, 2024

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

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 4, 2024 5:22pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Dec 4, 2024 5:22pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Dec 4, 2024 5:22pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Dec 4, 2024 5:22pm

@leecchh leecchh temporarily deployed to sui-typescript-aws-kms-test-env November 27, 2024 20:15 — with GitHub Actions Inactive
@leecchh leecchh temporarily deployed to sui-typescript-aws-kms-test-env December 2, 2024 22:01 — with GitHub Actions Inactive
@leecchh leecchh temporarily deployed to sui-typescript-aws-kms-test-env December 2, 2024 22:08 — with GitHub Actions Inactive
@leecchh leecchh temporarily deployed to sui-typescript-aws-kms-test-env December 2, 2024 22:11 — with GitHub Actions Inactive
@leecchh leecchh temporarily deployed to sui-typescript-aws-kms-test-env December 2, 2024 22:15 — with GitHub Actions Inactive
@leecchh leecchh temporarily deployed to sui-typescript-aws-kms-test-env December 2, 2024 22:23 — with GitHub Actions Inactive
@leecchh leecchh temporarily deployed to sui-typescript-aws-kms-test-env December 2, 2024 22:24 — with GitHub Actions Inactive
@leecchh leecchh temporarily deployed to sui-typescript-aws-kms-test-env December 2, 2024 23:04 — with GitHub Actions Inactive
@leecchh leecchh temporarily deployed to sui-typescript-aws-kms-test-env December 2, 2024 23:06 — with GitHub Actions Inactive
@leecchh leecchh temporarily deployed to sui-typescript-aws-kms-test-env December 3, 2024 17:58 — with GitHub Actions Inactive
@leecchh leecchh temporarily deployed to sui-typescript-aws-kms-test-env December 3, 2024 18:44 — with GitHub Actions Inactive
@leecchh leecchh temporarily deployed to sui-typescript-aws-kms-test-env December 3, 2024 18:48 — with GitHub Actions Inactive
@leecchh leecchh temporarily deployed to sui-typescript-aws-kms-test-env December 3, 2024 19:03 — with GitHub Actions Inactive
@leecchh leecchh temporarily deployed to sui-typescript-aws-kms-test-env December 3, 2024 19:18 — with GitHub Actions Inactive
@leecchh leecchh temporarily deployed to sui-typescript-aws-kms-test-env December 3, 2024 19:24 — with GitHub Actions Inactive
Copy link
Contributor

@0xaslan 0xaslan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, would be nice if we can get rid of all unwrap()

crates/sui-deepbook-indexer/src/server.rs Outdated Show resolved Hide resolved
crates/sui-deepbook-indexer/src/server.rs Outdated Show resolved Hide resolved
@leecchh leecchh temporarily deployed to sui-typescript-aws-kms-test-env December 4, 2024 17:21 — with GitHub Actions Inactive
@leecchh leecchh merged commit aaf9347 into main Dec 4, 2024
52 checks passed
@leecchh leecchh deleted the tlee/cmc-endpoints branch December 4, 2024 18:01
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