From 2cc6ae0e80e70f9d61b2a5a39cfaf2b579610108 Mon Sep 17 00:00:00 2001 From: itofarina Date: Thu, 1 Feb 2024 18:12:10 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20op-sepolia=20-=20new=20irm=20par?= =?UTF-8?q?ameters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- schema.graphql | 2 ++ src/Market.ts | 3 +++ views/protocol.js | 5 ++++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5bcc0cc..01d3282 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "version": "changeset version && npm install --package-lock-only && git commit --all --amend --no-edit", "prepare:mainnet": "cross-env NETWORK=mainnet mustache views/protocol.js subgraph.template.yaml > subgraph.yaml", "prepare:optimism": "cross-env NETWORK=optimism mustache views/protocol.js subgraph.template.yaml > subgraph.yaml", - "prepare:op-sepolia": "cross-env NETWORK=op-sepolia mustache views/protocol.js subgraph.template.yaml > subgraph.yaml", + "prepare:optimism-sepolia": "cross-env NETWORK=optimism-sepolia mustache views/protocol.js subgraph.template.yaml > subgraph.yaml", "postinstall": "run-s prepare:op-sepolia codegen" }, "engines": { diff --git a/schema.graphql b/schema.graphql index 451fb95..3e3a8b2 100644 --- a/schema.graphql +++ b/schema.graphql @@ -171,6 +171,8 @@ type InterestRateModelSet @entity { floatingCurveA: BigInt! floatingCurveB: BigInt! floatingMaxUtilization: BigInt! + minRate: BigInt! + naturalRate: BigInt! naturalUtilization: BigInt! sigmoidSpeed: BigInt! growthSpeed: BigInt! diff --git a/src/Market.ts b/src/Market.ts index 6e06bed..3917ed9 100644 --- a/src/Market.ts +++ b/src/Market.ts @@ -294,6 +294,9 @@ export function handleInterestRateModelSet(event: InterestRateModelSetEvent): vo entity.floatingCurveB = irm.floatingCurveB(); entity.floatingMaxUtilization = irm.floatingMaxUtilization(); + entity.minRate = irm.try_parameters().value.minRate; + entity.naturalRate = irm.try_parameters().value.naturalRate; + entity.naturalUtilization = orZero(irm.try_naturalUtilization()); entity.sigmoidSpeed = orZero(irm.try_sigmoidSpeed()); entity.growthSpeed = orZero(irm.try_growthSpeed()); diff --git a/views/protocol.js b/views/protocol.js index 3cf7325..7df6e62 100644 --- a/views/protocol.js +++ b/views/protocol.js @@ -4,7 +4,10 @@ const { existsSync, readdirSync, readFileSync } = require('fs'); const { NETWORK: network } = process.env; if (!network) throw new Error('network not set'); -const dir = `node_modules/@exactly/protocol/deployments/${network}/`; +const dir = `node_modules/@exactly/protocol/deployments/${{ + mainnet: 'ethereum', + 'optimism-sepolia': 'op-sepolia', +}[network] ?? network}/`; const deployments = readdirSync(dir).filter((file) => extname(file) === '.json'); /** @type {function(string): Deployment} */