Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CfdEngineProtocolLens

Git Source

Inherits: ICfdEngineProtocolLens

Title: CfdEngineProtocolLens

Rich protocol-accounting lens for audits, tests, and HousePool integration.

Exposes conservative solvency and liability views rather than product-level summaries.

Constants

engineContract

CfdEngine public immutable engineContract;

Functions

constructor

constructor(
    address engine_
);

Parameters

NameTypeDescription
engine_addressDeployed CfdEngine instance to inspect.

getProtocolAccountingSnapshot

Returns the canonical protocol-accounting snapshot used by diagnostics and audits.

function getProtocolAccountingSnapshot()
    external
    view
    returns (ProtocolLensViewTypes.ProtocolAccountingSnapshot memory snapshot);

getHousePoolInputSnapshot

Builds the HousePool accounting snapshot against a caller-supplied freshness limit.

This packages the engine-side values HousePool needs for reconcile and withdrawal logic.

function getHousePoolInputSnapshot(
    uint256 markStalenessLimit
) external view returns (HousePoolEngineViewTypes.HousePoolInputSnapshot memory snapshot);

getHousePoolStatusSnapshot

Returns the current HousePool status flags sourced from engine runtime state.

function getHousePoolStatusSnapshot()
    external
    view
    returns (HousePoolEngineViewTypes.HousePoolStatusSnapshot memory snapshot);

_getVaultMtmLiability

function _getVaultMtmLiability() internal view returns (uint256);

_buildProtocolAccountingSnapshot

function _buildProtocolAccountingSnapshot()
    internal
    view
    returns (ProtocolLensViewTypes.ProtocolAccountingSnapshot memory snapshot);

_buildAdjustedSolvencyState

function _buildAdjustedSolvencyState() internal view returns (SolvencyAccountingLib.SolvencyState memory);

_sideState

function _sideState(
    CfdTypes.Side side
) internal view returns (ICfdEngine.SideState memory state);

_riskParams

function _riskParams() internal view returns (CfdTypes.RiskParams memory params);