Skip to main content

ILiquidationPair

Git Source

Functions

source

The liquidation source that the pair is using.

The source executes the actual token swap, while the pair handles the pricing.

function source() external returns (ILiquidationSource);

tokenIn

Returns the token that is used to pay for auctions.

function tokenIn() external returns (address);

Returns

NameTypeDescription
<none>addressaddress of the token coming in

tokenOut

Returns the token that is being auctioned.

function tokenOut() external returns (address);

Returns

NameTypeDescription
<none>addressaddress of the token coming out

target

Get the address that will receive tokenIn.

function target() external returns (address);

Returns

NameTypeDescription
<none>addressAddress of the target

maxAmountOut

Gets the maximum amount of tokens that can be swapped out from the source.

function maxAmountOut() external returns (uint256);

Returns

NameTypeDescription
<none>uint256The maximum amount of tokens that can be swapped out.

swapExactAmountOut

Swaps the given amount of tokens out and ensures the amount of tokens in doesn't exceed the given maximum.

The amount of tokens being swapped in must be sent to the target before calling this function.

function swapExactAmountOut(address _receiver, uint256 _amountOut, uint256 _amountInMax, bytes calldata _flashSwapData)
external
returns (uint256);

Parameters

NameTypeDescription
_receiveraddressThe address to send the tokens to.
_amountOutuint256The amount of tokens to receive out.
_amountInMaxuint256The maximum amount of tokens to send in.
_flashSwapDatabytesIf non-zero, the _receiver is called with this data prior to

Returns

NameTypeDescription
<none>uint256The amount of tokens sent in.

computeExactAmountIn

Computes the exact amount of tokens to send in for the given amount of tokens to receive out.

function computeExactAmountIn(uint256 _amountOut) external returns (uint256);

Parameters

NameTypeDescription
_amountOutuint256The amount of tokens to receive out.

Returns

NameTypeDescription
<none>uint256The amount of tokens to send in.