Skip to content

Commit

Permalink
chore(liquidationVisibility): update LiquidationOutcome and expected …
Browse files Browse the repository at this point in the history
…auctionResult with new data fields

Ref: #35 and #36
  • Loading branch information
Jorge-Lopes committed Jun 21, 2024
1 parent cf6d836 commit 57acbf9
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions packages/boot/test/bootstrapTests/liquidation-visibility.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ export type LiquidationOutcome = {
reserve: {
allocations: Record<string, number>;
shortfall: number;
minted: number;
};
vaults: {
locked: number;
}[];
remaining: { collateral: number };
penalty: number;
};

const test = anyTest as TestFn<LiquidationTestContext>;
Expand Down Expand Up @@ -85,6 +88,7 @@ const outcome: LiquidationOutcome = {
STARS: 0.309852,
},
shortfall: 0,
minted: 0,
},
// The order in the setup preserved
vaults: [
Expand All @@ -98,6 +102,10 @@ const outcome: LiquidationOutcome = {
locked: 3.425146,
},
],
remaining: {
collateral: 0,
},
penalty: 0.30985,
};
//#endregion

Expand Down Expand Up @@ -256,17 +264,18 @@ const checkVisibility = async ({
collateralOffered: { value: scale6(setup.auction.start.collateral) },
istTarget: { value: scale6(setup.auction.start.debt) },
collateralForReserve: { value: scale6(outcome.reserve.allocations.ATOM) },
shortfallToReserve: { value: 0n },
shortfallToReserve: { value: scale6(outcome.reserve.shortfall) },
mintedProceeds: { value: scale6(setup.auction.start.debt) },
collateralSold: {
value:
scale6(setup.auction.start.collateral) -
scale6(setup.auction.end.collateral),
},
collateralRemaining: { value: 0n },
collateralRemaining: { value: scale6(outcome.remaining.collateral) },
debtToBurn: { value: scale6(setup.auction.start.debt) },
mintedForReserve: { value: 0n },
totalPenalty: { value: 309850n }, // => istTarget * (penaltyRate * setup.price.starting)
mintedForReserve: { value: scale6(outcome.reserve.minted) },
totalPenalty: { value: scale6(outcome.penalty) },
startTime: { absValue: startTime.absValue },
endTime: { absValue: endTime.absValue },
});

Expand Down

0 comments on commit 57acbf9

Please sign in to comment.