Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.parquet.exchange/llms.txt

Use this file to discover all available pages before exploring further.

B

Bad debt

A position whose loss exceeds posted collateral after a liquidation closes. Because Parquet v4 enforces PnL-aware health and uses the payout queue to throttle profitable closes when free liquidity is short, bad debt is rare but possible during extreme price moves. Any shortfall is absorbed by the LP pool rather than socialised across winners — the protocol does not auto-deleverage profitable counterparties to plug holes. See: /trade/payout-queue

Borrowing fee

A continuous rate charged on the notional value of an open position, accruing per second since last_borrowing_ts. The fee compensates LPs for the risk of holding the other side of the trade. It is debited from a position’s collateral on every interaction (open, modify, close, liquidation check) and is one of the components that turns posted collateral into effective equity. See: /trade/liquidations

C

Collateral

USDC posted by a trader against an open position. Collateral is held in a market vault PDA owned by engine_auth. It is debited by realised losses, funding payments, and borrowing fees, and credited by realised profits when a close clears the payout queue.

Confidence (oracle)

The published uncertainty band around an oracle price update, in price units. Parquet rejects price reads whose confidence exceeds configured thresholds, blocking opens and liquidations until the feed quality recovers. The indexer surfaces the confidence value alongside the mantissa so frontend clients can render a “stale or unsure” badge. See: /network/api

E

Effective equity

A position’s collateral plus unrealised PnL minus accrued funding and borrowing fees, all evaluated against the current oracle mark. Liquidation is triggered when effective equity divided by notional falls below MMR. Because v4 includes unrealised PnL in the health calculation, a profitable position cannot be liquidated by an adverse fee accrual alone. See: /trade/liquidations

Emission schedule

The fixed per-second token emission curve that pays stakers in the staking program. Emissions are split across multiple staking pools by weight, and unclaimed rewards accumulate in each pool’s reward vault until a staker calls claim or claim_and_restake. See: /earn/staking-emissions

Engine auth

A single program-derived address (["engine_auth"] under perp_engine) that owns every per-market vault and signs all CPI calls into pool_program, oracle_adapter, and fee_distributor. Centralising authority on one PDA means USDC custody, oracle reads, and fee splits all live behind the same on-chain signer. Source: programs/perp-engine/src/state/

F

Free liquidity

The portion of the LP pool that is currently available to pay realised profits, defined as pool_liquidity - reserved_liquidity. When a trader closes a winning position, the engine first checks free liquidity; if insufficient, the close is enqueued onto the payout queue rather than executed immediately. See: /earn/lp-payout-queue

Funding rate

A market-specific rate that transfers value between long and short sides based on the running open-interest imbalance. Funding accrues continuously on every position and is settled into collateral on the next interaction. The sign and magnitude are derived from the side bucket skew, not from an off-chain index. See: /trade/liquidations

L

Liquidation

The forced close of a position whose effective equity has fallen below MMR × notional. Liquidations are permissionless — any signer can call the instruction, and the keeper service races to be first. The liquidator receives a fixed share of the residual collateral; the rest flows back to the LP pool. See: /trade/liquidations

LP fee share

The fraction of trading-fee revenue that is paid to LPs, configured by LP_FEE_BPS (currently 80% — 8000 bps). The remainder is split between the staking emission contract and the protocol treasury via fee_distributor. See: /earn/staking-emissions

M

Mark price (vs index)

The price at which positions are opened, closed, and marked for PnL. The indexer computes mark = oracle * (1 + skew_ratio * impact_factor), where skew_ratio is the side-bucket imbalance and impact_factor is per-market. The index price is the raw oracle output before the skew adjustment. See: /network/api

Market state

The per-market account that stores side buckets, funding accumulators, reserved liquidity, the payout queue head and tail, and configuration such as MMR and max leverage. There is one MarketState PDA per supported symbol. Source: programs/perp-engine/src/state/market.rs

Max leverage

The largest position-size-to-collateral ratio the engine will accept on open. Currently capped at 250× across all markets; markets can lower their cap individually via update_market_config but cannot raise it above the u8 program ceiling. The initial-margin requirement at the cap is 1 / max_leverage = 40 bps (0.4%).

MMR (maintenance margin ratio)

The minimum ratio of effective equity to notional that a position must maintain to avoid liquidation. Set globally at MMR_BPS = 20 (0.2%). Falling below this threshold is necessary and sufficient for a permissionless liquidation to succeed. At the 250× max-leverage cap this leaves a 20-bps cushion between initial and maintenance margin — small. Most positions should use much lower leverage. See: /trade/liquidations

O

Open interest (OI)

The total notional value of all open positions on a market, tracked separately for long and short sides. Per-market OI caps prevent any single market from accumulating more directional exposure than the LP pool can safely back. See: /network/api

Oracle

