Skip to content

PerpOrderBook functions

← Browse all contracts

Perp active order book. Router-deployed ERC-1967/UUPS proxy; atomically initialized.

This page lists every ABI-exposed function: 30 total, comprising 3 user functions, 13 state-changing, and 17 read-only calls.

User functions are state-changing calls expected from wallets, SDKs, traders, market makers, builders, or relayers. Internal settlement, deployment, governance, keeper, proxy, and maintenance calls remain available under the other filters.

About public and external visibility

The ABI proves that every function below is externally callable. It does not retain whether Solidity declared an individual function public or external, so the page does not invent a per-function visibility label.

Showing all 30 functions

State-changing functions

These payable and nonpayable calls can change protocol or contract state. Check the caller, requirements, effects, events, and errors before integrating one.

batch(uint40,(uint8,bytes32,address,uint32),(uint8,uint96,uint32,uint8,uint8,uint32,bool)[],uint8[])

state-changing user function ABI callable trader/integrator 0xe75ef3bc

Executes cancellations followed by the supplied native orders in one atomic action.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • config — struct IPerpOrderBook.OrderActionConfig. Structured struct IPerpOrderBook.OrderActionConfig; field-level units are defined in the type catalog and tuple metadata.
  • orders — struct IPerpOrderBook.NativeOrder[]. Array in ABI order; each element: Structured struct IPerpOrderBook.NativeOrder[]; field-level units are defined in the type catalog and tuple metadata.
  • cancelSlotIndices — uint8[]. Array in ABI order; each element: Maker slot index/count; live order slots are 0..61 and higher reserved values are not user slots.

Returns

  • No return value.

Access and behavior

  • Who can call: Account owner or signer with trade permission.
  • Requirements: Book not hard-paused; risk-increasing orders/fills require ACTIVE Engine/book state; account mode, order, tick/notional/TIF, reduce-only and Engine admission constraints.
  • State effects: Cancels slots, matches orders, places residual GTC liquidity, then sends one consolidated exposure/fill action to AccountCore/Engine.
  • Units and rounding: Quantity base lots; price market units; quote lots derived by market scales; maker fee pps captured per order.
  • Event families: Possible first-use MakerRegistered occurs before accounting. All state-touched Engine logs (PerpPositionModeUpdated, PerpCrossPositionSlotUpdated/PerpIsolatedPositionUpdated, PerpMarginUpdated, PerpMakerFeeReserveUpdated, PerpOrderExposureUpdated, maker-then-taker PerpFillSettled) and then AccountCore fee/accrual/collector/builder logs occur before final TradesPacked, which precedes final BookUpdatesPacked.
  • Expected errors: Market/auth/account, mode/liquidation, slot/order, tick/price/size/notional/TIF, reduce-only/OI/health, balance/reserve, queue/tree/reentrancy errors.

Exact call data

batch(uint40,(uint8,bytes32,address,uint32),(uint8,uint96,uint32,uint8,uint8,uint32,bool)[],uint8[])
  • Selector: 0xe75ef3bc
  • Mutability: nonpayable
  • Semantic rule: perp-book.batch
  • Call path: trader/integrator

cancelAllForLiquidation(uint40)

state-changing ABI callable perp-engine 0x6afbddf3

Removes every resting order for one account in this market and returns its release journal.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.

Returns

  • orderChanges — struct IPerpEngine.PerpOrderExposureDelta[]. Array in ABI order; each element: Structured struct IPerpEngine.PerpOrderExposureDelta[]; field-level units are defined in the type catalog and tuple metadata.

Access and behavior

  • Who can call: The configured PerpEngine only.
  • Requirements: Engine caller identity; target account may be locked; available even when hard-paused.
  • State effects: Cancels every live target slot and returns exposure/reserve deltas to the Engine liquidation flow.
  • Units and rounding: All 62 slots; base lots and quote maker reserve.
  • Event families: This book emits BookUpdatesPacked first; the outer Engine then emits, per returned cancellation, conditional PerpMarginUpdated, PerpMakerFeeReserveUpdated, and PerpOrderExposureUpdated in that order.
  • Expected errors: Unauthorized Engine, account/slot/reserve consistency, and reentrancy errors.

