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

Top 7 chain activity endpoint #275

Closed
gipsh opened this issue May 2, 2023 · 0 comments
Closed

Top 7 chain activity endpoint #275

gipsh opened this issue May 2, 2023 · 0 comments
Assignees
Labels
api Api component v1 v1 release
Milestone

Comments

@gipsh
Copy link
Contributor

gipsh commented May 2, 2023

Create the endpoint for showing top 7 transactions per pair of chain

/api/v1/top7chain

Use influx metric to generate the data for 7/15/30 days.

The flux query should be something like this:

from(bucket: "wormhole")
  |> range(start: -300d)
  |> group(columns: ["origin_chain","target_chain"])
  |> count()
  |> group()
  |> sort(columns: ["_value"], desc: true)
  |> limit(n:10)
  |> yield(name:"_results")

Example of the output table:

table_results _valueno grouplong _startno groupdateTime:RFC3339 _stopno groupdateTime:RFC3339 origin_chainno groupstring target_chainno groupstring
0 52676 2022-07-06T20:53:47.227Z 2023-05-02T20:53:47.227Z solana ethereum
0 43120 2022-07-06T20:53:47.227Z 2023-05-02T20:53:47.227Z solana bsc
0 40212 2022-07-06T20:53:47.227Z 2023-05-02T20:53:47.227Z bsc solana
0 37456 2022-07-06T20:53:47.227Z 2023-05-02T20:53:47.227Z ethereum solana
0 26828 2022-07-06T20:53:47.227Z 2023-05-02T20:53:47.227Z solana polygon
0 19434 2022-07-06T20:53:47.227Z 2023-05-02T20:53:47.227Z polygon solana
0 16394 2022-07-06T20:53:47.227Z 2023-05-02T20:53:47.227Z bsc terra
0 14048 2022-07-06T20:53:47.227Z 2023-05-02T20:53:47.227Z polygon aptos
0 12728 2022-07-06T20:53:47.227Z 2023-05-02T20:53:47.227Z bsc polygon
0 12506 2022-07-06T20:53:47.227Z 2023-05-02T20:53:47.227Z bsc ethereum
@gipsh gipsh added this to the v1 milestone May 2, 2023
@gipsh gipsh added the api Api component label May 2, 2023
@agodnic agodnic added the v1 v1 release label May 2, 2023
@agodnic agodnic self-assigned this May 10, 2023
agodnic added a commit that referenced this issue May 12, 2023
### Summary

Tracking issue: #275

This pull request implements the endpoint `GET /api/v1/top-chain-pairs-by-num-transfers`, which returns the chain pairs that have the most transfers.Internally, the endpoint uses data summarized daily to speed up query execution times.

This endpoint has a mandatory query parameter named timerange, which must be set to `7d`, `15d` or `30d`.
@agodnic agodnic closed this as completed May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Api component v1 v1 release
Projects
None yet
Development

No branches or pull requests

2 participants