Skip to main content

ILiquidationSource

Git Source

Functions​

liquidatableBalanceOf​

Get the available amount of tokens that can be swapped.

function liquidatableBalanceOf(address tokenOut) external returns (uint256);

Parameters

NameTypeDescription
tokenOutaddressAddress of the token to get available balance for

Returns

NameTypeDescription
<none>uint256uint256 Available amount of token

transferTokensOut​

Transfers tokens to the receiver

function transferTokensOut(address sender, address receiver, address tokenOut, uint256 amountOut)
external
returns (bytes memory);

Parameters

NameTypeDescription
senderaddressAddress that triggered the liquidation
receiveraddressAddress of the account that will receive tokenOut
tokenOutaddressAddress of the token being bought
amountOutuint256Amount of token being bought

verifyTokensIn​

Verifies that tokens have been transferred in.

function verifyTokensIn(address tokenIn, uint256 amountIn, bytes calldata transferTokensOutData) external;

Parameters

NameTypeDescription
tokenInaddressAddress of the token being sold
amountInuint256Amount of token being sold
transferTokensOutDatabytesData returned by the corresponding transferTokensOut call

targetOf​

Get the address that will receive tokenIn.

function targetOf(address tokenIn) external returns (address);

Parameters

NameTypeDescription
tokenInaddressAddress of the token to get the target address for

Returns

NameTypeDescription
<none>addressaddress Address of the target

isLiquidationPair​

Checks if a liquidation pair can be used to liquidate the given tokenOut from this source.

function isLiquidationPair(address tokenOut, address liquidationPair) external returns (bool);

Parameters

NameTypeDescription
tokenOutaddressThe address of the token to liquidate
liquidationPairaddressThe address of the liquidation pair that is being checked

Returns

NameTypeDescription
<none>boolbool True if the liquidation pair can be used, false otherwise

Events​

LiquidationPairSet​

Emitted when a new liquidation pair is set for the given tokenOut.

event LiquidationPairSet(address indexed tokenOut, address indexed liquidationPair);

Parameters

NameTypeDescription
tokenOutaddressThe token being liquidated
liquidationPairaddressThe new liquidation pair for the token