Skip to main content

Position

Tracks the full lifecycle of a trading position from open through close. Mutable — updated on increase, reduction, margin changes, and settlement.
Indexed fields: account, status, openTimestamp
There is no Tenor enum in the contracts — tenors are stored as uint32 seconds in a dynamic registry on Config. The subgraph mirrors this with tenorSeconds: BigInt! (e.g., 86400 for 1D, 2592000 for 1M). Use the string status field rather than enum ordinals when filtering positions.

Account

Tracks a trader’s margin account state and LP position. Mutable — updated on every collateral or position event.
The positions field is a reverse lookup derived from Position.account — it does not store position IDs directly.

PoolState

Singleton entity tracking the liquidity pool’s aggregate state. ID is always "pool".

OracleRound

Tracks forward price rounds published by the publisher. Append-only — to find the latest round for a fixing timestamp, query oracleRounds(orderBy: publishTime, orderDirection: desc, first: 200) and dedupe by fixingTimestamp client-side.
Indexed fields: fixingTimestamp, publishTime

FixingPrice

Immutable record of a settlement fixing price recorded from Pyth. One per (pairId, fixingTimestamp) combination.

ModeTransition

Immutable audit trail of every operating mode change.

ProtocolState

Singleton tracking current protocol mode and transition history. ID is always "protocol".

FeeEvent

Immutable record of fee collection events from SettlementEngine.

PositionReduction

Immutable record of each partial position reduction.

VaultEvent

Immutable record of LP deposit and withdrawal events.
Indexed fields: timestamp

PoolTransaction

Unified activity feed combining all position-related events into a single timeline. Immutable.
Indexed fields: timestamp

DailyStats

Daily aggregate analytics. Mutable — updated throughout each day.

TxFeeAccumulator

Per-transaction accumulator that lets the subgraph attribute trading and oracle fees collected through multiple events in the same tx to a single PoolTransaction row. Mutable.

TenorState

Per-tenor open-interest snapshot. Mutable — updated on every position open / increase / close that lands in this tenor.

BucketState

Per-(pair, maturity) cohort tracking the pool’s bucket-level exposure. The pool’s risk caps are enforced against Σ |bucketNetExposure| across active buckets, so this entity exposes the same shape the contract uses internally. Mutable.
Indexed fields: pairId, fixingTimestamp

Field Type Conventions

Query Examples

Common query patterns for each entity.

Pagination

Cursor-based pagination and filtering.

Types Reference

Solidity enum ordinals and struct definitions.