MystenLabs / sui

Sui, a next-generation smart contract platform with high throughput, low latency, and an asset-oriented programming model powered by the Move programming language
https://sui.io
Apache License 2.0
6.27k stars 11.21k forks source link

New Deepbook Indexer Endpoints #20418

Closed leecchh closed 7 hours ago

leecchh commented 9 hours ago

Description

  1. Allow for querying for quote asset
  2. Removed 24 hour endpoints, historical endpoints will return 24 hour volume using base asset by default if query params not given
  3. Interval default is 1 hour for interval endpoint

Endpoint call examples: Public endpoint: https://deepbook-indexer.mainnet.mystenlabs.com/

/get_historical_volume/:pool_ids?start_time=1731260703&end_time=1731692703&volume_in_base=true
/get_historical_volume_by_balance_manager_id/:pool_ids/:balance_manager_id?start_time=1731260703&end_time=1731692703&volume_in_base=true
/get_historical_volume_by_balance_manager_id_with_interval/:pool_ids/:balance_manager_id?start_time=1731260703&end_time=1731462703&interval=86400&volume_in_base=true

Default without param is volume in the last 24 hours, using volume in base asset (SUI in SUI/USDC pool as example)

Test plan

How did you test the new or updated feature?

Tested locally, updated docs

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.

vercel[bot] commented 9 hours ago

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 Nov 25, 2024 5:41pm
3 Skipped Deployments | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **multisig-toolkit** | ⬜️ Ignored ([Inspect](https://vercel.com/mysten-labs/multisig-toolkit/Dy8dxTGgEMBWFtvnH8NHBkcv5FMK)) | [Visit Preview](https://multisig-toolkit-git-tlee-new-indexer-endpoint-mysten-labs.vercel.app) | | Nov 25, 2024 5:41pm | | **sui-kiosk** | ⬜️ Ignored ([Inspect](https://vercel.com/mysten-labs/sui-kiosk/FNbc4kBwfcQvh3BZ5PDP4sAidjJJ)) | [Visit Preview](https://sui-kiosk-git-tlee-new-indexer-endpoint-mysten-labs.vercel.app) | | Nov 25, 2024 5:41pm | | **sui-typescript-docs** | ⬜️ Ignored ([Inspect](https://vercel.com/mysten-labs/sui-typescript-docs/93gexy7rAK9bSHiXH9YiW8kueZPV)) | [Visit Preview](https://sui-typescript-docs-git-tlee-new-indexer-endpoint-mysten-labs.vercel.app) | | Nov 25, 2024 5:41pm |