Skip to content

Commit

Permalink
fix(#patch): euler finance; fix market rate calculation & divide by 0 (
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimehgb authored Aug 26, 2022
1 parent 3160ac4 commit 07189a2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion deployment/deployment.json
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@
"euler": {
"ethereum": {
"template": "euler.template.yaml",
"deploy-on-merge": false
"deploy-on-merge": true
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion subgraphs/euler/src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Address, BigDecimal, BigInt } from "@graphprotocol/graph-ts";
export const PROTOCOL_NAME = "Euler";
export const PROTOCOL_SLUG = "euler";
export const PROTOCOL_SCHEMA_VERSION = "1.2.1";
export const PROTOCOL_SUBGRAPH_VERSION = "1.0.2";
export const PROTOCOL_SUBGRAPH_VERSION = "1.0.3";
export const PROTOCOL_METHODOLOGY_VERSION = "1.0.0";

////////////////////////
Expand Down
6 changes: 3 additions & 3 deletions subgraphs/euler/src/mappings/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,10 @@ export function syncWithEulerGeneralView(

market.outputTokenPriceUSD = eTokenPriceUSD;
market.outputTokenSupply = eTokenTotalSupply;
market.exchangeRate = eTokenTotalSupply
market.exchangeRate = eulerViewMarket.totalBalances
.toBigDecimal()
.div(eTokenPrecision)
.div(eulerViewMarket.totalBalances.toBigDecimal().div(tokenPrecision));
.div(tokenPrecision)
.div(eTokenTotalSupply.toBigDecimal().div(eTokenPrecision));
}
}

Expand Down

0 comments on commit 07189a2

Please sign in to comment.