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

CloseAccountingLib

Git Source

Functions

buildCloseState

function buildCloseState(
    uint256 positionSize,
    uint256 positionMarginUsdc,
    uint256 entryPrice,
    uint256 maxProfitUsdc,
    int256 vpiAccrued,
    CfdTypes.Side side,
    uint256 sizeDelta,
    uint256 oraclePrice,
    uint256 capPrice,
    uint256 preSkewUsdc,
    uint256 postSkewUsdc,
    uint256 vaultDepthUsdc,
    uint256 vpiFactor,
    uint256 executionFeeBps,
    int256 fundingSettlementUsdc
) internal pure returns (CloseState memory state);

Structs

CloseState

struct CloseState {
    int256 realizedPnlUsdc;
    uint256 marginToFreeUsdc;
    uint256 remainingMarginUsdc;
    uint256 remainingSize;
    uint256 maxProfitReductionUsdc;
    int256 proportionalAccrualUsdc;
    int256 vpiDeltaUsdc;
    uint256 executionFeeUsdc;
    int256 netSettlementUsdc;
}