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

CfdEngineSnapshotsLib

Git Source

Functions

buildFundingSnapshot

function buildFundingSnapshot(
    int256 bullFunding,
    int256 bearFunding,
    uint256 totalBullMargin,
    uint256 totalBearMargin
) internal pure returns (FundingSnapshot memory snapshot);

getWithdrawalReservedUsdc

function getWithdrawalReservedUsdc(
    uint256 maxLiability,
    uint256 protocolFees,
    uint256 fundingLiability
) internal pure returns (uint256 reservedUsdc);

Structs

FundingSnapshot

struct FundingSnapshot {
    int256 bullFunding;
    int256 bearFunding;
    int256 solvencyFunding;
    uint256 withdrawalFundingLiability;
}

SolvencySnapshot

struct SolvencySnapshot {
    uint256 physicalAssets;
    uint256 protocolFees;
    uint256 netPhysicalAssets;
    uint256 maxLiability;
    int256 solvencyFunding;
    uint256 effectiveSolvencyAssets;
}