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

CfdEngineSettlementLib

Git Source

Functions

collectSettlementDeficit

function collectSettlementDeficit(
    uint256 availableUsdc,
    uint256 owedUsdc
) internal pure returns (DebtCollectionResult memory result);

closeSettlementResult

function closeSettlementResult(
    uint256 availableUsdc,
    uint256 owedUsdc,
    uint256 execFeeUsdc
) internal pure returns (CloseSettlementResult memory result);

closeSettlementResultForTerminalBuckets

function closeSettlementResultForTerminalBuckets(
    IMarginClearinghouse.AccountUsdcBuckets memory buckets,
    uint256 protectedLockedMarginUsdc,
    uint256 owedUsdc,
    uint256 execFeeUsdc
) internal pure returns (CloseSettlementResult memory result);

liquidationSettlementResult

function liquidationSettlementResult(
    uint256 accountBalanceUsdc,
    int256 residualUsdc
) internal pure returns (LiquidationSettlementResult memory result);

Structs

DebtCollectionResult

struct DebtCollectionResult {
    uint256 seizedUsdc;
    uint256 shortfallUsdc;
}

CloseSettlementResult

struct CloseSettlementResult {
    uint256 seizedUsdc;
    uint256 shortfallUsdc;
    uint256 collectedExecFeeUsdc;
    uint256 badDebtUsdc;
}

LiquidationSettlementResult

struct LiquidationSettlementResult {
    uint256 targetBalanceUsdc;
    uint256 seizedUsdc;
    uint256 payoutUsdc;
    uint256 badDebtUsdc;
}