Exact call data

cancelAllForLiquidation(uint40)
  • Selector: 0x6afbddf3
  • Mutability: nonpayable
  • Semantic rule: perp-book.liquidation-cancel
  • Call path: perp-engine

cancelAllOrders(uint40,bytes32)

state-changing user function ABI callable trader 0x6a2aba5e

Cancels all 62 slots and sends exposure/maker-fee-reserve releases to AccountCore/Engine.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • clientOrderId — bytes32. Opaque 32-byte client correlation identifier; zero means no client correlation.

Returns

  • No return value.

Access and behavior

  • Who can call: Account owner or signer with trade permission.
  • Requirements: Blocked only by HARD_PAUSED; registered account.
  • State effects: Cancels all 62 slots and sends exposure/maker-fee-reserve releases to AccountCore/Engine.
  • Units and rounding: Base lots and raw quote reserve; exact slot scan.
  • Event families: In log order: possible first-use MakerRegistered; per cancellation conditional Engine PerpMarginUpdated, then PerpMakerFeeReserveUpdated, then PerpOrderExposureUpdated; final BookUpdatesPacked when any slot changed.
  • Expected errors: Market/auth/account, slot/state consistency, routed AccountCore/Engine, and reentrancy errors.

Exact call data

cancelAllOrders(uint40,bytes32)
  • Selector: 0x6a2aba5e
  • Mutability: nonpayable
  • Semantic rule: perp-book.user-cancel
  • Call path: trader

executeLiquidation(uint40,bool,uint96,uint32)

state-changing ABI callable perp-engine 0xf058c5fe

Executes a reduce-only IOC for a liquidating account against normal FIFO liquidity.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • isBuy — bool. Boolean flag named isBuy.
  • maxBaseLots — uint96. Integer base-size lots; human base quantity = value / market sizePrecision.
  • limitPrice — uint32. Integer market price units; human quote/base price = value / market pricePrecision; order prices must be tick aligned where required.

Returns

  • makerFills — struct IPerpEngine.PerpMakerFill[]. Array in ABI order; each element: Structured struct IPerpEngine.PerpMakerFill[]; field-level units are defined in the type catalog and tuple metadata.

Access and behavior

  • Who can call: The configured PerpEngine only.
  • Requirements: Book not hard-paused; nonzero lot cap; nonzero/non-max tick-aligned limit; sufficient opposite FIFO liquidity.
  • State effects: Executes a reduce-only IOC for the locked target and returns maker fills for Engine settlement.
  • Units and rounding: maxBaseLots base lots; limitPrice market price units.
  • Event families: In log order: OrderBook TradesPacked, then BookUpdatesPacked; Engine maker/target PerpFillSettled plus touched margin/position logs and conditional PerpLiquidationCleared; AccountCore conditional PerpProtocolFeesAccrued, collector SpotReserveUpdated, PerpFeeCharged; final PerpPositionLiquidated.
  • Expected errors: Unauthorized Engine, hard pause, zero amount, price/tick, liquidity/queue consistency, reentrancy errors.

Exact call data

executeLiquidation(uint40,bool,uint96,uint32)
  • Selector: 0xf058c5fe
  • Mutability: nonpayable
  • Semantic rule: perp-book.liquidation-execute
  • Call path: perp-engine

initialize(address,address,address,uint32,uint96,uint96)

state-changing ABI callable proxy-initialization 0xefd52dca

Initializes packed owner/active-book parameters from the Engine and stores AccountCore, Engine quote scale, and market ID.

Parameters and behavior

