Skip to content

Commit

Permalink
Merge pull request #810 from ionicprotocol/add/liskfraxbot
Browse files Browse the repository at this point in the history
Add/liskfraxbot
  • Loading branch information
rhlsthrm authored Nov 27, 2024
2 parents d1346a9 + 892f9de commit 442f3c1
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/deploy-bots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ jobs:
MODE_MAINNET_RPC_URLS: ${{ secrets.MODE_MAINNET_RPC_URLS }}
BASE_MAINNET_RPC_URLS: ${{ secrets.BASE_MAINNET_RPC_URLS }}
OPTIMISM_MAINNET_RPC_URLS: ${{ secrets.OPTIMISM_MAINNET_RPC_URLS }}
LISK_MAINNET_RPC_URLS: ${{ secrets.LISK_MAINNET_RPC_URLS }}
FRAXTAL_MAINNET_RPC_URLS: ${{ secrets.FRAXTAL_MAINNET_RPC_URLS }}

steps:
- name: Checkout repository
Expand All @@ -360,8 +362,7 @@ jobs:
# - name: run smoke tests for feed verifier
# working-directory: ./ops
# run: make feed-verifier-smoke-test

# - name: run smoke tests for price verifier
# - name: run smoke tests for price verifier
# working-directory: ./ops
# run: make price-verifier-smoke-test

Expand Down Expand Up @@ -394,6 +395,8 @@ jobs:
MODE_MAINNET_RPC_URLS: ${{ secrets.MODE_MAINNET_RPC_URLS }}
BASE_MAINNET_RPC_URLS: ${{ secrets.BASE_MAINNET_RPC_URLS }}
OPTIMISM_MAINNET_RPC_URLS: ${{ secrets.OPTIMISM_MAINNET_RPC_URLS }}
LISK_MAINNET_RPC_URLS: ${{ secrets.LISK_MAINNET_RPC_URLS }}
FRAXTAL_MAINNET_RPC_URLS: ${{ secrets.FRAXTAL_MAINNET_RPC_URLS }}
steps:
- name: Checkout
uses: actions/checkout@master
Expand Down
4 changes: 4 additions & 0 deletions ops/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ prod-plan:
export TF_VAR_uptime_pyth_updater_api=${UPTIME_PYTH_UPDATER_API} && \
export TF_VAR_base_mainnet_rpcs=${BASE_MAINNET_RPC_URLS} && \
export TF_VAR_mode_mainnet_rpcs=${MODE_MAINNET_RPC_URLS} && \
export TF_VAR_lisk_mainnet_rpcs=${LISK_MAINNET_RPC_URLS} && \
export TF_VAR_fraxtal_mainnet_rpcs=${FRAXTAL_MAINNET_RPC_URLS} && \
terraform init && \
terraform plan

Expand Down Expand Up @@ -109,6 +111,8 @@ prod-deploy:
export TF_VAR_uptime_pyth_updater_api=${UPTIME_PYTH_UPDATER_API} && \
export TF_VAR_base_mainnet_rpcs=${BASE_MAINNET_RPC_URLS} && \
export TF_VAR_mode_mainnet_rpcs=${MODE_MAINNET_RPC_URLS} && \
export TF_VAR_lisk_mainnet_rpcs=${LISK_MAINNET_RPC_URLS} && \
export TF_VAR_fraxtal_mainnet_rpcs=${FRAXTAL_MAINNET_RPC_URLS} && \
terraform init && \
terraform apply -auto-approve

