Skip to content

State Variables

Configuration

Variable Type Description
asset IERC20 USDC token address. Set at deployment, never changed.
houseBuffer address HouseBuffer contract address. Fixed at construction — should be declared immutable.
governance address Governance multisig address. Controls role rotation (setKeeper, setOperator) and emergency functions (emergencyLiquidate, proposeGovernance).
pendingGovernance address Proposed new governance address. Set by proposeGovernance(). Accepted by the pending address calling acceptGovernance(). address(0) when no transfer is pending.
operator address Operator address. Controls all position management functions (openPosition, markSettling, closePosition, writeOff, rebasePosition, reclaimSlot). Hot-wallet role — multisig not required. Set by governance via setOperator(). Rotatable.
keeper address Permissioned keeper address. The only address authorised to call processWithdrawals. Separate from governance and operator. Set at construction (non-zero required). Rotatable by governance via setKeeper().

Vault Accounting

Variable Type Description
totalShares uint256 Total vault shares outstanding. Minted on deposit, burned on processed withdrawal.
idleReserve uint256 USDC held in vault for redemptions and redeployment. Increases on deposit and position settlement. Decreases on withdrawal payout and position entry.

Daily Window Tracking

Variable Type Description
redeemedToday uint256 Total asset value redeemed in the current day window. Resets when block.timestamp >= dayStart + 86400.
dayStart uint256 Timestamp marking the start of the current 86400-second redemption window. Set to block.timestamp on roll.

Withdrawal Queue

Variable Type Description
queue mapping(uint256 => Request) FIFO withdrawal request queue. Keyed by request ID.
requestStatus mapping(uint256 => RequestStatus) Per-request lifecycle status. Set by requestWithdraw, processWithdrawals, and cancelWithdraw. Used by getRequest to return typed errors for non-pending states.
nextRequestId uint256 Counter for the next available queue slot. Initialised to 1 at construction. Increments on every requestWithdraw().
nextProcessId uint256 Counter for the next queue slot to process. Initialised to 1 at construction. Increments as the keeper processes or skips requests.

RequestStatus Enum

enum RequestStatus { NONE, PENDING, PROCESSED, CANCELLED }
Value Set by Meaning
NONE (0) Request ID was never issued
PENDING (1) requestWithdraw Request is in the queue, awaiting processing
PROCESSED (2) processWithdrawals Request has been fulfilled and shares burned
CANCELLED (3) cancelWithdraw Request was cancelled by the owner

Request Struct

Fields listed in storage order.

struct Request {
    address owner;      // Address that called requestWithdraw.
                        // Only this address can call cancelWithdraw on this requestId.
    address receiver;   // Address that will receive USDC on processing.
    uint256 shares;     // Shares escrowed into the vault at request time.
                        // Held by vault until processed or cancelled.
    uint256 timestamp;  // Block timestamp when requestWithdraw was called.
                        // Recorded for ERC-7540 pendingRedeemRequest compliance.
}

Cancellation and deletion: cancelWithdraw calls delete queue[requestId] (zeroing all fields including shares) and sets requestStatus[requestId] = CANCELLED. processWithdrawals calls delete queue[nextProcessId] and sets requestStatus[nextProcessId] = PROCESSED. getRequest uses the requestStatus mapping to distinguish cancelled, processed, and never-issued states via typed errors — not by inspecting shares.

Position Registry

Variable Type Description
positions Position[4] Fixed-size array of four position structs. Indexed 0–3.

Position Struct

struct Position {
    address adapter;          // MarketAdapter contract (address(0) if EMPTY)
    uint256 entryPrice;       // NO share purchase price, e.g. 0.93e18. 0 if written off.
    uint256 startTime;        // Accrual start timestamp
    uint256 maturity;         // Expected settlement timestamp
    uint256 allocatedAssets;  // USDC deployed into this position
    Status  status;           // EMPTY | ACTIVE | SETTLING | WRITTEN_OFF
    uint256 lastRebase;       // Timestamp of last rebase; 0 if never
}

enum Status { EMPTY, ACTIVE, SETTLING, WRITTEN_OFF }

Constants

Constant Value Description
dailyCapBps 200 2% of TVL redeemable per day
liquidityFeeBps 50 0.5% flat fee on every redemption
reserveTargetBps 1500 15% of TVL maintained as idle USDC
MAX_POSITIONS 4 Fixed array size
REBASE_COOLDOWN 7 days Per-position rebase cooldown
PAUSE_GAP_BPS 1500 Aggregate gap threshold that triggers pause
MAX_TOPUP_BPS 1000 HouseBuffer can topup max 10% of its balance per call