Inputs

  • owner_ — address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.
  • accountCore_ — address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.
  • perpEngine_ — address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.
  • marketId_ — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.
  • minQuoteNotional_ — uint96. Raw atomic units of the applicable quote/token asset; human amount = value / that asset's decimal scale.
  • maxQuoteNotional_ — uint96. Raw atomic units of the applicable quote/token asset; human amount = value / that asset's decimal scale.

Returns

  • No return value.

Access and behavior

  • Who can call: Any caller only while the proxy is uninitialized; PerpRouter must initialize atomically at deployment.
  • Requirements: Nonzero owner/AccountCore/Engine; Engine must point to AccountCore and contain marketId; Engine market precisions/tick nonzero; valid min/max notionals; initializer guard.
  • State effects: Initializes packed owner/active-book parameters from the Engine and stores AccountCore, Engine quote scale, and market ID.
  • Units and rounding: Market ID exact; notionals raw quote; scales/precisions copied as integers; addresses exact.
  • Event families: Initialized; packed owner initialization emits no OwnershipTransferred event.
  • Expected errors: AlreadyInitialized, ZeroAddress, InvalidMarketConfig, MarketNotFound, MarketSizeError, tick/precision errors.

Exact call data

initialize(address,address,address,uint32,uint96,uint96)
  • Selector: 0xefd52dca
  • Mutability: nonpayable
  • Semantic rule: lifecycle.initialize
  • Call path: proxy-initialization

primeMakerPage(uint40,uint8)

state-changing ABI callable trader-maintenance 0x1f386456

Pre-initializes up to slotsToPrime maker slots; it places no order and changes no margin/exposure.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • slotsToPrime — uint8. Maker slot index/count; live order slots are 0..61 and higher reserved values are not user slots.

Returns

  • primedCount — uint8. Unitless integer count or zero-based index, as named.

Access and behavior

  • Who can call: Account owner or live signer with trade permission for accountId.
  • Requirements: Account access and requested slot count must fit maker-page capacity.
  • State effects: Pre-initializes up to slotsToPrime maker slots; it places no order and changes no margin/exposure.
  • Units and rounding: Account ID is uint40; requested and primed slots are integer counts.
  • Event families: Possible first-use MakerRegistered, then MakerPagePrimed with account ID and actual primed count.
  • Expected errors: Authorization/account and slot-capacity/storage errors.

Exact call data

primeMakerPage(uint40,uint8)
  • Selector: 0x1f386456
  • Mutability: nonpayable
  • Semantic rule: perp-book.prime.prime-maker-page
  • Call path: trader-maintenance

primeQueuePages(uint32,uint8,uint8)

state-changing ABI callable permissionless-maintenance 0x67631e16

Pre-initializes Perp price-queue pages around one center tick; it places no order and changes no margin/exposure.

Parameters and behavior

Inputs

  • centerPrice — uint32. Integer market price units; human quote/base price = value / market pricePrecision; order prices must be tick aligned where required.
  • groupsAround — uint8. Unitless integer count or zero-based index, as named.
  • wordsPerGroup — uint8. Unitless integer count or zero-based index, as named.

Returns

  • pagesPrimed — uint16. Unitless integer count or zero-based index, as named.
  • wordsPrimed — uint32. Unitless integer count or zero-based index, as named.

Access and behavior

  • Who can call: Any caller.
  • Requirements: Center price must be tick aligned; group/word ranges must remain within queue page bounds.
  • State effects: Pre-initializes Perp price-queue pages around one center tick; it places no order and changes no margin/exposure.
  • Units and rounding: Center is market price units; groups, words, pages, and results are integer counts.
  • Event families: QueuePagesPrimed with caller, request, and actual page/word counts.
  • Expected errors: PriceError, TickSizeError, range/size/storage errors.

Exact call data

primeQueuePages(uint32,uint8,uint8)
  • Selector: 0x67631e16
  • Mutability: nonpayable
  • Semantic rule: perp-book.prime.prime-queue-pages
  • Call path: permissionless-maintenance

protocolCancelBySlots(uint40,uint8[],bytes32)

