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

LiquidationAccountingLib

Git Source

Functions

buildLiquidationState

function buildLiquidationState(
    uint256 size,
    uint256 oraclePrice,
    uint256 reachableCollateralUsdc,
    int256 fundingUsdc,
    int256 pnlUsdc,
    uint256 maintMarginBps,
    uint256 minBountyUsdc,
    uint256 bountyBps,
    uint256 tokenScale
) internal pure returns (LiquidationState memory state);

settlementForState

function settlementForState(
    LiquidationState memory state
) internal pure returns (CfdEngineSettlementLib.LiquidationSettlementResult memory result);

Structs

LiquidationState

struct LiquidationState {
    int256 equityUsdc;
    uint256 reachableCollateralUsdc;
    uint256 maintenanceMarginUsdc;
    uint256 keeperBountyUsdc;
}