Skip to content

Commit

Permalink
fix: save data for liquidated and liquidating state
Browse files Browse the repository at this point in the history
  • Loading branch information
frazarshad committed May 14, 2024
1 parent 1cb5e76 commit 479dbc6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/mappings/events/vaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ export const vaultsEventKit = (block: any, data: any, module: string, path: stri
const oraclPriceId = `${denom}-USD`;
const oraclePrice = await OraclePrice.get(oraclPriceId);

if (payload?.vaultState === 'liquidated') {
if (vaultManagerGovernance && vault.vaultManagerGovernance === undefined)
vault.vaultManagerGovernance = {
liquidationMarginNumerator: vaultManagerGovernance.liquidationMarginNumerator,
Expand All @@ -111,10 +110,9 @@ export const vaultsEventKit = (block: any, data: any, module: string, path: stri
typeInAmount: oraclePrice.typeInAmount,
typeOutAmount: oraclePrice.typeOutAmount,
};
}

vault.coin = denom;
vault.denom = denom;
vault.denom = denom;
vault.debt = payload?.debtSnapshot?.debt?.__value;
vault.balance = payload?.locked?.__value;
vault.lockedValue = payload?.locked?.__value;
Expand Down

0 comments on commit 479dbc6

Please sign in to comment.