state-changing ABI callable emergency/ops/governance 0xa0f7a922

Cancels selected slots and sends exposure/reserve release deltas to AccountCore/Engine.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • slotIndices — uint8[]. Array in ABI order; each element: Maker slot index/count; live order slots are 0..61 and higher reserved values are not user slots.
  • clientOrderId — bytes32. Opaque 32-byte client correlation identifier; zero means no client correlation.

Returns

  • No return value.

Access and behavior

  • Who can call: Emergency, ops, or governance role.
  • Requirements: Existing account ID and valid slots; available in any book state.
  • State effects: Cancels selected slots and sends exposure/reserve release deltas to AccountCore/Engine.
  • Units and rounding: Slot indices 0..61; base lots/quote reserve exact.
  • Event families: In log order: per cancellation conditional Engine PerpMarginUpdated, then PerpMakerFeeReserveUpdated, then PerpOrderExposureUpdated; final BookUpdatesPacked when any slot changed.
  • Expected errors: Authorization/authority, account/slot/state consistency, routed Engine, reentrancy errors.

Exact call data

protocolCancelBySlots(uint40,uint8[],bytes32)
  • Selector: 0xa0f7a922
  • Mutability: nonpayable
  • Semantic rule: perp-book.protocol-cancel
  • Call path: emergency/ops/governance

replaceBySlotPacked(uint40,(uint8,bytes32,address,uint32),bytes)

state-changing user function ABI callable market-maker/integrator 0x75b2e5ef

Atomically cancels/replaces slots, assigns fresh order IDs/FIFO tail, matches crossing orders, and consolidates exposure/fills to AccountCore.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • config — struct IPerpOrderBook.OrderActionConfig. Structured struct IPerpOrderBook.OrderActionConfig; field-level units are defined in the type catalog and tuple metadata.
  • packedOperations — bytes. Opaque ABI or protocol-packed bytes; the function/type-specific codec defines its fields.

Returns

  • No return value.

Access and behavior

  • Who can call: Account owner or signer with trade permission.
  • Requirements: Book not hard-paused; nonempty 32-byte-word payload; upper 80 bits zero; unique valid slots/flags; Engine admission and market-state constraints.
  • State effects: Atomically cancels/replaces slots, assigns fresh order IDs/FIFO tail, matches crossing orders, and consolidates exposure/fills to AccountCore.
  • Units and rounding: Packed word: slot 7:0, flags 15:8 (buy 0x01, reduce-only 0x04, post-only 0x08), price 47:16, base lots 143:48, min block 175:144, upper bits must be zero.
  • Event families: Possible first-use MakerRegistered occurs before accounting. All state-touched Engine logs (PerpPositionModeUpdated, PerpCrossPositionSlotUpdated/PerpIsolatedPositionUpdated, PerpMarginUpdated, PerpMakerFeeReserveUpdated, PerpOrderExposureUpdated, maker-then-taker PerpFillSettled) and then AccountCore fee/accrual/collector/builder logs occur before final TradesPacked, which precedes final BookUpdatesPacked.
  • Expected errors: Malformed/empty packed data, upper bits/flags/duplicate/slot, market/auth/mode/liquidation, tick/price/notional, reduce-only/OI/health, queue/tree/reentrancy errors.

Exact call data

replaceBySlotPacked(uint40,(uint8,bytes32,address,uint32),bytes)
  • Selector: 0x75b2e5ef
  • Mutability: nonpayable
  • Semantic rule: perp-book.replace-packed
  • Call path: market-maker/integrator

setAuthority(address)

state-changing ABI callable owner 0x7a9e5e4b

Replaces this contract's authority pointer; does not propagate the pointer to already deployed children.

Parameters and behavior

Inputs

  • newAuthority — address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.

Returns

  • No return value.

