liquidate
params of liquidateParams -> (list(op), storage upd)
The liquidation process occurs when another user repays part of the outstanding amount of the borrower and thus purchases his collateral at a discount. To do this, user call liquidate method.
The yToken
contract expects that underlying token infos of collateralToken
and all borrowed by borrower
before tokenId
s are updated by calling PriceFeed.getPrice and updateInterest in the same block before this contract method
Types
Parameter | Type | Description |
---|---|---|
borrowToken | nat | yToken identifier of borrow token market |
collateralToken | nat | yToken identifier of collateral token market |
borrower | address | address of borrower to liquidate |
amount | nat | amount of yTokens borrow to pay with max amount is less or equal |
Usage
Errors
yToken/borrower-cannot-be-liquidator
- borrower can't be liquidatoryToken/liquidation-not-achieved
- this debt is not in "liquidation" case.yToken/debt-is-zero
- user's debt is zero.yToken/too-much-repay
- too many tokens sent to repay.underflow/borrowerAccount.borrow
- not enoughborrow
of borrower to liquidate withamount
wanted by user.underflow/totalBorrowsF
- total borrows less thanamount
.yToken/no-such-collateral
-borrower
doesn't has collateral in token withcollateralToken
yToken/seize/not-enough-tokens
- seize tokens greater than borrower balance.token/cant-get-contract-token
- FA12 token contract address does not containtransfer
entrypoint from FA12 interface.token/cant-get-contract-fa2-token
- FA2 token contract address does not containtransfer
entrypoint from FA2 interface.underflow/liquidity - reserves
- liquidity more than reserves.yToken/amount-is-zero
- passed zeroamount
.ceil-div-error
- division of two numbers fails.yToken/need-update
- token price and interest not updated (see warning above)yToken/borrow-id-undefined
- borrow token identifier is not assigned to any known yTokens.yToken/collateral-id-undefined
- collateral token identifier is not assigned to any known yTokens.
Last updated