### Summary
Before pull request, in `GET /api/v1/scorecards`, the queries for each scorecard were being executed sequentially. This PR changes the handler to run all those queries concurrently.
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/336
### Summary
This pull request adds the source code from https://github.com/XLabs/influx-backfiller to this repository.
Also, several changes have been made to the InfluxDB backfiller:
* Stop using floats to store/manipulate price data, use decimals or integers instead.
* Update the volume metric to be in sync with the rest of the codebase.
* Remove duplicated code between the influx backfiller and analytics modules.
* Remove a fair amount of unused code
### Summary
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/320
This pull request adds the `24h_messages` field to the response in `GET /api/v1/scorecards`. This field indicates the total number of VAAs emitted in the last 24 hours, including messages from PythNet.
Also, the analytics component has been updated to generate a new metric for this purpose. There is a task that summarizes data every 5 minutes to speed up query times. The data is retained for 24 hours only. For this particular metric, writes to InfluxDB are being batched to improve performance.
The endpoint `GET /api/v1/scorecards` was returning an inaccurate number for the volume metric. This pull request fixes the issue.
Additionally, the response model of `GET /api/v1/top-assets-by-volume` has been changed as specified by @raop155:
```
{
"assets": [
{
"symbol": "USDCet",
"tokenChain": 1,
"tokenAddress": "000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"volume": "475173.83806883"
}
]
}
```
### Summary
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/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`.
### Summary
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/276
This pull request implements the endpoint `GET /api/v1/top-assets-by-volume`, which returns the assets that have the highest volume. 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`.
### Summary
In order to compute volume metrics for each token, we need metadata about the token that is not present in the VAAs (e.g.: decimals, symbol).
That information is statically defined in `common/domain/tokenbridge.go`. This pull request adds the most relevant tokens (i.e.: the tokens that contribute the most volume) to the existing definitions. It is very likely that more token definitions will be added in the future as needed.
The token metadata that was previously defined in the `notional` package (symbols, coingecko IDs) was also moved to `common/domain/tokenbridge.go`.
Tracking issue https://github.com/wormhole-foundation/wormhole-explorer/issues/281
* Fix global tx to keep successful status
Co-authored-by: ftocal <fert1335@gmail.com>
* Increment evm retry from 5 to 10
---------
Co-authored-by: ftocal <fert1335@gmail.com>
### Summary
This pull request adds volume metrics to influxdb. Also, it adds the 24h volume metric to `GET /api/v1/scorecards`.
Tracking issues: https://github.com/wormhole-foundation/wormhole-explorer/issues/221, https://github.com/wormhole-foundation/wormhole-explorer/issues/280
### Changes:
* The `parser` service no longer generates metrics for influxdb. All metrics-related code was removed from that service, that code was moved to the analytics service instead.
* New volume metrics were added to the analytics service.
* The notional cache was modified to use token names (i.e.: ticker symbols) as keys instead of chain IDs.
* The notional cache reader was moved to the `common/client/cache` package.
* A little bit of duplicated code between the cache reader and writer was removed.
* A 24h volume metric was added to `GET /api/v1/scorecards`.
* A dictionary that stores token metadata was added under `common/domain/tokenbridge.go`. More tokens will be added to it in the near future.
* Add client to eth transaction Receipt endpoint
* Only process evm transaction from the contractAddress
* Add function to get Status for evm and evm standard watcher
* Fix unkown status and retry count
### Summary
The output of `GET /api/v1/vaas` was not being correctly sorted. This pull request changes the behavior so that the output will be sorted by the `timestamp` field.
Additionally, duplicated code was removed in the VAA code that handles queries.
Also, there was an unused query parameter `sortBy` which was being exposed but not used. Hence it was removed.
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/233
### Summary
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/254
For all chains except Solana, the data in `globalTransactions.sourceTx` was somewhat duplicated, since we already had that data in the `vaas` collection.
This pull request changes the `tx-tracker` service so that no redundant data will be written, and also changes the API to look up the data from the `vaas` collection instead.
The responses from the endpoint `/api/v1/global-tx` will no longer contain the field `originTx.from`.
### Summary
This pull request adds the `GET /api/v1/scorecards` endpoint, which is required by the wormscan frontend.
Most of the fields that this endpoint should return are being omitted because the data is not currently available on the backend. Those fields will be added iteratively as the data becomes available.
The current format of the response is:
```json
{
"total_tx_count": "1300200",
"24h_tx_count": "4200"
}
```
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/221
## Deployment details
In order to populate the `"total_tx_count"` metric, a task is needed in influxdb:
```
$ cat total-vaa-count.flux
option task = {
name: "Total number of emitted VAAs",
every: 1m
}
from(bucket: "wormhole-explorer")
|> range(start: 2018-01-01T00:00:00Z)
|> filter(fn: (r) => r._measurement == "vaa_count")
|> group(columns: ["_measurement"])
|> set(key: "_measurement", value: "total_vaa_count")
|> count()
|> map(fn: (r) => ({r with _time: now()}))
|> map(fn: (r) => ({r with _field: "total_vaa_count"}))
|> to(bucket: "wormhole-explorer", org: "xlabs")
```