Access and behavior

  • Who can call: Contract owner.
  • Requirements: New authority must be nonzero and expose nonzero governance, ops, and emergency roles.
  • State effects: Replaces this contract's authority pointer; does not propagate the pointer to already deployed children.
  • Units and rounding: Address only; no rounding.
  • Event families: AuthorityUpdated.
  • Expected errors: Unauthorized, ZeroAddress, InvalidAuthority.

Exact call data

setAuthority(address)
  • Selector: 0x7a9e5e4b
  • Mutability: nonpayable
  • Semantic rule: access.authority
  • Call path: owner

toggleMarket(uint8)

state-changing ABI callable owner/router 0x732295ca

Changes ACTIVE/SOFT_PAUSED/HARD_PAUSED book state.

Parameters and behavior

Inputs

  • state — enum IActiveOrderBook.MarketState. Numeric Solidity enum enum IActiveOrderBook.MarketState; member values are listed in types and constants.

Returns

  • No return value.

Access and behavior

  • Who can call: Book owner (normally PerpRouter).
  • Requirements: Requested state must differ from current state.
  • State effects: Changes ACTIVE/SOFT_PAUSED/HARD_PAUSED book state.
  • Units and rounding: MarketState enum (uint8).
  • Event families: MarketStateUpdated.
  • Expected errors: Unauthorized, MarketStateError.

Exact call data

toggleMarket(uint8)
  • Selector: 0x732295ca
  • Mutability: nonpayable
  • Semantic rule: perp-book.market-state
  • Call path: owner/router

transferOwnership(address)

state-changing ABI callable owner 0xf2fde38b

Transfers direct upgrade/administrative ownership.

Parameters and behavior

Inputs

  • newOwner — address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.

Returns

  • No return value.

Access and behavior

  • Who can call: Current owner.
  • Requirements: New owner must be nonzero.
  • State effects: Transfers direct upgrade/administrative ownership.
  • Units and rounding: Address only; no rounding.
  • Event families: OwnershipTransferred.
  • Expected errors: Unauthorized and zero/new-owner errors.

Exact call data

transferOwnership(address)
  • Selector: 0xf2fde38b
  • Mutability: nonpayable
  • Semantic rule: ownership.transfer
  • Call path: owner

upgradeToAndCall(address,bytes)

payable ABI callable owner-upgrade 0x4f1ef286

Changes the proxy implementation and optionally delegatecalls migration data.

Parameters and behavior

Inputs

  • newImplementation — address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.
  • data — bytes. Opaque ABI or protocol-packed bytes; the function/type-specific codec defines its fields.

Returns

  • No return value.

Access and behavior

  • Who can call: Contract owner through the active ERC-1967 proxy.
  • Requirements: UUPS proxy context, compatible proxiableUUID, owner authorization; migration calldata executes atomically.
  • State effects: Changes the proxy implementation and optionally delegatecalls migration data.
  • Units and rounding: Raw calldata; no protocol arithmetic.
  • Event families: ERC-1967 Upgraded; optional migration data may emit any events of the explicitly invoked implementation selector, which cannot be statically narrowed from arbitrary bytes.
  • Expected errors: Unauthorized, UUPS call-context/UUID errors, zero-code/invalid implementation, and delegated migration errors.

Exact call data

upgradeToAndCall(address,bytes)
  • Selector: 0x4f1ef286
  • Mutability: payable
  • Semantic rule: upgrade.uups
  • Call path: owner-upgrade

Read-only functions

These view and pure calls expose configuration or protocol state without mutating it.

accountCoreAddress()

view ABI callable public-read 0x1364dd74

Returns the configured AccountCore address.

Parameters and behavior

Inputs

  • None.

Returns

  • result0 — address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.

Access and behavior

  • Who can call: Any caller; no state mutation.
  • Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
  • State effects: Returns _: address — EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.
  • Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
  • Event families: None; view/pure call.
  • Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.

Exact call data

accountCoreAddress()
  • Selector: 0x1364dd74
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

authority()

view ABI callable public-read 0xbf7e214f

Returns the shared protocol-authority contract.

Parameters and behavior

Inputs

  • None.

