Skip to content

PerpEngine functions

← Browse all contracts

Quote-scoped Perp margin, positions, funding, and liquidation. Router-deployed ERC-1967/UUPS proxy; atomically initialized.

This page lists every ABI-exposed function: 61 total, comprising 0 user functions, 29 state-changing, and 32 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 61 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.

cancelOwnershipHandover()

payable ABI callable ownership-candidate 0x54d1f13d

Sets the caller's handover-request expiry to zero, including when no request existed.

Parameters and behavior

Inputs

  • None.

Returns

  • No return value.

Access and behavior

  • Who can call: Any requester, for its own pending request.
  • Requirements: No current-owner requirement and no request-existence requirement.
  • State effects: Sets the caller's handover-request expiry to zero, including when no request existed.
  • Units and rounding: No protocol arithmetic.
  • Event families: OwnershipHandoverCanceled.
  • Expected errors: No contract-defined revert path.

Exact call data

cancelOwnershipHandover()
  • Selector: 0x54d1f13d
  • Mutability: payable
  • Semantic rule: ownership.handover-cancel
  • Call path: ownership-candidate

clearCrossLiquidation(uint40)

state-changing ABI callable account-core 0x6791a670

Clears a cross liquidation lock after maintenance health has recovered.

Parameters and behavior

Inputs

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

Returns

  • No return value.

Access and behavior

  • Who can call: Configured AccountCore only.
  • Requirements: Cross lock active and current cross maintenance health nonnegative; no independent freshness/divergence check.
  • State effects: Clears the cross liquidation bitmap flag without changing positions or margin.
  • Units and rounding: Health is raw quote-token units.
  • Event families: PerpLiquidationCleared(accountId,0,CROSS).
  • Expected errors: OnlyAccountCore, LiquidationNotActive, LiquidationNotAllowed, numeric, reentrancy.

Exact call data

clearCrossLiquidation(uint40)
  • Selector: 0x6791a670
  • Mutability: nonpayable
  • Semantic rule: perp-engine.liquidation-clear.clear-cross-liquidation
  • Call path: account-core

clearIsolatedLiquidation(uint40,uint32)

state-changing ABI callable account-core 0xb045ffd8

Clears an isolated liquidation lock after maintenance health has recovered.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.

Returns

  • No return value.

Access and behavior

  • Who can call: Configured AccountCore only.
  • Requirements: Existing isolated-mode position with liquidation flag active and current isolated maintenance health nonnegative; no independent freshness/divergence check.
  • State effects: Clears the isolated position's liquidation flag without changing its economic fields or margin.
  • Units and rounding: Market ID exact; health is raw quote-token units.
  • Event families: PerpIsolatedPositionUpdated with the liquidation flag cleared, then PerpLiquidationCleared(accountId,marketId,ISOLATED).
  • Expected errors: OnlyAccountCore, market/mode/position, LiquidationNotActive, LiquidationNotAllowed, numeric, reentrancy.

Exact call data

clearIsolatedLiquidation(uint40,uint32)
  • Selector: 0xb045ffd8
  • Mutability: nonpayable
  • Semantic rule: perp-engine.liquidation-clear.clear-isolated-liquidation
  • Call path: account-core

completeOwnershipHandover(address)

payable ABI callable owner 0xf04e283e

Transfers ownership to the requesting address and consumes the request.

Parameters and behavior

Inputs

  • pendingOwner — 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: The nominated pending owner must have an unexpired request.
  • State effects: Transfers ownership to the requesting address and consumes the request.
  • Units and rounding: Request validity is timestamp-based.
  • Event families: OwnershipTransferred only; clearing the request emits no OwnershipHandoverCanceled.
  • Expected errors: Unauthorized, NoHandoverRequest.

Exact call data

completeOwnershipHandover(address)
  • Selector: 0xf04e283e
  • Mutability: payable
  • Semantic rule: ownership.handover-complete
  • Call path: owner

creditMargin(uint40,uint32,uint256)

state-changing ABI callable account-core 0x8e04b848

Credits margin in the cross bucket when marketId is 0, otherwise in an isolated market bucket.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.
  • amount — uint256. Raw atomic units of the token/asset identified by the same call or enclosing struct; no decimal conversion is performed by ABI encoding.

Returns

  • No return value.

Access and behavior

  • Who can call: Configured AccountCore only.
  • Requirements: Nonzero amount; namespace is cross ID 0 or a registered isolated market; addition must fit uint256.
  • State effects: Increases one cross/isolated margin balance without a health check.
  • Units and rounding: Raw quote-token units; exact addition.
  • Event families: PerpMarginTransferred(...,amount,true) then PerpMarginUpdated.
  • Expected errors: OnlyAccountCore, ZeroAmount, MarketNotFound, InvalidMarketConfig, arithmetic overflow, reentrancy.

Exact call data

creditMargin(uint40,uint32,uint256)
  • Selector: 0x8e04b848
  • Mutability: nonpayable
  • Semantic rule: perp-engine.margin.credit-margin
  • Call path: account-core

debitMargin(uint40,uint32,uint256)

state-changing ABI callable account-core 0xb7e4e06e

Debits margin from the cross bucket when marketId is 0, otherwise from an isolated market bucket.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.
  • amount — uint256. Raw atomic units of the token/asset identified by the same call or enclosing struct; no decimal conversion is performed by ABI encoding.

Returns

  • No return value.

Access and behavior

  • Who can call: Configured AccountCore only.
  • Requirements: Nonzero amount; source balance sufficient; registered namespace; resulting transfer health must pass using fresh sane prices.
  • State effects: Decreases one cross/isolated margin balance.
  • Units and rounding: Raw quote-token units; requirement calculations round conservatively before the exact debit.
  • Event families: PerpMarginTransferred(...,amount,false) then PerpMarginUpdated.
  • Expected errors: OnlyAccountCore, ZeroAmount, MarketNotFound, InsufficientBalance, mode/liquidation, stale/divergent price, health/numeric, reentrancy.

Exact call data

debitMargin(uint40,uint32,uint256)
  • Selector: 0xb7e4e06e
  • Mutability: nonpayable
  • Semantic rule: perp-engine.margin.debit-margin
  • Call path: account-core

