PerpEngine functions¶
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()¶¶
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)¶¶
Clears a cross liquidation lock after maintenance health has recovered.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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)¶¶
Clears an isolated liquidation lock after maintenance health has recovered.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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:
PerpIsolatedPositionUpdatedwith the liquidation flag cleared, thenPerpLiquidationCleared(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)¶¶
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:
OwnershipTransferredonly; clearing the request emits noOwnershipHandoverCanceled. - 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)¶¶
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 (uint40in 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)thenPerpMarginUpdated. - 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)¶¶
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 (uint40in 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)thenPerpMarginUpdated. - 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)[])¶¶
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, andPerpPositionModeUpdatedas applicable; AccountCore separately emitsPerpFeeCharged,PerpProtocolFeesAccrued, and conditionalBuilderFeeAccrued. - 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)¶¶
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, normally10 ** 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, thenInitialized. - 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)¶¶
Reduces a locked cross position through its market's normal FIFO orderbook.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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 conditionalPerpLiquidationCleared(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)¶¶
Reduces a locked isolated position through its market's normal FIFO orderbook.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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 conditionalPerpLiquidationCleared(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)¶¶
Moves a cross position into isolated mode with the requested collateral amount.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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_UNSETsentinel. - Event families:
PerpIsolatedPositionUpdated,PerpPositionModeUpdated(CROSS,ISOLATED),PerpCrossPositionSlotUpdated(...,false), cross and isolatedPerpMarginUpdated,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)¶¶
Moves an isolated position and all isolated margin for its market into cross margin.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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 crossPerpMarginUpdated,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)¶¶
Moves margin between cross and isolated namespaces for the same account.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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 destinationPerpMarginTransferred(...,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))¶¶
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:
PerpMarketUpdatedwith 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()¶¶
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()¶¶
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)¶¶
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)¶¶
Crystallizes an account's current funding into its stored margin namespace.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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 namedemitZero.
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
PerpMarginUpdatedwhen funding is nonzero;PerpIsolatedPositionUpdatedwhen mode is ISOLATED; thenPerpFundingSettledwhen funding is nonzero oremitZerois 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[])¶¶
Locks an unhealthy cross namespace and atomically cancels its orders in the supplied markets.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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 conditionalPerpMarginUpdated,PerpMakerFeeReserveUpdated, andPerpOrderExposureUpdatedin that order; finalPerpLiquidationStarted(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)¶¶
Locks an unhealthy isolated namespace and atomically cancels its market orders.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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
PerpIsolatedPositionUpdatedsets the liquidation flag; bookBookUpdatesPacked; per cancellation conditionalPerpMarginUpdated,PerpMakerFeeReserveUpdated, thenPerpOrderExposureUpdated; a resulting isolated-position snapshot; if recovered, anotherPerpIsolatedPositionUpdatedclears the flag; finalPerpLiquidationStarted(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)¶¶
Transfers an insolvent account's complete cross namespace to an empty, healthy destination.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in protocol state); zero denotes missing/unregistered unless explicitly allowed.destinationId—uint40. AccountCore account ID (uint40in 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
PerpPositionModeUpdatedandPerpCrossPositionSlotUpdatedper market; source/destinationPerpMarginUpdated; finalPerpNamespaceTakenOver(...,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)¶¶
Transfers one insolvent isolated position and its margin to a healthy destination namespace.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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 (uint40in 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, sourcePerpIsolatedPositionCleared, destinationPerpIsolatedPositionUpdated, bothPerpMarginUpdated, finalPerpNamespaceTakenOver(...,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)¶¶
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:
payable - 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
writeFunding(uint32,uint96,bool,uint64)¶¶
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 namedfundingDeltaNegative.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
uint96quote-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)¶¶
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:
fundingIntervalSecondsis a duration in seconds. - Event families:
PerpFundingIntervalUpdatedwith 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))¶¶
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)¶¶
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
uint24flags 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 auint24bitmask including the stored funding-sign bit. - Event families:
PerpMarketStatusUpdatedwith 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)¶¶
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
uint32market 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()¶¶
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/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
CROSS_MARGIN_MARKET_ID()¶¶
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/purecall. - 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()¶¶
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/purecall. - 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)¶¶
Returns maker-fee escrow reserved across all cross positions in this Engine.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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/purecall. - 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)¶¶
Returns the account's margin balance in the Engine-wide cross namespace.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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/purecall. - 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)¶¶
Returns Phoenix-style risk thresholds for an account's Engine-wide cross-margin namespace.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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/purecall. - 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)¶¶
Returns one cross position by its compact account-local slot.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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/purecall. - 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)¶¶
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 (uint40in 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/purecall. - 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)¶¶
Returns the account-wide number of resting cross-margin orders across Engine markets.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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/purecall. - 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)¶¶
Returns the margin requirement for transfers out of the account's cross-margin namespace.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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/purecall. - 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)¶¶
Returns the current amount withdrawable from cross margin under transfer rules.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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/purecall. - 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)¶¶
Returns the maker-fee escrow reserved by an isolated market position.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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/purecall. - 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)¶¶
Returns the account's isolated margin balance for a market.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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/purecall. - 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)¶¶
Returns Phoenix-style risk thresholds for an account's isolated market namespace.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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/purecall. - 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)¶¶
Returns the isolated position state for an account-market pair.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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/purecall. - 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)¶¶
Returns the margin requirement for transfers out of an isolated market namespace.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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/purecall. - 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)¶¶
Returns the current amount withdrawable from isolated margin under transfer rules.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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/purecall. - 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)¶¶
Returns cross balance for marketId 0, otherwise isolated balance for marketId.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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/purecall. - 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)¶¶
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/purecall. - 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)¶¶
Returns whether this account-market pair is risked through cross, isolated, or neither.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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/purecall. - 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)¶¶
Returns whether the isolated namespace has nonzero position or order exposure.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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 namedvalue.
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 namedvalue. 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/purecall. - 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)¶¶
Returns whether the complete cross namespace is liquidation-locked.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in protocol state); zero denotes missing/unregistered unless explicitly allowed.
Returns
result0—bool. Boolean flag namedvalue.
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 namedvalue. 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/purecall. - 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)¶¶
Returns whether one isolated market namespace is liquidation-locked.
Parameters and behavior
Inputs
accountId—uint40. AccountCore account ID (uint40in 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 namedvalue.
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 namedvalue. 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/purecall. - 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)¶¶
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 namedvalue.
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 namedvalue. 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/purecall. - 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()¶¶
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/purecall. - 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()¶¶
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/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
ownershipHandoverExpiresAt(address)¶¶
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 topendingOwner. - 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
ownershipHandoverExpiresAt(address)
- Selector:
0xfee81cf4 - 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.PerpEngine.proxiableUUID - Call path:
implementation-read
quoteAsset()¶¶
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/purecall. - 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()¶¶
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. 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/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
validateOrderAdmission((uint40,uint32,bool,bool,uint96,uint8,uint8))¶¶
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/purecall. - 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