Skip to content

Commit

Permalink
Merge pull request #957 from TempleDAO/fostrich-tlc-fix
Browse files Browse the repository at this point in the history
feat: update alchemi tlc endpoint & update to node 20
  • Loading branch information
frost-ostrich authored Feb 5, 2024
2 parents fff4302 + 1dd1cdc commit fe63e9a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/automation-v2/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18
v20
4 changes: 2 additions & 2 deletions apps/automation-v2/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -39,6 +39,6 @@
]
},
"engines": {
"node": "18.x"
"node": ">=20.0.0"
}
}
2 changes: 1 addition & 1 deletion apps/automation-v2/src/config/prodnets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down
4 changes: 2 additions & 2 deletions apps/automation-v2/src/tlc/batch-liquidate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ export async function batchLiquidate(
let res: AxiosResponse<GetUserResponse> | 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,
Expand Down

0 comments on commit fe63e9a

Please sign in to comment.