From 1dd1cdcbb5ea5e7c5a9fe8c7691b6ade2eac596c Mon Sep 17 00:00:00 2001 From: frost ostrich Date: Wed, 31 Jan 2024 19:35:49 +1000 Subject: [PATCH] feat: update alchemi tlc endpoint & update to node 20 --- apps/automation-v2/.nvmrc | 2 +- apps/automation-v2/package.json | 4 ++-- apps/automation-v2/src/config/prodnets.ts | 2 +- apps/automation-v2/src/tlc/batch-liquidate.ts | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/automation-v2/.nvmrc b/apps/automation-v2/.nvmrc index 3f430af82..9a2a0e219 100644 --- a/apps/automation-v2/.nvmrc +++ b/apps/automation-v2/.nvmrc @@ -1 +1 @@ -v18 +v20 diff --git a/apps/automation-v2/package.json b/apps/automation-v2/package.json index dbd444ced..a96156569 100644 --- a/apps/automation-v2/package.json +++ b/apps/automation-v2/package.json @@ -1,5 +1,5 @@ { - "name": "temple-tasks", + "name": "@temple/tasks", "version": "0.0.1", "description": "temple automation tasks using overlord framework", "license": "AGPL-3.0-or-later", @@ -39,6 +39,6 @@ ] }, "engines": { - "node": "18.x" + "node": ">=20.0.0" } } diff --git a/apps/automation-v2/src/config/prodnets.ts b/apps/automation-v2/src/config/prodnets.ts index 9af4037a8..4517424a4 100644 --- a/apps/automation-v2/src/config/prodnets.ts +++ b/apps/automation-v2/src/config/prodnets.ts @@ -10,7 +10,7 @@ const TLC_BATCH_LIQUIDATE_CONFIG: TlcBatchLiquidateConfig = { MIN_ETH_BALANCE_WARNING: parseEther('0.1'), GAS_LIMIT: 1_000_000n, SUBGRAPH_URL: 'https://api.thegraph.com/subgraphs/name/medariox/v2-mainnet', - SUBGRAPH_ALCHEMY_URL: 'https://subgraph.satsuma-prod.com/a912521dd162/templedao/temple-v2-mainnet/version/v0.1.0/api', + SUBGRAPH_ALCHEMY_URL: 'https://subgraph.satsuma-prod.com/a912521dd162/templedao/temple-v2-mainnet/api', SUBGRAPH_RETRY_LIMIT: 3, }; diff --git a/apps/automation-v2/src/tlc/batch-liquidate.ts b/apps/automation-v2/src/tlc/batch-liquidate.ts index ce505c118..5fba0f67f 100644 --- a/apps/automation-v2/src/tlc/batch-liquidate.ts +++ b/apps/automation-v2/src/tlc/batch-liquidate.ts @@ -67,14 +67,14 @@ export async function batchLiquidate( let res: AxiosResponse | undefined = undefined; const randomUrlFirstAlchemyApi = Math.random() < 0.5; try { - // try subgraph call with thegraph api endpoint + // try first random subgraph api endpoint res = await getTlcUsers( ctx, randomUrlFirstAlchemyApi ? config.SUBGRAPH_ALCHEMY_URL : config.SUBGRAPH_URL, config.SUBGRAPH_RETRY_LIMIT ); } catch (e) { - // fallback subgraph call to try with alchemy api endpoint + // if first fails, try the second endpoint option res = await getTlcUsers( ctx, randomUrlFirstAlchemyApi ? config.SUBGRAPH_URL : config.SUBGRAPH_ALCHEMY_URL,