Skip to main content

ILiquidator.sol

ILiquidator​

Interface for the Chromatic Liquidator contract.

createLiquidationTask​

function createLiquidationTask(uint256 positionId) external

Creates a liquidation task for a given position.

  • Parameters:

    NameTypeDescription
    positionIduint256The ID of the position to be liquidated.

cancelLiquidationTask​

function cancelLiquidationTask(uint256 positionId) external

Cancels a liquidation task for a given position.

  • Parameters:

    NameTypeDescription
    positionIduint256The ID of the position for which to cancel the liquidation task.

resolveLiquidation​

function resolveLiquidation(address market, uint256 positionId, bytes extraData) external view returns (bool canExec, bytes execPayload)

Resolves the liquidation of a position.

This function is called by the automation system.

  • Parameters:

    NameTypeDescription
    marketaddressThe address of the market contract.
    positionIduint256The ID of the position to be liquidated.
    extraDatabytespassed by keeper for passing offchain data
  • Return Values:

    NameTypeDescription
    canExecboolWhether the liquidation can be executed.
    execPayloadbytesThe encoded function call to execute the liquidation.

liquidate​

function liquidate(address market, uint256 positionId) external

Liquidates a position in a market.

  • Parameters:

    NameTypeDescription
    marketaddressThe address of the market contract.
    positionIduint256The ID of the position to be liquidated.

createClaimPositionTask​

function createClaimPositionTask(uint256 positionId) external

Creates a claim position task for a given position.

  • Parameters:

    NameTypeDescription
    positionIduint256The ID of the position to be claimed.

cancelClaimPositionTask​

function cancelClaimPositionTask(uint256 positionId) external

Cancels a claim position task for a given position.

  • Parameters:

    NameTypeDescription
    positionIduint256The ID of the position for which to cancel the claim position task.

resolveClaimPosition​

function resolveClaimPosition(address market, uint256 positionId, bytes extraData) external view returns (bool canExec, bytes execPayload)

Resolves the claim of a position.

This function is called by the automation system.

  • Parameters:

    NameTypeDescription
    marketaddressThe address of the market contract.
    positionIduint256The ID of the position to be claimed.
    extraDatabytespassed by keeper for passing offchain data
  • Return Values:

    NameTypeDescription
    canExecboolWhether the claim can be executed.
    execPayloadbytesThe encoded function call to execute the claim.

claimPosition​

function claimPosition(address market, uint256 positionId) external

Claims a position in a market.

  • Parameters:

    NameTypeDescription
    marketaddressThe address of the market contract.
    positionIduint256The ID of the position to be claimed.

getLiquidationTaskId​

function getLiquidationTaskId(address market, uint256 positionId) external view returns (bytes32)

getClaimPositionTaskId​

function getClaimPositionTaskId(address market, uint256 positionId) external view returns (bytes32)