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¶
| Field | Type | Description |
|---|---|---|
adapter | address | MarketAdapter contract for this position (address(0) if EMPTY) |
entryPrice | uint256 | Price at which NO shares were acquired (e.g. 0.93e18 = $0.93). Set to 0 if written off. |
startTime | uint256 | Timestamp when the position was entered (accrual start) |
maturity | uint256 | Expected settlement timestamp of the prediction market |
allocatedAssets | uint256 | USDC originally deployed into this position |
status | enum | See status values below |
lastRebase | uint256 | Timestamp 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)andpositionMarketValue(i)to the respective aggregate NAVs - WRITTEN_OFF and EMPTY slots contribute
0to 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.