Commit Graph

42 Commits

Author SHA1 Message Date
ftocal d7391f6ba1
Create api notional with historical prices (#931)
Add historical prices job
Change transfer report job
2024-01-02 10:38:03 -03:00
ftocal af5bd3017f
Handle native tx hash for solana when receive event from blockchain-watcher (#851) 2023-12-04 16:29:38 -03:00
ftocal 695fd0dcd4
Add supported tokens for testnet (#810)
Update supported tokens for mainnet
2023-11-28 10:16:40 -03:00
ftocal 7c467f5267
Integrating blockchain watcher data into mongodb (#820)
* Handle log-message-published generated by blockchain-watcher in parser, tx-tracker y analytics

* Add deployment for staging-testnet environment
Improve logs

* Add operation endpoints

---------

Co-authored-by: Agustin Pazos <agpazos85@gmail.com>
2023-11-27 12:31:35 -03:00
ftocal 28fc5198b0
New job for transfer report (#756)
Co-authored-by: walker-16 <agpazos85@gmail.com>
2023-10-20 18:30:34 -03:00
ftocal 91bf42971b
Use Redis channel in spy and fly (#753) 2023-10-18 11:18:32 -03:00
ftocal 22c5f0ee22
Get token and app id from vaa payload parser to calculate price and volume measurement (#708) 2023-09-25 16:56:05 -03:00
walker-16 217c6f28be
Fix [api] get transactions by address and add mongo query monitor (#707)
Fix api endpoint get transactions by address, add mongo query monitor
2023-09-25 16:50:16 -03:00
ftocal 420d342612
Use token id as unique key in cache for prices (#701)
Co-authored-by: walker-16 <agpazos85@gmail.com>
2023-09-22 16:14:02 -03:00
gipsh 3fa1804c1a
add redis prefix to communication channel (#651) 2023-08-22 15:24:14 -03:00
agodnic 2de5b9e970
Update token database (#620)
### Summary

Update definitions in the token dictionary.
2023-08-10 11:18:58 -03:00
walker-16 87fd9d15ef
Create an api endpoint to call vaa payload parser component (#596)
* move vaa payload parser to common

* Add proxy endpoint to vaa payload parser

* Modify api deployment

* fix docs

* Fix swagger documentation
2023-08-10 11:02:14 -03:00
agodnic 3c7bab3f8a
Remove duplicated code: MongoDB connection handling (#590)
### Description

This pull request removes duplicated code related to MongoDB connection/disconnection attempts. This code was copied across all 8 microservices.

The functionality is now unified under the `common/dbutil` package.
2023-08-07 16:05:08 -03:00
agodnic d267d3ae1f
Transaction search by address: fix case sensitivity (#591)
### Description

Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/587

The endpoint `GET /api/v1/transactions?address={addr}` was incorrectly handling EVM addresses containing uppercase characters. This pull request fixes the issue.
2023-07-28 12:27:48 -03:00
ftocal 13819e2d7d
Add backfiller for analytics from mongodb (#562) 2023-07-25 15:36:05 -03:00
agodnic 4ee9abe91e
Exclude invalid chain IDs from top chain pairs (#574)
### Description

Tracking issues: https://github.com/wormhole-foundation/wormhole-explorer/issues/572, https://github.com/wormhole-foundation/wormhole-explorer/issues/573

This pull request fixes an issue in which the endpoint `GET /api/v1/top-chain-pairs-by-num-transfers` was returning invalid chain IDs for testnet.
2023-07-24 09:20:01 -03:00
agodnic d8bb9c46f6
`tx-tracker`: add support for the "Base" blockchain (#568)
### Description

Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/569

This pull request adds support for the "Base" blockchain in different parts of the codebase:
* The functions `domain.TranslateEmitterAddress`, `domain.EncodeTrxHashByChainID` and `domain.DecodeNativeAddressToHex`.
* The `tx-tracker` service: it now connects to a Base RPC node to fetch origin transaction metadata.
2023-07-20 16:37:21 -03:00
walker-16 4f1987c698
514 modify parser to support new vaa payload parser response (#521)
Parse amount from metadata fields
Modify parser client to ParseWithMetadata
Add support to new vaa payload parser parse endpoint

Co-authored-by: Fernando Torres <fert1335@gmail.com>
2023-07-12 12:51:17 -03:00
walker-16 c4a55bd6e2
Fix alert prefix with new enviroment values (#509) 2023-07-06 11:20:18 -03:00
ftocal 34b8ab392f
[contract-watcher] Add opsgenie alerts and prometheus metrics (#472)
* Add prometheus metrics to contract-watcher

* Add annotations for prometheus

* Add alerts for contract-watcher
2023-06-30 11:25:09 -03:00
gipsh 78bd0cbd75
add prefix to chacheable and fix deploy (#479) 2023-06-29 15:54:45 -03:00
gipsh 2306d103d8
321 replace redis to elasticcache (#467)
* redis prefix support for caches

* fly support for prefix

* unit tests

* redis prefix for notional cache updater

* fix test

* fix tests

* use redis-prfix from config map
2023-06-28 15:04:36 -03:00
agodnic 98ae127278
[API] Expose emitter native addresses (#466)
### Description

Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/451.

The Wormhole Scan UI needs to provide a link to the emitter address for each VAA.

This pull request adds a field containing decoded emitter addresses in the following endpoints:
* `GET /api/v1/transactions`: field `emitterNativeAddress`
* `GET /api/v1/vaas*`: field `emiterNativeAddr`
2023-06-28 14:54:51 -03:00
walker-16 1c67efc3d5
Add deploy alert env var to fly + fix message prefix (#456) 2023-06-26 11:47:23 -03:00
walker-16 35b7d7b46b
remove unnecessary env var using opsgenie team api-key (#454)
remove unnecessary env var using opsgenie team
2023-06-23 11:08:57 -03:00
walker-16 25b891f6d2
Add opsgenie client + error saving vaa alert in fly component (#442) 2023-06-22 18:59:23 -03:00
gipsh ba3d1d9e61
Vanilla rate limiter (#414)
* update doc

* api def update

* first commit

* support redis, allow for private ips

* add deployment vars

---------

Co-authored-by: Hernan Gips <hernangips@OnoSendai.local>
2023-06-15 23:22:47 -03:00
ftocal 9381695d37
Fix txHash encoding by chain (#410)
Add txHash encondig backfiller
Handle txHash base58 encoding for solana in tx-tracker
Add temporary field _originTxHash in vaas and vaaIdTxHash collections by backup
Add cobra to fly backfiller

Co-authored-by: walker-16 <agpazos85@gmail.com>
2023-06-15 09:57:39 -03:00
agodnic a0475ab17e
Add endpoint `GET /api/v1/transactions` (#388)
### Summary
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/385

This pull request implements a new endpoint, `GET /api/v1/transactions`, which will be consumed by the wormhole explorer UI.

The endpoint returns a paginated list of transactions, in which each element contains a brief overview of the transaction (ID, txHash, status, etc.).

It exposes offset-based pagination via the parameters `page` and `pageSize`. Also, results can be obtained for a specific address by using the `address` query parameter.

The response model looks like this:
```json
{
  "transactions": [
   {
    "id": "1/5ec18c34b47c63d17ab43b07b9b2319ea5ee2d163bce2e467000174e238c8e7f/12965",
    "timestamp": "2023-06-08T19:30:19Z",
    "txHash": "a302c4ab2d6b9a6003951d2e91f8fdbb83cfa20f6ffb588b95ef0290aab37066",
    "originChain": 1,
    "status": "ongoing"
  },
  {
    "id": "22/0000000000000000000000000000000000000000000000000000000000000001/18308",
    "timestamp": "2023-06-08T19:17:14Z",
    "txHash": "00000000000000000000000000000000000000000000000000000000000047e7",
    "originChain": 22,
    "destinationAddress": "0x00000000000000000000000067e8a40816a983fbe3294aaebd0cc2391815b86b",
    "destinationChain": 5,
    "tokenAmount": "0.12",
    "usdAmount": "0.12012",
    "symbol": "USDC",
    "status": "completed"
  },
  ...
  ]
}
```

### Limitations of the current implementation
1. Doesn't return the total number of results (this may result in a performance issue when we filter by address)
2. Can only filter by receiver address (we don't have sender information in the database yet)
2023-06-12 11:43:48 -03:00
agodnic e7a5f0c83a
Fix an infinite loop in redis cache client (#369)
When initializing the notional cache, if there was more than one page of results, the client would run into an infinite loop.

This issue was causing several services to stall on startup in the staging environment (API, analytics, etc).
2023-05-31 16:25:16 -03:00
agodnic 0ec1cb86e2
Use decimals instead of floats in price cache (#362)
## Description

Previously, the notional cache was using the `float64` type to manipulate price data. Since floating point types can't represent price data accurately, this commit changes the codebase to use a lossless representation (i.e.: `decimal.Decimal`).
2023-05-31 16:24:40 -03:00
agodnic 37d6d42c19
Remove duplicated code in token database (#356)
### Summary

Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/344

Before this pull request, there were two separate token databases (one being used by the InfluxDB backfiller, and another one in the `common/` module being used by the analytics service).

Having two different token databases resulted in inconsistencies, due to each of these databases containing different tokens.

This PR unifies those two databases into a single one, under the `common/` module.
2023-05-30 11:14:19 -03:00
walker-16 3a445da161
288 tvl (#327)
* get tvl from json api

* Add tvl scorecards

---------

Co-authored-by: gipsh <gipsh@MaasNeoTek>
2023-05-17 15:04:17 -03:00
agodnic a21f40ed55
Get top assets by volume (#302)
### 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`.
2023-05-10 17:39:18 -03:00
agodnic a31d59822d
Add definitions to token dictionary (#292)
### 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
2023-05-08 17:51:18 -03:00
agodnic d9d49ec919
Add 24h volume to scorecards (#274)
### 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.
2023-05-04 20:17:03 -03:00
walker-16 bae5f06afb
250 governornotionalavailable sending an invalid chainid returns invalid data (#270)
* Check supported chainID in endpoint governor available notional by chain

* check supported chainID in endpoint mx notional available by chainID
2023-04-27 13:56:18 -03:00
agodnic 09870f3d65
[tx-tracker / api] Avoid duplicating data (#256)
### 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`.
2023-04-25 15:34:29 -03:00
agodnic d0cf9cc04b
[API] Fix issue in VAA search filters (#211)
### Summary

Searching for VAAs with the `txHash` and the `parsedPayload` parameters simultaneously wasn't working correctly. This commit fixes the problem.

Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/210
2023-03-27 16:14:38 -03:00
ftocal e1298f54ee
logging as json (#208) 2023-03-23 15:36:50 -03:00
agodnic 2b50eb5116
[TX TRACKER] Add component that obtains transaction data (#159)
### Summary

This pull request adds a new component under the directory `txtracker`.

This component retrieves information about portal token bridge transfers (i.e.: sender address, receiver address, timestamp), and persists the data in MongoDB.

### Chains supported

The blockhains currently supported are:
* Terra (27% of outgoing transfers)
* Solana (25%)
* BSC (25%)
* Eth (14%)
* Polygon (4%)

The remaining chains will be added iteratively as needed.
2023-03-14 15:49:10 -03:00
walker-16 9ba11aab24
Feataure/add analytic component (#164)
* Add Readme, dockerfile, go module init

* Add config package and main

* Add infrastructure package [health/ready]

* Add common lib

* Add http/queue package

* build healtcheck to influx cloud version

* Add vaa_count metric

* Enable pyth message
2023-02-28 17:58:26 -03:00