Skip to content

Position Registry

The vault maintains an internal registry of up to four positions as a fixed-size array: Position[4]. Each position struct contains all data required for pricing and lifecycle management.

Position Struct

FieldTypeDescription
adapteraddressMarketAdapter contract for this position (address(0) if EMPTY)
entryPriceuint256Price at which NO shares were acquired (e.g. 0.93e18 = $0.93). Set to 0 if written off.
startTimeuint256Timestamp when the position was entered (accrual start)
maturityuint256Expected settlement timestamp of the prediction market
allocatedAssetsuint256USDC originally deployed into this position
statusenumSee status values below
lastRebaseuint256Timestamp of last rebase (0 if never rebased)

Position Status

Status Value Meaning
EMPTY 0 Slot is unoccupied and available for a new position
ACTIVE 1 Position is live and accruing modeled value linearly
SETTLING 2 Market has resolved; settlement claim is pending. Linear accrual stops — slot uses adapter.positionValue() for both modeled and market NAV. Gap contribution collapses to zero.
WRITTEN_OFF 3 Market resolved against vault; position is worth zero. Contributes 0 to all NAVs.

Slot Lifecycle

EMPTY        → ACTIVE        : openPosition()
ACTIVE       → SETTLING      : markSettling()          // mandatory before closePosition
SETTLING     → EMPTY         : closePosition()         // NO wins — USDC returned
ACTIVE       → WRITTEN_OFF   : writeOff()              // YES wins from ACTIVE
SETTLING     → WRITTEN_OFF   : writeOff()              // YES wins from SETTLING
WRITTEN_OFF  → EMPTY         : reclaimSlot()           // after market fully settled

Pricing From the Registry

The vault's pricing engine loops over all four slots:

  • ACTIVE slots contribute positionModeledValue(i) and positionMarketValue(i) to the respective aggregate NAVs
  • WRITTEN_OFF and EMPTY slots contribute 0 to both NAVs
  • SETTLING slots behave like ACTIVE until closePosition() is called

This means a write-off instantly reduces both aggregate modeled and market NAV by the full allocated amount of that slot.

Querying Position Data

The positionInfo(uint256 slot) view function returns the full Position struct for any slot index (0–3). This provides transparency into every active, settling, and written-off position.