Skip to content

Commit

Permalink
🔥 market: drop floatingUtilization field
Browse files Browse the repository at this point in the history
  • Loading branch information
itofarina committed Feb 5, 2024
1 parent 63bb0f0 commit 73d7c18
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 8 deletions.
2 changes: 0 additions & 2 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ type Market @entity {
floatingBackupBorrowed: BigInt!
earningsAccumulator: BigInt!
# FloatingDebtUpdate
floatingUtilization: BigInt
lastFloatingDebtUpdate: Int!
# InterestRateModelSet
interestRateModel: Bytes!
Expand Down Expand Up @@ -392,7 +391,6 @@ type MarketState @entity {
floatingDebt: BigInt
floatingBackupBorrowed: BigInt
earningsAccumulator: BigInt
floatingUtilization: BigInt
floatingCurveA: BigInt
floatingCurveB: BigInt
floatingMaxUtilization: BigInt
Expand Down
1 change: 0 additions & 1 deletion src/Market.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,6 @@ export function handleFloatingDebtUpdate(event: FloatingDebtUpdateEvent): void {
entity.save();

const market = loadMarket(entity.market, event);
market.floatingUtilization = entity.utilization;
market.lastFloatingDebtUpdate = entity.timestamp;
market.save();
saveMarketState(event, market);
Expand Down
4 changes: 0 additions & 4 deletions src/utils/loadMarket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ export default function loadMarket(market: Bytes, event: ethereum.Event): Market
entity.penaltyRate = mkt.penaltyRate();
entity.totalFloatingBorrowShares = mkt.totalFloatingBorrowShares();

entity.floatingUtilization = entity.floatingAssets > BigInt.zero()
? entity.floatingDebt.div(entity.floatingAssets)
: BigInt.zero();

const asset = ERC20.bind(mkt.asset());
entity.assetSymbol = asset.symbol();

Expand Down
1 change: 0 additions & 1 deletion src/utils/saveMarketState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export default function saveMarketState(event: ethereum.Event, market: Market):
marketState.floatingDebt = market.floatingDebt;
marketState.floatingBackupBorrowed = market.floatingBackupBorrowed;
marketState.earningsAccumulator = market.earningsAccumulator;
marketState.floatingUtilization = market.floatingUtilization;
marketState.floatingCurveA = market.floatingCurveA;
marketState.floatingCurveB = market.floatingCurveB;
marketState.floatingMaxUtilization = market.floatingMaxUtilization;
Expand Down

0 comments on commit 73d7c18

Please sign in to comment.