executePerpOrderAction(uint32,(uint40,uint8,uint96,uint96,bool),(bool,bool,bool,uint96,uint96)[],(uint40,bool,bool,bool,uint96,uint96,uint32,uint96,uint96,uint96,bool)[])

state-changing ABI callable account-core/order-book 0x5bfd0d67

Applies one complete orderbook action after AccountCore normalizes fees and quote amounts.

Parameters and behavior

Inputs

  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.
  • action — struct IPerpEngine.PerpAction. Structured struct IPerpEngine.PerpAction; field-level units are defined in the type catalog and tuple metadata.
  • 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.
  • 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.

Returns

  • No return value.

Access and behavior

  • Who can call: Configured AccountCore only; AccountCore authenticates the routed Perp book.
  • Requirements: Registered market; active/risk rules for increases/fills; mode/liquidation, price sanity, reduce-only, open-interest, order-count, initial-margin and fee-reserve checks.
  • State effects: Applies order exposure deltas, reserves/releases maker fees, settles funding/fills/fees/PnL, updates positions and aggregate open interest.
  • Units and rounding: Base/quote lots use market scales; fee debits and requirements round up, positive credits down; factors parts-per-10,000,000.
  • Event families: PerpOrderExposureUpdated, PerpMakerFeeReserveUpdated, PerpFillSettled, PerpIsolatedPositionUpdated, PerpCrossPositionSlotUpdated, PerpMarginUpdated, and PerpPositionModeUpdated as applicable; AccountCore separately emits PerpFeeCharged, PerpProtocolFeesAccrued, and conditional BuilderFeeAccrued.
  • Expected errors: OnlyAccountCore, market/status/price, mode/liquidation, reduce-only, open-interest/order cap, margin health/balance/reserve, numeric/reentrancy errors.

Exact call data

executePerpOrderAction(uint32,(uint40,uint8,uint96,uint96,bool),(bool,bool,bool,uint96,uint96)[],(uint40,bool,bool,bool,uint96,uint96,uint32,uint96,uint96,uint96,bool)[])
  • Selector: 0x5bfd0d67
  • Mutability: nonpayable
  • Semantic rule: perp-engine.order-action
  • Call path: account-core/order-book

initialize(address,address,address,uint96,uint16)

state-changing ABI callable proxy-initialization 0x032431d5

Initializes proxy ownership and immutable-in-practice quote-scoped Engine dependencies/configuration.

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.
  • _quoteAsset — address. EVM asset address; address(0) denotes native MON only on explicitly native-aware AccountCore/periphery paths.
  • _quoteScale — uint96. Quote-token scaling denominator, normally 10 ** quoteTokenDecimals.
  • _maxCrossRestingOrders — uint16. Unitless integer count or zero-based index, as named.

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, and quote asset; nonzero quote scale and max cross resting-order cap; initializer guard.
  • State effects: Initializes proxy ownership and immutable-in-practice quote-scoped Engine dependencies/configuration.
  • Units and rounding: Quote scale is the raw-token denominator; resting-order cap is a count; addresses exact.
  • Event families: OwnershipTransferred, PerpEngineQuoteConfigured, then Initialized.
  • Expected errors: AlreadyInitialized, ZeroAddress, InvalidMarketConfig.

Exact call data

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

liquidateCrossPosition(uint40,uint32,uint96,uint32,uint32)

state-changing ABI callable account-core 0xcb2aa89e

Reduces a locked cross position through its market's normal FIFO orderbook.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.
  • 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.
  • takerFeePps — uint32. Parts per 10,000,000 (PPS); 1 bp = 1,000 PPS and 1% = 100,000 PPS.

Returns

  • result — struct IPerpEngine.LiquidationResult. Structured struct IPerpEngine.LiquidationResult; field-level units are defined in the type catalog and tuple metadata.

Access and behavior

  • Who can call: Configured AccountCore only; AccountCore authenticates keeper and supplies effective taker fee.
  • Requirements: Cross lock active; target cross position exists; positive lot cap/valid limit; routed book returns nonzero maker fills; prices sane; exposure reduces and cross maintenance health strictly improves unless recovered.
  • State effects: Executes the routed liquidation IOC, settles all maker fills and cross-target fill/PnL/fees, updates open interest, and returns aggregate fill/fee/health data; clears cross lock on recovery.
  • Units and rounding: Base lots and market price units; quote fills, fees, PnL, margin, and health are raw quote units; taker fee rounds up.
  • Event families: Book TradesPacked/BookUpdatesPacked; Engine exposure/reserve/fill/position/margin events and conditional PerpLiquidationCleared(accountId,0,CROSS).
  • Expected errors: OnlyAccountCore, liquidation/mode/position, route/book hard-pause, price/tick/liquidity, fill consistency, health-improvement, balance/OI/numeric, reentrancy errors.

Exact call data

liquidateCrossPosition(uint40,uint32,uint96,uint32,uint32)
  • Selector: 0xcb2aa89e
  • Mutability: nonpayable
  • Semantic rule: perp-engine.liquidation-fill.liquidate-cross-position
  • Call path: account-core

liquidateIsolatedPosition(uint40,uint32,uint96,uint32,uint32)

state-changing ABI callable account-core 0x8321e886

Reduces a locked isolated position through its market's normal FIFO orderbook.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.
  • 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.
  • takerFeePps — uint32. Parts per 10,000,000 (PPS); 1 bp = 1,000 PPS and 1% = 100,000 PPS.

Returns

  • result — struct IPerpEngine.LiquidationResult. Structured struct IPerpEngine.LiquidationResult; field-level units are defined in the type catalog and tuple metadata.

Access and behavior

  • Who can call: Configured AccountCore only; AccountCore authenticates keeper and supplies effective taker fee.
  • Requirements: Target isolated liquidation flag active; positive lot cap/valid limit; routed book returns nonzero maker fills; price sane; exposure reduces and isolated maintenance health strictly improves unless recovered.
  • State effects: Executes the routed liquidation IOC, settles all maker fills and isolated-target fill/PnL/fees, updates open interest, and returns aggregate fill/fee/health data; clears the isolated flag on recovery.
  • Units and rounding: Base lots and market price units; quote fills, fees, PnL, margin, and health are raw quote units; taker fee rounds up.
  • Event families: Book TradesPacked/BookUpdatesPacked; Engine exposure/reserve/fill/isolated-position/margin events and conditional PerpLiquidationCleared(accountId,marketId,ISOLATED).
  • Expected errors: OnlyAccountCore, liquidation/mode/position, route/book hard-pause, price/tick/liquidity, fill consistency, health-improvement, balance/OI/numeric, reentrancy errors.