The price-feed subsystem comprising the oracle_adapter program, per-market PriceFeed PDAs, and the off-chain price-pusher service. The pusher subscribes to Alpaca (trades + quotes, IEX feed on the free tier) and Finnhub (trades) over WebSocket, aggregates with minSources: 1, trustedSource: "alpaca", and pushes deviation-gated updates to the chain every second during RTH. Every trader-facing instruction in perp_engine reads price via CPI into oracle_adapter, never by deserialising the feed directly. The on-chain maxDeviationBps circuit breaker is disabled (set to 0) — bad-data rejection happens in the off-chain aggregator. Source: programs/oracle-adapter/src/lib.rs

Order PDA

A program-derived address holding a pending limit or stop order until the keeper triggers it. Order PDAs are seeded by (owner, market_id, client_id) so a trader can deterministically address their own orders without on-chain enumeration. Source: programs/perp-engine/src/state/order.rs

P

Payout queue

The FIFO data structure introduced in v4 that holds winning closes when free liquidity is insufficient. Each entry records the trader, the owed amount, and a sequence number. New deposits and losing closes increase free liquidity, which is then drained against the queue head in order. The queue replaces the older socialized-loss claw-back design that some perpetual systems use, with a deterministic position-in-line model instead. See: /trade/payout-queue

PayoutQueueEntry

The on-chain record for a single queued payout. Fields include owner, amount, enqueued_ts, and a voided flag. Entries live in a per-market ring buffer addressable by (market_id, seq) so the keeper can claim them in order. See: /earn/lp-payout-queue

Phantom credit

Collateral that has been credited to a closing trader’s position record but not yet paid out from the vault because the payout sits behind a queue entry. The position is closed for risk purposes (no funding, no liquidation exposure) while the trader waits for the queue to drain. Once paid, the phantom credit is settled and the entry retired. See: /trade/payout-queue

Position

The per-trader, per-market account holding side, size, entry price, collateral, last funding index, and last_borrowing_ts. Positions are PDAs seeded by (owner, market_id), so each trader has at most one position per market.

PriceFeed PDA

The on-chain account written by price-pusher and read by oracle_adapter. The byte layout is fixed at 4365 bytes total, with the fields the engine cares about packed at known offsets:
[mantissa: i128 @ 4337][scale: u32 @ 4353][ts: i64 @ 4357]
Tests verify these offsets by reading raw account bytes, not via Anchor deserialisation. Source: programs/price-feed/src/state.rs

R

Regular Trading Hours (RTH)

US equities market open window: Mon–Fri 09:30–16:00 ET, minus US market holidays and early-close days. Parquet’s off-chain price-pusher only subscribes to Alpaca and Finnhub during RTH, so the on-chain PriceFeed PDA goes stale outside this window and oracle_adapter returns PriceStale (6000) to every CPI from perp_engine and pool_program. Effectively, the exchange is open only during RTH; existing positions carry across the halt but cannot be opened, modified, or liquidated. See: /trade/liquidations, /network/api#get-market-hours

Referrer

An optional pubkey recorded on a position at open time. Referrer accounts receive a share of trading fees on every interaction with the position, distributed by fee_distributor. The referrer field is immutable once set.

Reserved liquidity

LP-pool capital earmarked to cover currently open winning positions’ unrealised profit. Reserved liquidity is bumped on every interaction that increases potential payouts and is one of the two inputs (alongside total pool liquidity) that determine free liquidity. See: /earn/lp-payout-queue

Reserve factor

A multiplier applied to the unrealised profit of open positions when computing reserved liquidity. A factor above 1.0 buffers the pool against rapid price moves between liquidity checkpoints. See: /earn/lp-payout-queue

S

Side bucket

A pair of per-market accumulators tracking aggregate long size and aggregate short size, denominated in base-asset units. The bucket imbalance drives both the funding rate and the mark-price skew adjustment; together they make up the v4 risk model. See: /trade/payout-queue

Slippage

The difference between the expected fill price (the mark at the time the client signs) and the actual fill price (the mark at the time the engine settles). Traders pass a max_slippage_bps argument; the engine aborts the fill if the realised slippage exceeds it.

Staking pool

One of several reward pools maintained by the staking program. Each pool has its own stake mint, reward vault, emission weight, and per-second drip rate. Stakers can hold positions in multiple pools simultaneously. See: /earn/staking-emissions

V

Vault

A USDC token account owned by engine_auth that holds all trader collateral for a specific market. There is one vault PDA per market, and only engine_auth can sign transfers out of it via CPI through the SPL token program. Source: programs/perp-engine/src/state/vault.rs

Voided entry

A PayoutQueueEntry whose voided flag has been set — typically because the underlying position was liquidated, modified, or otherwise resolved before the payout reached the queue head. Voided entries are skipped during drain without paying out, but still consume their slot in sequence order until the head pointer passes them. See: /earn/lp-payout-queue