Returns

  • result0 — address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.

Access and behavior

  • Who can call: Any caller; no state mutation.
  • Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
  • State effects: Returns _: address — EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.
  • Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
  • Event families: None; view/pure call.
  • Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.

Exact call data

authority()
  • Selector: 0xbf7e214f
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

bestBidAsk()

view ABI callable public-read 0xb4de8b70

Returns the current best bid and best ask prices.

Parameters and behavior

Inputs

  • None.

Returns

  • bid — uint32. Integer market price units; human quote/base price = value / market pricePrecision; order prices must be tick aligned where required.
  • ask — uint32. Integer market price units; human quote/base price = value / market pricePrecision; order prices must be tick aligned where required.

Access and behavior

  • Who can call: Any caller; no state mutation.
  • Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
  • State effects: Returns bid: uint32 — Integer market price units; human quote/base price = value / market pricePrecision; order prices must be tick aligned where required.; ask: uint32 — Integer market price units; human quote/base price = value / market pricePrecision; order prices must be tick aligned where required.
  • Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
  • Event families: None; view/pure call.
  • Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.

Exact call data

bestBidAsk()
  • Selector: 0xb4de8b70
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

getL2Book(uint256)

view ABI callable public-read 0xb4cc4b1a

Returns aggregated bid and ask price levels up to the requested depth.

Parameters and behavior

Inputs

  • levels — uint256. Unitless integer count or zero-based index, as named.

Returns

  • bidPrices — uint32[]. Array in ABI order; each element: Integer market price units; human quote/base price = value / market pricePrecision; order prices must be tick aligned where required.
  • bidBaseLots — uint96[]. Array in ABI order; each element: Integer base-size lots; human base quantity = value / market sizePrecision.
  • askPrices — uint32[]. Array in ABI order; each element: Integer market price units; human quote/base price = value / market pricePrecision; order prices must be tick aligned where required.
  • askBaseLots — uint96[]. Array in ABI order; each element: Integer base-size lots; human base quantity = value / market sizePrecision.

Access and behavior

  • Who can call: Any caller; no state mutation.
  • Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
  • State effects: Returns bidPrices: uint32[] — Array in ABI order; each element: Integer market price units; human quote/base price = value / market pricePrecision; order prices must be tick aligned where required.; bidBaseLots: uint96[] — Array in ABI order; each element: Integer base-size lots; human base quantity = value / market sizePrecision.; askPrices: uint32[] — Array in ABI order; each element: Integer market price units; human quote/base price = value / market pricePrecision; order prices must be tick aligned where required.; askBaseLots: uint96[] — Array in ABI order; each element: Integer base-size lots; human base quantity = value / market sizePrecision.
  • Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
  • Event families: None; view/pure call.
  • Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.

Exact call data

getL2Book(uint256)
  • Selector: 0xb4cc4b1a
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

getOrder(uint40,uint8)

view ABI callable public-read 0xe8c6a474

Returns the Perp order stored for an account and maker slot.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • slotIndex — uint8. Maker slot index/count; live order slots are 0..61 and higher reserved values are not user slots.

Returns

  • order — struct IPerpOrderBook.OrderView. Structured struct IPerpOrderBook.OrderView; field-level units are defined in the type catalog and tuple metadata.

Access and behavior

  • Who can call: Any caller; no state mutation.
  • Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
  • State effects: Returns order: struct IPerpOrderBook.OrderView — Structured struct IPerpOrderBook.OrderView; field-level units are defined in the type catalog and tuple metadata.
  • Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
  • Event families: None; view/pure call.
  • Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.

Exact call data

getOrder(uint40,uint8)
  • Selector: 0xe8c6a474
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

getOrderId(uint40,uint8)

view ABI callable public-read 0x471bccbb

Returns the active Perp order ID for an account and maker slot.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • slotIndex — uint8. Maker slot index/count; live order slots are 0..61 and higher reserved values are not user slots.