Exact call data

liquidateIsolatedPosition(uint40,uint32,uint96,uint32,uint32)
  • Selector: 0x8321e886
  • Mutability: nonpayable
  • Semantic rule: perp-engine.liquidation-fill.liquidate-isolated-position
  • Call path: account-core

moveCrossPositionToIsolated(uint40,uint32,uint8,uint256)

state-changing ABI callable account-core 0x372e5981

Moves a cross position into isolated mode with the requested collateral amount.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.
  • crossSlotHint — uint8. Maker slot index/count; live order slots are 0..61 and higher reserved values are not user slots.
  • isolatedMarginAmount — uint256. 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: Configured AccountCore only.
  • Requirements: Positive isolated margin; registered cross-mode position at resolved slot; no order exposure, maker reserve, or liquidation; no isolated record; cross balance and resulting cross/isolated health sufficient.
  • State effects: Frees the cross slot, writes the isolated position, transfers supplied margin from cross to isolated, and changes mode.
  • Units and rounding: Position is base lots/raw quote entry/funding scale; margin is raw quote units; slot hint is a zero-based slot or CROSS_SLOT_UNSET sentinel.
  • Event families: PerpIsolatedPositionUpdated, PerpPositionModeUpdated(CROSS,ISOLATED), PerpCrossPositionSlotUpdated(...,false), cross and isolated PerpMarginUpdated, PerpPositionMigrated.
  • Expected errors: OnlyAccountCore, ZeroAmount, market/mode/position/liquidation, active-order/maker-reserve, slot, balance, price/health/numeric, reentrancy.

Exact call data

moveCrossPositionToIsolated(uint40,uint32,uint8,uint256)
  • Selector: 0x372e5981
  • Mutability: nonpayable
  • Semantic rule: perp-engine.mode-migration.move-cross-position-to-isolated
  • Call path: account-core

moveIsolatedPositionToCross(uint40,uint32)

state-changing ABI callable account-core 0xa932c4fa

Moves an isolated position and all isolated margin for its market into cross margin.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.

Returns

  • No return value.

Access and behavior

  • Who can call: Configured AccountCore only.
  • Requirements: Registered isolated-mode position; no order exposure, maker-fee reserve, or liquidation; cross slot available; resulting cross transfer health valid.
  • State effects: Copies the full position into a new cross slot, deletes isolated position/margin, credits all isolated margin to cross, and changes mode.
  • Units and rounding: Position is base lots/raw quote entry/funding scale; margin is raw quote units.
  • Event families: PerpPositionModeUpdated(ISOLATED,CROSS), PerpCrossPositionSlotUpdated(...,true), PerpIsolatedPositionCleared, isolated and cross PerpMarginUpdated, PerpPositionMigrated.
  • Expected errors: OnlyAccountCore, market/mode/position/liquidation, active-order/maker-reserve, cross-capacity, price/health/numeric, reentrancy.

Exact call data

moveIsolatedPositionToCross(uint40,uint32)
  • Selector: 0xa932c4fa
  • Mutability: nonpayable
  • Semantic rule: perp-engine.mode-migration.move-isolated-position-to-cross
  • Call path: account-core

moveMargin(uint40,uint32,uint32,uint256)

state-changing ABI callable account-core 0x13a12ab7

Moves margin between cross and isolated namespaces for the same account.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • fromMarketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.
  • toMarketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.
  • amount — uint256. Raw atomic units of the token/asset identified by the same call or enclosing struct; no decimal conversion is performed by ABI encoding.

Returns

  • No return value.

Access and behavior

  • Who can call: Configured AccountCore only.
  • Requirements: Distinct namespaces with exactly one equal to cross ID 0; nonzero amount; registered isolated market; source balance and post-debit health sufficient.
  • State effects: Debits one namespace then credits the other inside this Engine.
  • Units and rounding: Raw quote-token units; source requirement math rounds conservatively and transfer arithmetic is exact.
  • Event families: Source PerpMarginTransferred(...,false)/PerpMarginUpdated, then destination PerpMarginTransferred(...,true)/PerpMarginUpdated.
  • Expected errors: OnlyAccountCore, InvalidMarketConfig, ZeroAmount, MarketNotFound, InsufficientBalance, mode/liquidation, price/health/numeric, reentrancy.

Exact call data

moveMargin(uint40,uint32,uint32,uint256)
  • Selector: 0x13a12ab7
  • Mutability: nonpayable
  • Semantic rule: perp-engine.margin.move-margin
  • Call path: account-core

registerMarket(uint32,(uint32,uint32,uint8,uint24,uint96,uint32,uint32,uint32,uint32,uint32,uint32,uint96,uint32,uint32,uint32,uint32,uint64,uint32,uint32,uint96,uint64,uint32,uint96,uint96,uint96,uint96))

state-changing ABI callable owner/perp-router 0x0d7883d5

Registers a perp market risk/state record.

Parameters and behavior

Inputs

  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.
  • market — struct PerpMarketPageLib.MarketState. Structured struct PerpMarketPageLib.MarketState; field-level units are defined in the type catalog and tuple metadata.

Returns

  • No return value.

Access and behavior

  • Who can call: PerpEngine owner, normally PerpRouter.
  • Requirements: Nonzero previously unregistered market ID; complete packed market state must pass precision, tick, notional, fee, status/flag, price/funding, risk, cap, and liquidation validation.
  • State effects: Stores the initial full market page for this quote-scoped Engine.
  • Units and rounding: Field units are defined in the market tuple: prices/precisions, raw quote notionals, base-lot caps, PPS factors, E6 leverage, and seconds.
  • Event families: PerpMarketUpdated with market ID and initial status.
  • Expected errors: Unauthorized, InvalidMarketConfig, MarketAlreadyExists, MarketSizeError, MarketFeeError, PriceError, TickSizeError, and numeric bounds errors.

