Skip to content

Commit

Permalink
Maker sl triggered overview fix
Browse files Browse the repository at this point in the history
  • Loading branch information
piekczyk committed Sep 25, 2024
1 parent 752f8a5 commit 85b9ca9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion features/vaultHistory/mapMakerSubgraphHistoryOld.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { RiskRatio } from '@oasisdex/dma-library'
import BigNumber from 'bignumber.js'
import type {
MakerHistoryOldItem,
MakerHistoryOldLiquidationItem,
Expand Down Expand Up @@ -37,10 +39,16 @@ export const mapMakerSubgraphHistoryOld = (
}
: {}

// not all events have collRatioBefore
const beforeCollRatioDerivedFromMultiply = new RiskRatio(
new BigNumber(item.beforeMultiple || 1),
RiskRatio.TYPE.MULITPLE,
).colRatio.toString()

return {
...item,
timestamp: Number(item.timestamp) * 1000,
beforeCollateralizationRatio: item.collRatioBefore,
beforeCollateralizationRatio: item.collRatioBefore || beforeCollRatioDerivedFromMultiply,
collateralizationRatio: item.collRatioAfter,
multiple: item.afterMultiple,
beforeLiquidationPrice: item.liquidationPriceBefore,
Expand Down

0 comments on commit 85b9ca9

Please sign in to comment.