γŠ™οΈLiquidator's Guide

circle-info

Useful Contract Addresses

DegenBox : 0xDFD09C4A1Fd999F6e8518398216c53fcEa6f4020arrow-up-right

WBCHMarket : 0x3F562957b199d6362B378dBa5e3b45EE6fe77779arrow-up-right

LAWMarket : 0xd46e5a9Cd7A55Bf8d3582Ff66218aD3e63462506arrow-up-right

MasterContract : 0xA01d276d9e8D356AdaBAda8b60916489BD4f51a8

Approve Markets

Sample Code:

//
DegenBox.setMasterContractApproval(address(this), market.masterContract(), true, 0, 0, 0);

Deposing lawUSD(Optional if not use swapper)

Depending on the amount of debt to be liquidated, it is necessary to fund lawUSD in DegenBox.

Sample Code:

//need to approve first
lawUSD.approve(address(box), num);
box.deposit(lawUSD, address(this), address(this), num, 0);

Liquidation

circle-info

Current liquidation is only available to a limited number of addresses.

In general, you can use positionInfo to determine whether the user's position is ready for liquidation and to obtain the user's borrowpart.

If the collateral allows, the entire borrowpart of the user can be liquidated.

Once the user to be liquidated has been identified, the liquidate method can be called to perform the liquidation.

Note: If a swapper is not used, the collateral will go to the DegenBox of the "to" address.

Swapper

Swapper can convert collateral to lawUSD so that you can liquidate even if you don't have enough lawUSD.

An example of a Swapper:

https://github.com/Abracadabra-money/magic-internet-money/blob/main/contracts/swappers/SushiSwapSwapper.solarrow-up-right

Last updated