Exact call data

registerMarket(uint32,(uint32,uint32,uint8,uint24,uint96,uint32,uint32,uint32,uint32,uint32,uint32,uint96,uint32,uint32,uint32,uint32,uint64,uint32,uint32,uint96,uint64,uint32,uint96,uint96,uint96,uint96))
  • Selector: 0x0d7883d5
  • Mutability: nonpayable
  • Semantic rule: perp-engine.market-register.register-market
  • Call path: owner/perp-router

renounceOwnership()

payable ABI callable owner 0x715018a6

Sets the owner to the zero address; owner-gated paths then become unreachable.

Parameters and behavior

Inputs

  • None.

Returns

  • No return value.

Access and behavior

  • Who can call: Current owner.
  • Requirements: Owner authorization.
  • State effects: Sets the owner to the zero address; owner-gated paths then become unreachable.
  • Units and rounding: No numeric units.
  • Event families: OwnershipTransferred.
  • Expected errors: Unauthorized.

Exact call data

renounceOwnership()
  • Selector: 0x715018a6
  • Mutability: payable
  • Semantic rule: ownership.renounce
  • Call path: owner

requestOwnershipHandover()

payable ABI callable ownership-candidate 0x25692962

Creates or refreshes the caller's ownership handover request to expire at block.timestamp + 172800.

Parameters and behavior

Inputs

  • None.

Returns

  • No return value.

Access and behavior

  • Who can call: Any prospective owner, for its own address.
  • Requirements: No current-owner requirement; always succeeds absent an EVM-level failure.
  • State effects: Creates or refreshes the caller's ownership handover request to expire at block.timestamp + 172800.
  • Units and rounding: Expiry is a Unix timestamp in seconds; validity is exactly 48 hours (172,800 seconds).
  • Event families: OwnershipHandoverRequested.
  • Expected errors: No contract-defined revert path.

Exact call data

requestOwnershipHandover()
  • Selector: 0x25692962
  • Mutability: payable
  • Semantic rule: ownership.handover-request
  • Call path: ownership-candidate

setAuthority(address)

state-changing ABI callable owner 0x7a9e5e4b

Sets the shared authority contract used for governance and ops checks.

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

settlePerpFunding(uint40,uint32,bool)

state-changing ABI callable account-core 0xfe1429c4

Crystallizes an account's current funding into its stored margin namespace.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.
  • emitZero — bool. Boolean flag named emitZero.

Returns

  • No return value.

Access and behavior

  • Who can call: Configured AccountCore only.
  • Requirements: Registered market and existing/compatible position; unsigned margin must cover debited funding.
  • State effects: Moves unsettled cumulative funding into margin and advances the position checkpoint; may emit zero when requested.
  • Units and rounding: Funding debit rounds up and credit down into raw quote units.
  • Event families: In order: conditional PerpMarginUpdated when funding is nonzero; PerpIsolatedPositionUpdated when mode is ISOLATED; then PerpFundingSettled when funding is nonzero or emitZero is true.
  • Expected errors: OnlyAccountCore, market/mode, insufficient margin, conversion/overflow and reentrancy errors.

Exact call data

settlePerpFunding(uint40,uint32,bool)
  • Selector: 0xfe1429c4
  • Mutability: nonpayable
  • Semantic rule: perp-engine.funding-settle
  • Call path: account-core

startCrossLiquidation(uint40,uint32[])

state-changing ABI callable account-core 0x95e24d00

Locks an unhealthy cross namespace and atomically cancels its orders in the supplied markets.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketIds — uint32[]. Array in ABI order; each element: Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.

Returns

  • No return value.

Access and behavior

  • Who can call: Configured AccountCore only; AccountCore authenticates the keeper.
  • Requirements: Cross namespace not locked; input list strictly increasing, complete for all active cross slots, and every market belongs to this Engine; all prices fresh/sane; cancel-margin health negative; each routed cancellation succeeds.
  • State effects: Sets the cross lock, cancels all listed books, applies exposure/maker-reserve releases, and removes the lock if post-cancel maintenance health is nonnegative.
  • Units and rounding: Account/market IDs exact; health/margin raw quote; risk factors PPS.
  • Event families: For each market in the validated ascending list: book BookUpdatesPacked, then per cancellation conditional PerpMarginUpdated, PerpMakerFeeReserveUpdated, and PerpOrderExposureUpdated in that order; final PerpLiquidationStarted(accountId,0,CROSS,recovered).
  • Expected errors: OnlyAccountCore, liquidation/list/market/mode, stale/divergent price, health, route/cancellation, numeric, reentrancy errors.

Exact call data

startCrossLiquidation(uint40,uint32[])
  • Selector: 0x95e24d00
  • Mutability: nonpayable
  • Semantic rule: perp-engine.liquidation-start.start-cross-liquidation
  • Call path: account-core

startIsolatedLiquidation(uint40,uint32)

state-changing ABI callable account-core 0x124ea73a

Locks an unhealthy isolated namespace and atomically cancels its market orders.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.

Returns

  • No return value.

Access and behavior

  • Who can call: Configured AccountCore only; AccountCore authenticates the keeper.
  • Requirements: Existing isolated-mode position not already locked; fresh sane price; cancel-margin health negative; routed cancellation succeeds.
  • State effects: Sets the position's liquidation flag, cancels all resting orders, applies exposure/maker-reserve releases, and removes the flag if post-cancel maintenance health is nonnegative.
  • Units and rounding: Account/market IDs exact; health/margin raw quote; risk factors PPS.
  • Event families: In order: initial PerpIsolatedPositionUpdated sets the liquidation flag; book BookUpdatesPacked; per cancellation conditional PerpMarginUpdated, PerpMakerFeeReserveUpdated, then PerpOrderExposureUpdated; a resulting isolated-position snapshot; if recovered, another PerpIsolatedPositionUpdated clears the flag; final PerpLiquidationStarted(accountId,marketId,ISOLATED,recovered).
  • Expected errors: OnlyAccountCore, market/mode/position/liquidation, stale/divergent price, health, route/cancellation, numeric, reentrancy errors.

