From 92263e6e25fa46c30b98fd018c82a91a78814e51 Mon Sep 17 00:00:00 2001 From: Sirapop Date: Thu, 1 Aug 2024 13:50:57 +0700 Subject: [PATCH] chore: update value diff of escrow balance (#78) --- methods/tvl/getTVLAlert.js | 4 ++-- package.json | 2 +- terraform/devnet-amplifier/variables.tf.example | 2 +- terraform/devnet-verifiers/variables.tf.example | 2 +- terraform/mainnet/variables.tf.example | 2 +- terraform/stagenet/variables.tf.example | 2 +- terraform/testnet/variables.tf.example | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/methods/tvl/getTVLAlert.js b/methods/tvl/getTVLAlert.js index 74f62d2b..66ad92fd 100644 --- a/methods/tvl/getTVLAlert.js +++ b/methods/tvl/getTVLAlert.js @@ -27,7 +27,7 @@ module.exports = async params => { toArray(Object.values({ ...d.tvl })).findIndex(_d => _d.is_abnormal_supply) > -1 && Object.values(d.tvl).findIndex(_d => { const { price } = { ...d }; const { supply, escrow_balance, percent_diff_supply } = { ..._d }; - return toNumber((supply || escrow_balance) * (percent_diff_supply / 100) * price) > alert_asset_escrow_value_threshold; + return toNumber((escrow_balance || supply) * (percent_diff_supply / 100) * price) > alert_asset_escrow_value_threshold; }) > -1 )); @@ -66,7 +66,7 @@ module.exports = async params => { ))), } : { - chains: Object.entries({ ...tvl }).filter(([k, v]) => v?.is_abnormal_supply && toNumber((v.supply || v.escrow_balance) * (v.percent_diff_supply / 100) * price) > alert_asset_escrow_value_threshold).map(([k, v]) => { + chains: Object.entries({ ...tvl }).filter(([k, v]) => v?.is_abnormal_supply && toNumber((v.escrow_balance || v.supply) * (v.percent_diff_supply / 100) * price) > alert_asset_escrow_value_threshold).map(([k, v]) => { const { percent_diff_supply, contract_data, denom_data, gateway_address, gateway_balance, token_manager_address, token_manager_type, token_manager_balance, ibc_channels, escrow_addresses, escrow_balance, source_escrow_addresses, source_escrow_balance, url } = { ...v }; let { supply } = { ...v }; if (k === native_chain && k !== 'axelarnet') { diff --git a/package.json b/package.json index c2276949..63098c6b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "axelarscan-api", - "version": "0.0.50", + "version": "0.0.51", "description": "Axelarscan API", "main": "index.js", "scripts": { diff --git a/terraform/devnet-amplifier/variables.tf.example b/terraform/devnet-amplifier/variables.tf.example index c62b1d4d..198becf3 100644 --- a/terraform/devnet-amplifier/variables.tf.example +++ b/terraform/devnet-amplifier/variables.tf.example @@ -45,7 +45,7 @@ variable "log_level" { variable "app_version" { description = "App version, same as docker image version" - default = "0.0.50" + default = "0.0.51" validation { error_message = "Must be valid semantic version. $Major.$Minor.$Patch" condition = can(regex("^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", var.app_version)) diff --git a/terraform/devnet-verifiers/variables.tf.example b/terraform/devnet-verifiers/variables.tf.example index 67db8e54..7d700536 100644 --- a/terraform/devnet-verifiers/variables.tf.example +++ b/terraform/devnet-verifiers/variables.tf.example @@ -45,7 +45,7 @@ variable "log_level" { variable "app_version" { description = "App version, same as docker image version" - default = "0.0.50" + default = "0.0.51" validation { error_message = "Must be valid semantic version. $Major.$Minor.$Patch" condition = can(regex("^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", var.app_version)) diff --git a/terraform/mainnet/variables.tf.example b/terraform/mainnet/variables.tf.example index 608b2bfe..aecf45f1 100644 --- a/terraform/mainnet/variables.tf.example +++ b/terraform/mainnet/variables.tf.example @@ -45,7 +45,7 @@ variable "log_level" { variable "app_version" { description = "App version, same as docker image version" - default = "0.0.50" + default = "0.0.51" validation { error_message = "Must be valid semantic version. $Major.$Minor.$Patch" condition = can(regex("^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", var.app_version)) diff --git a/terraform/stagenet/variables.tf.example b/terraform/stagenet/variables.tf.example index 34cb4940..a1ea9a2d 100644 --- a/terraform/stagenet/variables.tf.example +++ b/terraform/stagenet/variables.tf.example @@ -45,7 +45,7 @@ variable "log_level" { variable "app_version" { description = "App version, same as docker image version" - default = "0.0.50" + default = "0.0.51" validation { error_message = "Must be valid semantic version. $Major.$Minor.$Patch" condition = can(regex("^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", var.app_version)) diff --git a/terraform/testnet/variables.tf.example b/terraform/testnet/variables.tf.example index fc6a02b3..c2eb5f3c 100644 --- a/terraform/testnet/variables.tf.example +++ b/terraform/testnet/variables.tf.example @@ -45,7 +45,7 @@ variable "log_level" { variable "app_version" { description = "App version, same as docker image version" - default = "0.0.50" + default = "0.0.51" validation { error_message = "Must be valid semantic version. $Major.$Minor.$Patch" condition = can(regex("^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", var.app_version))