Skip to main content

IMarketSettlement.sol

IMarketSettlement

Interface for the Market settlement task contract.

createSettlementTask

function createSettlementTask(address market) external

Creates a settlement task for a given market.

  • Parameters:

    NameTypeDescription
    marketaddressThe address of the chromatic market contract to be settled.

cancelSettlementTask

function cancelSettlementTask(address market) external

Cancels a settlement task for a given market.

  • Parameters:

    NameTypeDescription
    marketaddressThe address of the chromatic market contract for which to cancel the settlement task.

resolveSettlement

function resolveSettlement(address market, bytes extraData) external view returns (bool canExec, bytes execPayload)

Resolves the settlement of a market.

This function is called by the automation system.

  • Parameters:

    NameTypeDescription
    marketaddressThe address of the market contract.
    extraDatabytespassed by keeper for passing offchain data
  • Return Values:

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

settle

function settle(address market) external

Settles a market.

  • Parameters:

    NameTypeDescription
    marketaddressThe address of the market contract.

updatePrice

function updatePrice(address market, bytes extraData) external

Updates the price using off-chain data.

  • Parameters:

    NameTypeDescription
    marketaddressThe address of the market contract.
    extraDatabytespassed by keeper for passing offchain data

withdraw

function withdraw(address recipient, uint256 amount) external

Withdraws a specified amount of funds from the contract to a recipient address.

  • Parameters:

    NameTypeDescription
    recipientaddressThe address that will receive the withdrawn funds.
    amountuint256The amount of funds to be withdrawn.