Exact call data

startIsolatedLiquidation(uint40,uint32)
  • Selector: 0x124ea73a
  • Mutability: nonpayable
  • Semantic rule: perp-engine.liquidation-start.start-isolated-liquidation
  • Call path: account-core

takeoverCrossNamespace(uint40,uint40)

state-changing ABI callable account-core 0xa30955eb

Transfers an insolvent account's complete cross namespace to an empty, healthy destination.

Parameters and behavior

Inputs

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

Returns

  • No return value.

Access and behavior

  • Who can call: Configured AccountCore only; AccountCore authenticates keeper and destination permission.
  • Requirements: Distinct accounts; source cross lock active and below takeover threshold with all active-market prices sane; destination cross namespace empty/not liquidating; destination margin prefunded; slot capacity and health requirements pass.
  • State effects: Moves every cross position into destination slots, switches both accounts' mode mappings, transfers source cross margin to destination, clears source pages/lock, and preserves aggregate open interest.
  • Units and rounding: Positions base lots/raw quote entry; margin and health raw quote; takeover factors PPS.
  • Event families: Paired source/destination PerpPositionModeUpdated and PerpCrossPositionSlotUpdated per market; source/destination PerpMarginUpdated; final PerpNamespaceTakenOver(...,0,CROSS).
  • Expected errors: OnlyAccountCore, same/destination account, mode/liquidation, price/threshold/health, nonempty destination, slot/balance/numeric, reentrancy errors.

Exact call data

takeoverCrossNamespace(uint40,uint40)
  • Selector: 0xa30955eb
  • Mutability: nonpayable
  • Semantic rule: perp-engine.takeover.takeover-cross-namespace
  • Call path: account-core

takeoverIsolatedPosition(uint40,uint32,uint40)

state-changing ABI callable account-core 0x1838b519

Transfers one insolvent isolated position and its margin to a healthy destination namespace.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.
  • destinationId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.

Returns

  • No return value.

Access and behavior

  • Who can call: Configured AccountCore only; AccountCore authenticates keeper and destination permission.
  • Requirements: Distinct accounts; source isolated position locked and below takeover threshold with sane price; destination has no position/mode and is prefunded; health requirements pass.
  • State effects: Moves isolated position and margin to destination, changes both mode mappings, clears source position/flag, and preserves aggregate open interest.
  • Units and rounding: Position base lots/raw quote entry; margin and health raw quote; takeover factors PPS.
  • Event families: Source/destination PerpPositionModeUpdated, source PerpIsolatedPositionCleared, destination PerpIsolatedPositionUpdated, both PerpMarginUpdated, final PerpNamespaceTakenOver(...,marketId,ISOLATED).
  • Expected errors: OnlyAccountCore, same/destination account, mode/liquidation, price/threshold/health, nonempty destination, balance/numeric, reentrancy errors.

Exact call data

takeoverIsolatedPosition(uint40,uint32,uint40)
  • Selector: 0x1838b519
  • Mutability: nonpayable
  • Semantic rule: perp-engine.takeover.takeover-isolated-position
  • Call path: account-core

transferOwnership(address)

payable 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: payable
  • 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

writeFunding(uint32,uint96,bool,uint64)

state-changing ABI callable account-core/funding-updater 0xae71103f

Applies a signed funding delta for a market.

Parameters and behavior

Inputs

  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.
  • fundingDeltaAbs — uint96. Signed or absolute cumulative funding in the Engine's quote-per-base-size scale; sign may be stored separately.
  • fundingDeltaNegative — bool. Boolean flag named fundingDeltaNegative.
  • timestamp — uint64. Unix timestamp in seconds; zero-sentinel behavior is function-specific.

Returns

  • No return value.

Access and behavior

  • Who can call: Configured AccountCore only (AccountCore authenticates the funding updater).
  • Requirements: Registered market, elapsed funding interval, monotonic timestamp, representable signed cumulative value.
  • State effects: Applies signed delta to cumulative funding and records timestamp/sign flag.
  • Units and rounding: Absolute funding uses uint96 quote-per-base-lot scale; sign boolean; timestamp seconds.
  • Event families: PerpFundingUpdated.
  • Expected errors: OnlyAccountCore, market/funding interval/timestamp, overflow/underflow and invalid config errors.

Exact call data

writeFunding(uint32,uint96,bool,uint64)
  • Selector: 0xae71103f
  • Mutability: nonpayable
  • Semantic rule: perp-engine.funding-write
  • Call path: account-core/funding-updater

writeFundingInterval(uint32,uint32)

state-changing ABI callable account-core 0x3fa91685

Updates only the market's minimum funding interval.

Parameters and behavior

Inputs

  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.
  • fundingIntervalSeconds — uint32. Duration in seconds.

Returns

  • No return value.

Access and behavior

  • Who can call: Configured AccountCore only.
  • Requirements: Market must be registered and the supplied interval must satisfy Engine configuration validation.
  • State effects: Replaces only one market's funding-update cadence.
  • Units and rounding: fundingIntervalSeconds is a duration in seconds.
  • Event families: PerpFundingIntervalUpdated with market ID, old interval, and new interval.
  • Expected errors: OnlyAccountCore, MarketNotFound, InvalidMarketConfig.

Exact call data

writeFundingInterval(uint32,uint32)
  • Selector: 0x3fa91685
  • Mutability: nonpayable
  • Semantic rule: perp-engine.risk-config.write-funding-interval
  • Call path: account-core

writeMarketRiskParams(uint32,(uint32,uint32,uint32,uint32,uint32,uint32,uint96,uint32,uint32,uint96,uint96))

state-changing ABI callable account-core 0xf031d8f2

Updates only mutable market risk parameters.

Parameters and behavior

Inputs

  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.
  • params — struct IPerpEngine.PerpMarketRiskParams. Structured struct IPerpEngine.PerpMarketRiskParams; field-level units are defined in the type catalog and tuple metadata.

Returns

  • No return value.

