Skip to content

Paxeer Network

OrderFacet API Reference

The OrderFacet implements an on-chain order book with tick-aligned limit and stop orders.

Types

OrderType

  • Limit (0) - Executes when pool price reaches target tick
  • Stop (1) - Executes when oracle price crosses threshold

OrderStatus

  • Active (0) - Order is open
  • PartiallyFilled (1) - Partially executed
  • Filled (2) - Fully executed
  • Cancelled (3) - Cancelled by owner
  • Expired (4) - Past expiry timestamp

Functions

placeOrder

Place a new limit or stop order.

solidity
function placeOrder(PlaceOrderParams calldata params) external returns (uint256 orderId)

Parameters (PlaceOrderParams):

NameTypeDescription
poolIdbytes32Target pool
orderTypeOrderType0 = Limit, 1 = Stop
zeroForOneboolDirection: true = sell token0 for token1
targetTickint24Tick at which order executes
amountuint256Total amount to trade
expiryuint256Expiration timestamp (0 = default TTL of 30 days)

cancelOrder

Cancel an active order and refund deposited tokens.

solidity
function cancelOrder(uint256 orderId) external

Only the order owner can cancel.

executeOrder

Execute a pending order. Callable by anyone (keeper bounty incentive).

solidity
function executeOrder(uint256 orderId) external returns (uint256 amountOut, uint256 bounty)

Keepers earn 0.01% of order value as bounty.

getOrder

Get order details.

solidity
function getOrder(uint256 orderId) external view returns (Order memory)

getOrdersAtTick

Get all active order IDs at a given tick.

solidity
function getOrdersAtTick(bytes32 poolId, int24 tick) external view returns (uint256[] memory)

getActiveOrderCount

Get total active orders for a pool.

solidity
function getActiveOrderCount(bytes32 poolId) external view returns (uint256)

License

Licensed under the GNU General Public License v3.0--see LICENSE for terms.

Copyright (C) 2026 PaxLabs Inc.
SPDX-License-Identifier: GPL-3.0-only

Contact & Resources

ResourceLink
Protocol Documentationdocs.hyperpaxeer.com
Block Explorerpaxscan.paxeer.app
Sidiora Exchangeapp.hyperpaxeer.com
Websitepaxeer.app
Twitter/X@paxeer_app
General Inquiriesinfopaxeer@paxeer.app
Security Reportssecurity@paxeer.app

Released under the GPL-3.0 License.