PerpOrderBook functions¶
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[])¶¶
Executes cancellations followed by the supplied native orders in one atomic action.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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
MakerRegisteredoccurs before accounting. All state-touched Engine logs (PerpPositionModeUpdated,PerpCrossPositionSlotUpdated/PerpIsolatedPositionUpdated,PerpMarginUpdated,PerpMakerFeeReserveUpdated,PerpOrderExposureUpdated, maker-then-takerPerpFillSettled) and then AccountCore fee/accrual/collector/builder logs occur before finalTradesPacked, which precedes finalBookUpdatesPacked. - 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)¶¶
Removes every resting order for one account in this market and returns its release journal.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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
BookUpdatesPackedfirst; the outer Engine then emits, per returned cancellation, conditionalPerpMarginUpdated,PerpMakerFeeReserveUpdated, andPerpOrderExposureUpdatedin 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)¶¶
Cancels all 62 slots and sends exposure/maker-fee-reserve releases to AccountCore/Engine.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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 EnginePerpMarginUpdated, thenPerpMakerFeeReserveUpdated, thenPerpOrderExposureUpdated; finalBookUpdatesPackedwhen 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)¶¶
Executes a reduce-only IOC for a liquidating account against normal FIFO liquidity.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in protocol state); zero denotes missing/unregistered unless explicitly allowed.isBuy—bool. Boolean flag namedisBuy.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:
maxBaseLotsbase lots;limitPricemarket price units. - Event families: In log order: OrderBook
TradesPacked, thenBookUpdatesPacked; Engine maker/targetPerpFillSettledplus touched margin/position logs and conditionalPerpLiquidationCleared; AccountCore conditionalPerpProtocolFeesAccrued, collectorSpotReserveUpdated,PerpFeeCharged; finalPerpPositionLiquidated. - 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)¶¶
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 noOwnershipTransferredevent. - 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)¶¶
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 (uint40in 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
slotsToPrimemaker 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, thenMakerPagePrimedwith 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)¶¶
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:
QueuePagesPrimedwith 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)¶¶
Cancels selected slots and sends exposure/reserve release deltas to AccountCore/Engine.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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, thenPerpMakerFeeReserveUpdated, thenPerpOrderExposureUpdated; finalBookUpdatesPackedwhen 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)¶¶
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 (uint40in 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
MakerRegisteredoccurs before accounting. All state-touched Engine logs (PerpPositionModeUpdated,PerpCrossPositionSlotUpdated/PerpIsolatedPositionUpdated,PerpMarginUpdated,PerpMakerFeeReserveUpdated,PerpOrderExposureUpdated, maker-then-takerPerpFillSettled) and then AccountCore fee/accrual/collector/builder logs occur before finalTradesPacked, which precedes finalBookUpdatesPacked. - 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)¶¶
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)¶¶
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:
MarketStateenum (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)¶¶
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:
Unauthorizedand zero/new-owner errors.
Exact call data
transferOwnership(address)
- Selector:
0xf2fde38b - Mutability:
nonpayable - Semantic rule:
ownership.transfer - Call path:
owner
upgradeToAndCall(address,bytes)¶¶
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 migrationdatamay 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()¶¶
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/purecall. - 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()¶¶
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/purecall. - 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()¶¶
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/purecall. - 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)¶¶
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/purecall. - 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)¶¶
Returns the Perp order stored for an account and maker slot.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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/purecall. - 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)¶¶
Returns the active Perp order ID for an account and maker slot.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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, anduint64.maxisANY_ORDER_IDonly 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, anduint64.maxisANY_ORDER_IDonly 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/purecall. - 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()¶¶
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/purecall. - 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()¶¶
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/purecall. - 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()¶¶
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/purecall. - 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()¶¶
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/purecall. - 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()¶¶
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/purecall. - 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()¶¶
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/purecall. - 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()¶¶
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/purecall. - 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()¶¶
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
notDelegatedmodifier 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/purecall. - 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()¶¶
Returns the quote asset's decimal scaling denominator.
Parameters and behavior
Inputs
- None.
Returns
result0—uint96. Quote-token scaling denominator, normally10 ** 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, normally10 ** quoteTokenDecimals. - Units and rounding: Return/input units follow ABI names, tuple definitions, constants, and NatSpec; no state-changing rounding occurs.
- Event families: None;
view/purecall. - 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()¶¶
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/purecall. - 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()¶¶
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/purecall. - 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