Access and behavior

  • Who can call: Configured AccountCore only.
  • Requirements: Registered market; every replacement risk factor, leverage, staleness, order cap, position cap, and liquidation threshold must pass Engine validation.
  • State effects: Replaces only risk/admission/liquidation parameters; funding cadence, prices, fees, precisions, and status remain unchanged.
  • Units and rounding: Tuple fields use PPS factors, E6 leverage, seconds, and base-lot/order-count caps as cataloged field-by-field.
  • Event families: PerpMarketRiskParamsUpdated.
  • Expected errors: OnlyAccountCore, MarketNotFound, InvalidMarketConfig, size/factor/leverage/cap errors.

Exact call data

writeMarketRiskParams(uint32,(uint32,uint32,uint32,uint32,uint32,uint32,uint96,uint32,uint32,uint96,uint96))
  • Selector: 0xf031d8f2
  • Mutability: nonpayable
  • Semantic rule: perp-engine.risk-config.write-market-risk-params
  • Call path: account-core

writeMarketStatus(uint32,uint8,uint24)

state-changing ABI callable owner/perp-router 0xd0bf134d

Updates only the market's operational status and flags.

Parameters and behavior

Inputs

  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.
  • status — uint8. Unitless enum/status value; valid members are in types and constants or the enclosing ABI tuple type.
  • flags — uint24. Unsigned bitmask; named bit definitions are in types and constants.

Returns

  • No return value.

Access and behavior

  • Who can call: PerpEngine owner, normally PerpRouter.
  • Requirements: Market must be registered; status and full uint24 flags word must satisfy the Engine's packed-state validation.
  • State effects: Replaces only status and flags for one market; all price, funding, risk, and cap fields remain unchanged.
  • Units and rounding: Status is enum-like uint8; flags are a uint24 bitmask including the stored funding-sign bit.
  • Event families: PerpMarketStatusUpdated with old/new status and old/new flags.
  • Expected errors: Unauthorized, MarketNotFound, InvalidMarketConfig, status/flag errors.

Exact call data

writeMarketStatus(uint32,uint8,uint24)
  • Selector: 0xd0bf134d
  • Mutability: nonpayable
  • Semantic rule: perp-engine.market-register.write-market-status
  • Call path: owner/perp-router

writePrices(uint32,uint32,uint32,uint32,uint64)

state-changing ABI callable account-core/price-updater 0xe6938ad0

Updates oracle, index, and mark prices for a market.

Parameters and behavior

Inputs

  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.
  • markPrice — uint32. Integer market price units; human quote/base price = value / market pricePrecision; order prices must be tick aligned where required.
  • indexPrice — uint32. Integer market price units; human quote/base price = value / market pricePrecision; order prices must be tick aligned where required.
  • oraclePrice — uint32. Integer market price units; human quote/base price = value / market pricePrecision; order prices must be tick aligned where required.
  • timestamp — uint64. Unix timestamp in seconds; zero-sentinel behavior is function-specific.

Returns

  • No return value.

Access and behavior

  • Who can call: Configured AccountCore only (AccountCore authenticates the price updater).
  • Requirements: Registered operational market, nonzero values, timestamp/freshness rules, and bounded index-oracle divergence.
  • State effects: Stores mark, index, oracle, and update timestamp.
  • Units and rounding: Prices are uint32 market units; timestamp Unix seconds.
  • Event families: PerpPricesUpdated.
  • Expected errors: OnlyAccountCore, MarketNotFound, PriceError, timestamp/freshness and divergence errors.

Exact call data

writePrices(uint32,uint32,uint32,uint32,uint64)
  • Selector: 0xe6938ad0
  • Mutability: nonpayable
  • Semantic rule: perp-engine.prices
  • Call path: account-core/price-updater

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. Returns the AccountCore authorized to mutate Engine accounting.
  • 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

CROSS_MARGIN_MARKET_ID()

view ABI callable public-read 0x9d7047f7

Returns the cross margin market ID constant.

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

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

CROSS_SLOT_UNSET()

view ABI callable public-read 0xd65ffb12

Returns the cross slot unset constant.

Parameters and behavior

Inputs

  • None.

Returns

  • result0 — uint8. Maker slot index/count; live order slots are 0..61 and higher reserved values are not user slots.

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 _: uint8 — Maker slot index/count; live order slots are 0..61 and higher reserved values are not user slots.
  • 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

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

getCrossMakerFeeReserve(uint40)

view ABI callable public-read 0x77ee1a95

Returns maker-fee escrow reserved across all cross positions in this Engine.

Parameters and behavior

Inputs

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

Returns

  • result0 — uint256. Raw quote-token units reserved to guarantee maker fees on resting Perp orders.

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 _: uint256 — Raw quote-token units reserved to guarantee maker fees on resting Perp orders. Returns maker-fee escrow reserved across all cross positions in this 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

getCrossMakerFeeReserve(uint40)
  • Selector: 0x77ee1a95
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

getCrossMarginBalance(uint40)

view ABI callable public-read 0x20f70340

Returns the account's margin balance in the Engine-wide cross namespace.

Parameters and behavior

Inputs

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

Returns

  • result0 — uint256. 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 _: uint256 — Raw atomic units of the applicable quote/token asset; human amount = value / that asset's decimal scale. Returns the account's margin balance in the Engine-wide cross namespace.
  • 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

getCrossMarginBalance(uint40)
  • Selector: 0x20f70340
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

getCrossMarginThresholds(uint40)

view ABI callable public-read 0x0824500c

Returns Phoenix-style risk thresholds for an account's Engine-wide cross-margin namespace.

Parameters and behavior

Inputs

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

Returns

  • thresholds — struct IPerpEngine.MarginThresholds. Structured struct IPerpEngine.MarginThresholds; 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 thresholds: struct IPerpEngine.MarginThresholds — Structured struct IPerpEngine.MarginThresholds; field-level units are defined in the type catalog and tuple metadata. Returns Phoenix-style risk thresholds for an account's Engine-wide cross-margin namespace.
  • 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

getCrossMarginThresholds(uint40)
  • Selector: 0x0824500c
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

getCrossPosition(uint40,uint8)

view ABI callable public-read 0x63165623

Returns one cross position by its compact account-local slot.

Parameters and behavior

Inputs

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

