Skip to content

Commit

Permalink
feat: share one instance of liquidation across all vaultManagers (#2869)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-Hibbert authored Apr 21, 2021
1 parent 561de71 commit 0ae776a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/treasury/src/stablecoinMachine.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ export async function start(zcf) {
const collateralBrand = zcf.getBrandForIssuer(collateralIssuer);
assert(!collateralTypes.has(collateralBrand));

const { creatorFacet: liquidationFacet } = await E(zoe).startInstance(
liquidationInstall,
{ RUN: runIssuer },
{ autoswap: autoswapAPI },
);

async function addTypeHook(seat) {
assertProposalShape(seat, {
give: { Collateral: null },
Expand Down Expand Up @@ -194,14 +200,6 @@ export async function start(zcf) {
// TODO(hibbert): make use of these assets (Liquidity: 19899 Aeth)
trace('depositValue', depositValue);

const { creatorFacet: liquidationFacet } = await E(zoe).startInstance(
liquidationInstall,
{
RUN: runIssuer,
Collateral: collateralIssuer,
},
{ autoswap: autoswapAPI },
);
const liquidationStrategy = makeLiquidationStrategy(liquidationFacet);

// do something with the liquidity we just bought
Expand Down

0 comments on commit 0ae776a

Please sign in to comment.