Skip to content

Commit

Permalink
🚧 op-sepolia - new irm parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
itofarina committed Feb 1, 2024
1 parent 8e0bf43 commit 2cc6ae0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 2 additions & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ type InterestRateModelSet @entity {
floatingCurveA: BigInt!
floatingCurveB: BigInt!
floatingMaxUtilization: BigInt!
minRate: BigInt!
naturalRate: BigInt!
naturalUtilization: BigInt!
sigmoidSpeed: BigInt!
growthSpeed: BigInt!
Expand Down
3 changes: 3 additions & 0 deletions src/Market.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
5 changes: 4 additions & 1 deletion views/protocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -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} */
Expand Down

0 comments on commit 2cc6ae0

Please sign in to comment.