Returns

  • position — struct PerpPositionLib.PositionState. Structured struct PerpPositionLib.PositionState; 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 position: struct PerpPositionLib.PositionState — Structured struct PerpPositionLib.PositionState; field-level units are defined in the type catalog and tuple metadata. Returns one cross position by its compact account-local slot.
  • 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

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

getCrossPositionSlot(uint40,uint32)

view ABI callable public-read 0xde93579b

Returns the cross position slot for an account-market pair, or the unset sentinel when not cross.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.

Returns

  • slotIdx — uint8. Maker slot index/count; live order slots are 0..61 and higher reserved values are not user slots.

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 slotIdx: uint8 — Maker slot index/count; live order slots are 0..61 and higher reserved values are not user slots. Returns the cross position slot for an account-market pair, or the unset sentinel when not cross.
  • 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

getCrossPositionSlot(uint40,uint32)
  • Selector: 0xde93579b
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

getCrossRestingOrderCount(uint40)

view ABI callable public-read 0xed899112

Returns the account-wide number of resting cross-margin orders across Engine markets.

Parameters and behavior

Inputs

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

Returns

  • result0 — uint16. Unitless integer count or zero-based index, as named.

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 _: uint16 — Unitless integer count or zero-based index, as named. Returns the account-wide number of resting cross-margin orders across Engine markets.
  • 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

getCrossRestingOrderCount(uint40)
  • Selector: 0xed899112
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

getCrossTransferRequirement(uint40)

view ABI callable public-read 0x2a47b0a8

Returns the margin requirement for transfers out of the account's cross-margin namespace.

Parameters and behavior

Inputs

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

Returns

  • requirement — struct IPerpEngine.TransferRequirement. Structured struct IPerpEngine.TransferRequirement; 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 requirement: struct IPerpEngine.TransferRequirement — Structured struct IPerpEngine.TransferRequirement; field-level units are defined in the type catalog and tuple metadata. Returns the margin requirement for transfers out of the account's cross-margin namespace.
  • 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

getCrossTransferRequirement(uint40)
  • Selector: 0x2a47b0a8
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

getCrossWithdrawableMargin(uint40)

view ABI callable public-read 0x1a291255

Returns the current amount withdrawable from cross margin under transfer rules.

Parameters and behavior

Inputs

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

Returns

  • result0 — uint256. 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 _: uint256 — Raw atomic units of the applicable quote/token asset; human amount = value / that asset's decimal scale. Returns the current amount withdrawable from cross margin under transfer rules.
  • 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

getCrossWithdrawableMargin(uint40)
  • Selector: 0x1a291255
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

getIsolatedMakerFeeReserve(uint40,uint32)

view ABI callable public-read 0x1ffd23c8

Returns the maker-fee escrow reserved by an isolated market position.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.

Returns

  • result0 — uint96. Raw quote-token units reserved to guarantee maker fees on resting Perp orders.

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 quote-token units reserved to guarantee maker fees on resting Perp orders. Returns the maker-fee escrow reserved by an isolated market position.
  • 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

getIsolatedMakerFeeReserve(uint40,uint32)
  • Selector: 0x1ffd23c8
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

getIsolatedMarginBalance(uint40,uint32)

view ABI callable public-read 0x6f54928a

Returns the account's isolated margin balance for a market.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.

Returns

  • result0 — uint256. 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 _: uint256 — Raw atomic units of the applicable quote/token asset; human amount = value / that asset's decimal scale. Returns the account's isolated margin balance for a market.
  • 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

getIsolatedMarginBalance(uint40,uint32)
  • Selector: 0x6f54928a
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

getIsolatedMarginThresholds(uint40,uint32)

view ABI callable public-read 0x61e8d1b5

Returns Phoenix-style risk thresholds for an account's isolated market namespace.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.

Returns

  • thresholds — struct IPerpEngine.MarginThresholds. Structured struct IPerpEngine.MarginThresholds; 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 thresholds: struct IPerpEngine.MarginThresholds — Structured struct IPerpEngine.MarginThresholds; field-level units are defined in the type catalog and tuple metadata. Returns Phoenix-style risk thresholds for an account's isolated market namespace.
  • 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

getIsolatedMarginThresholds(uint40,uint32)
  • Selector: 0x61e8d1b5
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

getIsolatedPosition(uint40,uint32)

view ABI callable public-read 0xbd5df3a1

Returns the isolated position state for an account-market pair.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.

Returns

  • result0 — struct PerpPositionLib.PositionState. Structured struct PerpPositionLib.PositionState; 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 _: struct PerpPositionLib.PositionState — Structured struct PerpPositionLib.PositionState; field-level units are defined in the type catalog and tuple metadata. Returns the isolated position state for an account-market pair.
  • 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

getIsolatedPosition(uint40,uint32)
  • Selector: 0xbd5df3a1
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

getIsolatedTransferRequirement(uint40,uint32)

view ABI callable public-read 0xdd359dcb

Returns the margin requirement for transfers out of an isolated market namespace.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.

Returns

  • requirement — struct IPerpEngine.TransferRequirement. Structured struct IPerpEngine.TransferRequirement; 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 requirement: struct IPerpEngine.TransferRequirement — Structured struct IPerpEngine.TransferRequirement; field-level units are defined in the type catalog and tuple metadata. Returns the margin requirement for transfers out of an isolated market namespace.
  • 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

getIsolatedTransferRequirement(uint40,uint32)
  • Selector: 0xdd359dcb
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

getIsolatedWithdrawableMargin(uint40,uint32)

view ABI callable public-read 0xfe2c1847

Returns the current amount withdrawable from isolated margin under transfer rules.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.

Returns

  • result0 — uint256. 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 _: uint256 — Raw atomic units of the applicable quote/token asset; human amount = value / that asset's decimal scale. Returns the current amount withdrawable from isolated margin under transfer rules.
  • 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

getIsolatedWithdrawableMargin(uint40,uint32)
  • Selector: 0xfe2c1847
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

getMarginBalance(uint40,uint32)

view ABI callable public-read 0x07e3e68b

Returns cross balance for marketId 0, otherwise isolated balance for marketId.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.

Returns

  • result0 — uint256. 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 _: uint256 — Raw atomic units of the applicable quote/token asset; human amount = value / that asset's decimal scale. Returns cross balance for marketId 0, otherwise isolated balance for marketId.
  • 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