Returns

  • result0 — uint64. Order ID (uint64); zero is empty, and uint64.max is ANY_ORDER_ID only in the trading wallet.

Access and behavior

  • Who can call: Any caller; no state mutation.
  • Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
  • State effects: Returns _: uint64 — Order ID (uint64); zero is empty, and uint64.max is ANY_ORDER_ID only in the trading wallet.
  • Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
  • Event families: None; view/pure call.
  • Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.

Exact call data

getOrderId(uint40,uint8)
  • Selector: 0x471bccbb
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

lastTradeObservation()

view ABI callable public-read 0xa4ab0548

Returns the most recent observed trade price and timestamp.

Parameters and behavior

Inputs

  • None.

Returns

  • priceX8 — uint64. Observed trade price scaled by 100,000,000 (1e8); human price = value / 1e8.
  • timestamp — uint32. Unix timestamp in seconds; zero-sentinel behavior is function-specific.

Access and behavior

  • Who can call: Any caller; no state mutation.
  • Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
  • State effects: Returns priceX8: uint64 — Observed trade price scaled by 100,000,000 (1e8); human price = value / 1e8.; timestamp: uint32 — Unix timestamp in seconds; zero-sentinel behavior is function-specific.
  • Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
  • Event families: None; view/pure call.
  • Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.

Exact call data

lastTradeObservation()
  • Selector: 0xa4ab0548
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

marketId()

view ABI callable public-read 0x6ed71ede

Returns the market's protocol-wide identifier.

Parameters and behavior

Inputs

  • None.

Returns

  • result0 — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.

Access and behavior

  • Who can call: Any caller; no state mutation.
  • Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
  • State effects: Returns _: uint32 — Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.
  • Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
  • Event families: None; view/pure call.
  • Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.

Exact call data

marketId()
  • Selector: 0x6ed71ede
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

marketState()

view ABI callable public-read 0x08fb1b77

Returns the market's current operating state.

Parameters and behavior

Inputs

  • None.

Returns

  • result0 — enum IActiveOrderBook.MarketState. Numeric Solidity enum enum IActiveOrderBook.MarketState; member values are listed in types and constants.

Access and behavior

  • Who can call: Any caller; no state mutation.
  • Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
  • State effects: Returns _: enum IActiveOrderBook.MarketState — Numeric Solidity enum enum IActiveOrderBook.MarketState; member values are listed in types and constants.
  • Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
  • Event families: None; view/pure call.
  • Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.

Exact call data

marketState()
  • Selector: 0x08fb1b77
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

maxQuoteNotional()

view ABI callable public-read 0x6e2a0a92

Returns the maximum allowed quote notional.

Parameters and behavior

Inputs

  • None.

Returns

  • result0 — uint96. Raw atomic units of the applicable quote/token asset; human amount = value / that asset's decimal scale.

Access and behavior

  • Who can call: Any caller; no state mutation.
  • Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
  • State effects: Returns _: uint96 — Raw atomic units of the applicable quote/token asset; human amount = value / that asset's decimal scale.
  • Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
  • Event families: None; view/pure call.
  • Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.

Exact call data

maxQuoteNotional()
  • Selector: 0x6e2a0a92
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

minQuoteNotional()

view ABI callable public-read 0x95f03b02

Returns the minimum allowed quote notional.

Parameters and behavior

Inputs

  • None.

Returns

  • result0 — uint96. Raw atomic units of the applicable quote/token asset; human amount = value / that asset's decimal scale.

Access and behavior

  • Who can call: Any caller; no state mutation.
  • Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
  • State effects: Returns _: uint96 — Raw atomic units of the applicable quote/token asset; human amount = value / that asset's decimal scale.
  • Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
  • Event families: None; view/pure call.
  • Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.

Exact call data

minQuoteNotional()
  • Selector: 0x95f03b02
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

owner()

view ABI callable public-read 0x8da5cb5b

Returns the contract owner.

Parameters and behavior

Inputs

  • None.

Returns

  • result0 — address. EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.