Expand Down
14 changes: 13 additions & 1 deletion ops/prod/config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,19 @@ locals {
LIFIAPIKEY = var.lifi_api_key,
}
)
liquidation_base_variables = merge(
liquidation_lisk_variables = merge(
local.shared_env_vars_lambda,
{
DISCORD_WEBHOOK_URL = var.liquidation_discord_webhook_url,
SENDGRID_API_KEY = var.liquidation_sendgrid_api_key,
SENDGRID_EMAIL_TO = var.liquidation_sendgrid_email_to,
UPTIME_LIQUIDATOR_API = var.uptime_liquidator_api,
DISCORD_SUCCESS_WEBHOOK_URL = var.discord_success_webhook_url,
DISCORD_FAILURE_WEBHOOK_URL = var.discord_failure_webhook_url,
LIFIAPIKEY = var.lifi_api_key,
}
)
liquidation_fraxtal_variables = merge(
local.shared_env_vars_lambda,
{
DISCORD_WEBHOOK_URL = var.liquidation_discord_webhook_url,
Expand Down
30 changes: 30 additions & 0 deletions ops/prod/fraxtal.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
locals {
# Base Network RPC URL (this will be passed in via GitHub Secrets)
fraxtal_mainnet_rpcs = var.fraxtal_mainnet_rpcs # List of RPC URLs from environment variable
fraxtal_mainnet_chain_id = "252"
}


module "fraxtal_mainnet_liquidator_ecs" {
source = "../modules/bot"

cluster_name = var.liquidator_cluster_name
task_definition_family = var.task_definition_family_fraxtal
ecr_repository_url = "${local.liquidator_ecr_repository_name}:${var.bots_image_tag}"
bots_image_tag = var.bots_image_tag
web3_http_provider_urls = local.fraxtal_mainnet_rpcs
target_chain_id = local.fraxtal_mainnet_chain_id
ethereum_admin_account = var.ethereum_admin_account
uptime_liquidator_api = var.uptime_liquidator_api
ethereum_admin_private_key = var.ethereum_admin_private_key
ecs_service_name = "${var.liquidator_service_name}-fraxtal"
desired_count = var.desired_count
liquidation_discord_webhook_url = var.liquidation_discord_webhook_url
discord_success_webhook_url = var.discord_success_webhook_url
discord_failure_webhook_url = var.discord_failure_webhook_url
lifi_api_key = var.lifi_api_key
subnet_ids = ["subnet-0cd439d262800846e"]
security_group_ids = ["sg-0a3996557af867ad0"]
region = var.region
liquidator_container_name = "${var.liquidator_container_name}-fraxtal"
}
30 changes: 30 additions & 0 deletions ops/prod/lisk.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
locals {
# Base Network RPC URL (this will be passed in via GitHub Secrets)
lisk_mainnet_rpcs = var.lisk_mainnet_rpcs # List of RPC URLs from environment variable
lisk_mainnet_chain_id = "1135"
}


module "lisk_mainnet_liquidator_ecs" {
source = "../modules/bot"

cluster_name = var.liquidator_cluster_name
task_definition_family = var.task_definition_family_lisk
ecr_repository_url = "${local.liquidator_ecr_repository_name}:${var.bots_image_tag}"
bots_image_tag = var.bots_image_tag
web3_http_provider_urls = local.lisk_mainnet_rpcs
target_chain_id = local.lisk_mainnet_chain_id
ethereum_admin_account = var.ethereum_admin_account
uptime_liquidator_api = var.uptime_liquidator_api
ethereum_admin_private_key = var.ethereum_admin_private_key
ecs_service_name = "${var.liquidator_service_name}-lisk"
desired_count = var.desired_count
liquidation_discord_webhook_url = var.liquidation_discord_webhook_url
discord_success_webhook_url = var.discord_success_webhook_url
discord_failure_webhook_url = var.discord_failure_webhook_url
lifi_api_key = var.lifi_api_key
subnet_ids = ["subnet-0cd439d262800846e"]
security_group_ids = ["sg-0a3996557af867ad0"]
region = var.region
liquidator_container_name = "${var.liquidator_container_name}-lisk"
}
4 changes: 3 additions & 1 deletion ops/prod/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ ecs_service_name = "opportunity_bot_service"
liquidator_service_name = "liquidator-service"
task_definition_family_optimism = "liquidator-optimism"
task_definition_family_base = "liquidator-base"
task_definition_family_mode = "liquidator-mode"
task_definition_family_mode = "liquidator-mode"
task_definition_family_lisk = "liquidator-lisk"
task_definition_family_fraxtal = "liquidator-fraxtal"
16 changes: 14 additions & 2 deletions ops/prod/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ variable "liquidation_sendgrid_api_key" {
variable "optimism_mainnet_rpcs" {
type = string
}
variable "lisk_mainnet_rpcs" {
type = string
}
variable "fraxtal_mainnet_rpcs" {
type = string
}

variable "liquidation_sendgrid_email_to" {
type = string
Expand All @@ -78,7 +84,6 @@ variable "uptime_liquidator_api" {
variable "uptime_pyth_updater_api" {
type = string
}
// ... existing variables ...

variable "task_definition_family_optimism" {
description = "Family name for the Optimism task definition"
Expand All @@ -94,8 +99,15 @@ variable "task_definition_family_mode" {
description = "Family name for the Mode task definition"
type = string
}
variable "task_definition_family_lisk" {
description = "Family name for the Lisk task definition"
type = string
}


variable "task_definition_family_fraxtal" {
description = "Family name for the Fraxtal task definition"
type = string
}


variable "ecr_repository_name" {
Expand Down

0 comments on commit 442f3c1

Please sign in to comment.