getMarginBalance(uint40,uint32)
  • Selector: 0x07e3e68b
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

getMarket(uint32)

view ABI callable public-read 0xc2c79dec

Returns a market's packed hot risk/state record.

Parameters and behavior

Inputs

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

Returns

  • result0 — struct PerpMarketPageLib.MarketState. Structured struct PerpMarketPageLib.MarketState; 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 _: struct PerpMarketPageLib.MarketState — Structured struct PerpMarketPageLib.MarketState; field-level units are defined in the type catalog and tuple metadata. Returns a market's packed hot risk/state record.
  • 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

getMarket(uint32)
  • Selector: 0xc2c79dec
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

getPositionMode(uint40,uint32)

view ABI callable public-read 0xf7215620

Returns whether this account-market pair is risked through cross, isolated, or neither.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.

Returns

  • result0 — enum IPerpEngine.PositionMode. Numeric Solidity enum enum IPerpEngine.PositionMode; 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 IPerpEngine.PositionMode — Numeric Solidity enum enum IPerpEngine.PositionMode; member values are listed in types and constants. Returns whether this account-market pair is risked through cross, isolated, or neither.
  • 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

getPositionMode(uint40,uint32)
  • Selector: 0xf7215620
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

hasIsolatedPosition(uint40,uint32)

view ABI callable public-read 0xbce3eb10

Returns whether the isolated namespace has nonzero position or order exposure.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.

Returns

  • result0 — bool. Boolean flag named 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 _: bool — Boolean flag named value. Returns whether the isolated namespace has nonzero position or order exposure.
  • 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

hasIsolatedPosition(uint40,uint32)
  • Selector: 0xbce3eb10
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

isCrossLiquidating(uint40)

view ABI callable public-read 0x5c5c100a

Returns whether the complete cross namespace is liquidation-locked.

Parameters and behavior

Inputs

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

Returns

  • result0 — bool. Boolean flag named 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 _: bool — Boolean flag named value. Returns whether the complete cross namespace is liquidation-locked.
  • 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

isCrossLiquidating(uint40)
  • Selector: 0x5c5c100a
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

isIsolatedLiquidating(uint40,uint32)

view ABI callable public-read 0xbbb1a83f

Returns whether one isolated market namespace is liquidation-locked.

Parameters and behavior

Inputs

  • accountId — uint40. AccountCore account ID (uint40 in protocol state); zero denotes missing/unregistered unless explicitly allowed.
  • marketId — uint32. Global Perp market ID (uint32); market ID 0 is reserved as the cross-margin namespace within an Engine.

Returns

  • result0 — bool. Boolean flag named 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 _: bool — Boolean flag named value. Returns whether one isolated market namespace is liquidation-locked.
  • 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

isIsolatedLiquidating(uint40,uint32)
  • Selector: 0xbbb1a83f
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

isMarketRegistered(uint32)

view ABI callable public-read 0x149e7f41

Returns whether a perp market id has been registered.

Parameters and behavior

Inputs

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

Returns

  • result0 — bool. Boolean flag named 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 _: bool — Boolean flag named value. Returns whether a perp market id has been registered.
  • 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

isMarketRegistered(uint32)
  • Selector: 0x149e7f41
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-read

maxCrossRestingOrders()

view ABI callable public-read 0x4eab14eb

Returns the maximum resting-order count permitted for a cross-margin account.

Parameters and behavior

Inputs

  • None.

Returns

  • result0 — uint16. Unitless integer count or zero-based index, as named.

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 _: uint16 — Unitless integer count or zero-based index, as named.
  • 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

maxCrossRestingOrders()
  • Selector: 0x4eab14eb
  • 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

  • result — 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 result: address — EVM address; zero-address allowance/sentinel meaning is stated by the function semantics. Returns the owner of the contract.
  • 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

ownershipHandoverExpiresAt(address)

view ABI callable public-read 0xfee81cf4

Returns when a pending ownership handover expires.

Parameters and behavior

Inputs

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

Returns

  • result — uint256. 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 result: uint256 — Unix timestamp in seconds; zero-sentinel behavior is function-specific. Returns the expiry timestamp for the two-step ownership handover to pendingOwner.
  • 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

ownershipHandoverExpiresAt(address)
  • Selector: 0xfee81cf4
  • 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.PerpEngine.proxiableUUID
  • Call path: implementation-read

quoteAsset()

view ABI callable public-read 0xfdf262b7

Returns the single asset used for margin, PnL, funding, and fees in this Engine.

Parameters and behavior

Inputs

  • None.

Returns

  • result0 — address. EVM asset address; address(0) denotes native MON only on explicitly native-aware AccountCore/periphery paths.

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 asset address; address(0) denotes native MON only on explicitly native-aware AccountCore/periphery paths. Returns the single asset used for margin, PnL, funding, and fees in this 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

quoteAsset()
  • Selector: 0xfdf262b7
  • Mutability: view
  • Semantic rule: read.public
  • Call path: public-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. Returns the decimal scale used to express quote amounts.
  • 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

validateOrderAdmission((uint40,uint32,bool,bool,uint96,uint8,uint8))

view ABI callable account-core-read-validation 0x11067371

Validates whether a future perp orderbook action is admissible under current market/account risk.

Parameters and behavior

Inputs

  • admission — struct IPerpEngine.PerpOrderAdmission. Structured struct IPerpEngine.PerpOrderAdmission; field-level units are defined in the type catalog and tuple metadata.

Returns

  • No return value.

Access and behavior

  • Who can call: Configured AccountCore only.
  • Requirements: onlyAccountCore; validates market, mode, liquidation, price, order exposure, reduce-only, open-interest, order-count, and margin admission.
  • State effects: No state mutation. Returns no data; success means admission is allowed and a revert selector identifies the failed invariant. Validates whether a future perp orderbook action is admissible under current market/account risk. Callable only by AccountCore.
  • 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

validateOrderAdmission((uint40,uint32,bool,bool,uint96,uint8,uint8))
  • Selector: 0x11067371
  • Mutability: view
  • Semantic rule: read.PerpEngine.validateOrderAdmission
  • Call path: account-core-read-validation