Access and behavior

  • Who can call: Any caller; no state mutation.
  • Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
  • State effects: Returns _: address — EVM address; zero-address allowance/sentinel meaning is stated by the function semantics.
  • Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
  • Event families: None; view/pure call.
  • Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.

Exact call data

owner()
  • Selector: 0x8da5cb5b
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

pricePrecision()

view ABI callable public-read 0xad5c6ec5

Returns the denominator used to scale integer prices.

Parameters and behavior

Inputs

  • None.

Returns

  • result0 — uint32. Price scaling denominator; human quote/base price = integer price / pricePrecision.

Access and behavior

  • Who can call: Any caller; no state mutation.
  • Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
  • State effects: Returns _: uint32 — Price scaling denominator; human quote/base price = integer price / pricePrecision.
  • Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
  • Event families: None; view/pure call.
  • Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.

Exact call data

pricePrecision()
  • Selector: 0xad5c6ec5
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

proxiableUUID()

view ABI callable implementation-read 0x52d1902d

Returns the ERC-1822 implementation-slot identifier.

Parameters and behavior

Inputs

  • None.

Returns

  • result0 — bytes32. bytes32 opaque binary value.

Access and behavior

  • Who can call: Any caller on the implementation contract, not through the active proxy.
  • Requirements: UUPS notDelegated; intentionally reverts when delegatecalled through a proxy.
  • State effects: No state mutation. Returns the ERC-1967 implementation storage slot UUID. Returns the storage slot used by the implementation, as specified in ERC1822. Note: The notDelegated modifier prevents accidental upgrades to an implementation that is a proxy contract.
  • Units and rounding: Return/input units follow the ABI names, tuple definitions, constants, and NatSpec in this reference.
  • Event families: None; view/pure call.
  • Expected errors: Input/existence/configuration errors declared by the contract may still revert.

Exact call data

proxiableUUID()
  • Selector: 0x52d1902d
  • Mutability: view
  • Semantic rule: read.PerpOrderBook.proxiableUUID
  • Call path: implementation-read

quoteScale()

view ABI callable public-read 0x172009a6

Returns the quote asset's decimal scaling denominator.

Parameters and behavior

Inputs

  • None.

Returns

  • result0 — uint96. Quote-token scaling denominator, normally 10 ** quoteTokenDecimals.

Access and behavior

  • Who can call: Any caller; no state mutation.
  • Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
  • State effects: Returns _: uint96 — Quote-token scaling denominator, normally 10 ** quoteTokenDecimals.
  • Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
  • Event families: None; view/pure call.
  • Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.

Exact call data

quoteScale()
  • Selector: 0x172009a6
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

sizePrecision()

view ABI callable public-read 0x4200df4d

Returns the denominator used to scale integer base quantities.

Parameters and behavior

Inputs

  • None.

Returns

  • result0 — uint96. Base-size scaling denominator; human base quantity = integer base size or lots / sizePrecision.

Access and behavior

  • Who can call: Any caller; no state mutation.
  • Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
  • State effects: Returns _: uint96 — Base-size scaling denominator; human base quantity = integer base size or lots / sizePrecision.
  • Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
  • Event families: None; view/pure call.
  • Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.

Exact call data

sizePrecision()
  • Selector: 0x4200df4d
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

tickSize()

view ABI callable public-read 0xf210d087

Returns the minimum valid price increment.

Parameters and behavior

Inputs

  • None.

Returns

  • result0 — uint32. Minimum price increment in integer price units; valid order prices are multiples of this value.

Access and behavior

  • Who can call: Any caller; no state mutation.
  • Requirements: No caller authorization unless stated in NatSpec; input-dependent existence/configuration validation may revert.
  • State effects: Returns _: uint32 — Minimum price increment in integer price units; valid order prices are multiples of this value.
  • Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
  • Event families: None; view/pure call.
  • Expected errors: Input, missing entity, invalid configuration, arithmetic, or delegated read errors declared in the error catalog.

Exact call data

tickSize()
  • Selector: 0xf210d087
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read