Liquidators make sure all borrows are always covered
Liquidation means transferring part of both debt and collateral(+premium) from the account with negative health to the caller.
Only users with negative health can be liquidated.
To find out if account fall under liquidation or not, one may query liquidator-entry-point(
The following snippet queries any waves node on the status of
3PMZCTZjdsVZe2hePquBpE4LCVuZ5JA2PvK(the argument of
curl -X 'POST' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
The output would be similar to:
The important line is #4: it returns
bpmeans "borrow power" -
bpumeans "borrow power used"
account_health = (bp - bpu) / bp
bp<bpu, the account falls under liquidation.
To liquidate, one need to call
transferDebtfunction in liquidator-entry-point
There're 4 parameters in
borrowReserve: the reserve address with debt,
collateralReserve: the reserve address with collateral,
borrower: address of the borrower with negative health,
liquidateDebtAmount: an amount of debt to be liquidated;
Up to 50% of debt can be liquidated within 1 transaction.
The caller needs to maintain positive health after this operation.