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

Total historic volume (for scorecard) #289

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

Total historic volume (for scorecard) #289

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

Comments

@gipsh
Copy link
Contributor

gipsh commented May 3, 2023

Scorecard needs to show the historic volume AKA amount of money in USD moved by the bridge.

How we calculate the total volume using vaa metric

  • Create a new bucket called vaa_volume_count

  • Create a task to calculate the total volume (amount * notional) like this

option task = {name: "summarize-volume", every: 5m}

from(bucket: "wormhole")
    |> range(start: -task.every)
    |> filter(fn: (r) => r["_measurement"] == "vaa")
    |> filter(fn: (r) => r["token"] != "none")
    |> filter(fn: (r) => r["_field"] == "amount")
    |> drop(
        columns: [
            "origin_chain",
            "target_chain",
            "origin_address",
            "target_address",
            "token",
        ],
    )
    |> sum(column: "_value")
    |> yield(name: "sumamount")
    |> to(bucket: "vaa_volume_count", timeColumn: "_stop")
  • Figure out how to summarize the new calculated data with the one already stored in the bucket. incrementalSum().
    or regenerate the bucket data with the sum of the 2 values.

  • For backfilling run the flux query with start:-900d and wait until the data is ready.

@gipsh gipsh added this to the v1 milestone May 3, 2023
@gipsh gipsh added the api Api component label May 3, 2023
@gipsh gipsh changed the title Total historic volume for score card Total historic volume (for scorecard) May 4, 2023
@agodnic agodnic added the v1 v1 release label May 6, 2023
@walker-16 walker-16 assigned ftocal and unassigned ftocal May 9, 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

When branches are created from issues, their pull requests are automatically linked.

4 participants