From 34436be6b0e88f1ae76d020d1b5352fda09d2730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pr=C3=A9vost?= <998369+prevostc@users.noreply.github.com> Date: Sat, 16 Mar 2024 18:17:16 +0100 Subject: [PATCH] Configure clock tick --- .gitignore | 1 + config/arbitrum-one.json | 1 + config/optimism.json | 1 + package.json | 1 + subgraph.template.yaml | 28 +--------------------------- 5 files changed, 5 insertions(+), 27 deletions(-) diff --git a/.gitignore b/.gitignore index b29cb74..d770c87 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ node_modules **/tests/.*/ .vscode +subgraph.yaml \ No newline at end of file diff --git a/config/arbitrum-one.json b/config/arbitrum-one.json index bcad5cc..e204706 100644 --- a/config/arbitrum-one.json +++ b/config/arbitrum-one.json @@ -3,6 +3,7 @@ "vaultFactoryAddress": "0xef79A90A93084e1d2a2b4ecD1F783e937C80Ef4C", "vaultFactoryStartBlock": 190612486, + "clockTickBlocks": 3600, "wrappedNativeAddress": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1", "wrappedNativeDecimals": 18, diff --git a/config/optimism.json b/config/optimism.json index 4f69ee7..e22e97a 100644 --- a/config/optimism.json +++ b/config/optimism.json @@ -3,6 +3,7 @@ "vaultFactoryAddress": "0xf0C7eD247e22Bb0BaACA1F7975C8F02D79954198", "vaultFactoryStartBlock": 117428248, + "clockTickBlocks": 750, "wrappedNativeAddress": "0x4200000000000000000000000000000000000006", "wrappedNativeDecimals": 18, diff --git a/package.json b/package.json index f55a27e..ac0785d 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "private": true, "scripts": { "prepare": "husky install", + "postinstall": "yarn run --silent prepare:arbitrum-one && yarn run --silent codegen", "codegen": "rm -Rf generated && graph codegen", "build": "graph build", "format": "prettier . --write", diff --git a/subgraph.template.yaml b/subgraph.template.yaml index 7a44e65..fd59023 100644 --- a/subgraph.template.yaml +++ b/subgraph.template.yaml @@ -95,24 +95,11 @@ dataSources: - handler: handleClockTick filter: kind: polling - every: 3600 # trigger every ~15min with 1 block every 250ms + every: {{clockTickBlocks}} templates: - name: BeefyCLVault kind: ethereum/contract network: {{network}} - context: - wrappedNativeDecimals: - type: BigInt - data: "{{wrappedNativeDecimals}}" - uniswapV3QuoterV2Address: - type: Bytes - data: "{{uniswapV3QuoterV2Address}}" - chainlinkNativePriceFeedAddress: - type: Bytes - data: "{{chainlinkNativePriceFeedAddress}}" - chainlinkNativePriceFeedDecimals: - type: BigInt - data: "{{chainlinkNativePriceFeedDecimals}}" source: abi: BeefyVaultConcLiq mapping: @@ -155,19 +142,6 @@ templates: - name: BeefyCLStrategy kind: ethereum/contract network: {{network}} - context: - wrappedNativeDecimals: - type: BigInt - data: "{{wrappedNativeDecimals}}" - uniswapV3QuoterV2Address: - type: Bytes - data: "{{uniswapV3QuoterV2Address}}" - chainlinkNativePriceFeedAddress: - type: Bytes - data: "{{chainlinkNativePriceFeedAddress}}" - chainlinkNativePriceFeedDecimals: - type: BigInt - data: "{{chainlinkNativePriceFeedDecimals}}" source: abi: StrategyPassiveManagerUniswap mapping: