Skip to content

Paxeer Network

PoolFacet API Reference

The PoolFacet manages pool creation, initialization, and state queries. Pool creation is permissionless -- anyone can create a pool.

Functions

createPool

Creates a new liquidity pool. Permissionless -- no owner restriction.

solidity
function createPool(PoolConfig calldata config) external returns (bytes32 poolId)

Parameters:

NameTypeDescription
config.token0addressFirst token address (will be sorted)
config.token1addressSecond token address (will be sorted)
config.poolTypePoolType0 = Standard, 1 = OraclePegged
config.tickSpacinguint24Tick spacing (1 - 16384)
config.sigmoidAlphauint256Sigmoid steepness parameter (Q128.128)
config.sigmoidKuint256Max deviation factor (Q128.128)
config.baseFeeuint256Base fee in basis points (max 10000)
config.maxImpactFeeuint256Max impact fee in basis points (max 10000)

Returns: bytes32 poolId - unique identifier for the pool

Events: PoolCreated, PoolCreatedDetailed (via EventEmitter)

Reverts:

  • "PoolFacet: invalid tick spacing" - tickSpacing is 0 or > 16384
  • "PoolFacet: baseFee > 100%" - baseFee exceeds 10000 bps
  • "PoolFacet: maxImpactFee > 100%" - maxImpactFee exceeds 10000 bps
  • "PoolAlreadyExists" - pool with same tokens and tickSpacing exists

initializePool

Sets the initial price for a pool.

solidity
function initializePool(bytes32 poolId, uint160 sqrtPriceX96) external

Parameters:

NameTypeDescription
poolIdbytes32The pool identifier
sqrtPriceX96uint160Initial sqrt price in Q64.96 format

Reverts:

  • "PoolNotFound" - pool does not exist
  • "PoolAlreadyInitialized" - pool is already initialized

getPoolState

Returns the current state of a pool.

solidity
function getPoolState(bytes32 poolId) external view returns (PoolState memory)

Returns:

FieldTypeDescription
sqrtPriceX96uint160Current sqrt price
currentTickint24Current tick index
liquidityuint128Active liquidity
reserve0uint256Token0 reserves
reserve1uint256Token1 reserves
feeGrowthGlobal0X128uint256Cumulative fee growth for token0
feeGrowthGlobal1X128uint256Cumulative fee growth for token1
protocolFees0uint256Uncollected protocol fees (token0)
protocolFees1uint256Uncollected protocol fees (token1)
lastObservationTimestampuint32Last oracle observation timestamp
initializedboolWhether the pool has been initialized

computePoolId

Computes the deterministic pool ID from token pair and tick spacing.

solidity
function computePoolId(address token0, address token1, uint24 tickSpacing) 
    external pure returns (bytes32)

Tokens are automatically sorted, so order does not matter.

poolExists

Checks if a pool exists.

solidity
function poolExists(bytes32 poolId) external view returns (bool)

getPoolCount

Returns the total number of pools.

solidity
function getPoolCount() external view returns (uint256)

getPoolConfig

Returns the configuration of a pool.

solidity
function getPoolConfig(bytes32 poolId) external view returns (PoolConfig memory)

getAllPoolIds

Returns all pool IDs.

solidity
function getAllPoolIds() external view returns (bytes32[] memory)

pause / unpause

Emergency pause/unpause (owner only).

solidity
function pause() external
function unpause() external

setEventEmitter

Sets the EventEmitter contract address (owner only).

solidity
function setEventEmitter(address emitter) external

getPoolCreator

Returns the address that created a pool.

solidity
function getPoolCreator(bytes32 poolId) external view returns (address)

---

---

## License

Licensed under the **GNU General Public License v3.0**--see [LICENSE](../../LICENSE) for terms.

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


## Contact & Resources

| Resource | Link |
|----------|------|
| **Protocol Documentation** | [docs.hyperpaxeer.com](https://docs.hyperpaxeer.com) |
| **Block Explorer** | [paxscan.paxeer.app](https://paxscan.paxeer.app) |
| **Sidiora Exchange** | [app.hyperpaxeer.com](https://sidiora.hyperpaxeer.com) |
| **Website** | [paxeer.app](https://paxeer.app) |
| **Twitter/X** | [@paxeer_app](https://x.com/paxeer_app) |
| **General Inquiries** | [infopaxeer@paxeer.app](mailto:infopaxeer@paxeer.app) |
| **Security Reports** | [security@paxeer.app](mailto:security@paxeer.app) |

Released under the GPL-3.0 License.