Thesettlementlayerforthemachineeconomy.

Paxeer chain

On-chain intents, matching in LayerX

Exchange intents and margin

Record margin moves and orders on the Paxeer chain; the agent domain matches them.

Call the layerxExchange precompile to deposit margin, place or cancel an order, request settlement, or request a margin release. Each write checks the shape of the request, stores a pending intent under a deterministic id, and emits one indexed EVM log for the LayerX intent router. Matching, fills, funding and liquidation run in LayerX, not on the chain. Views return perps state proven against a finalized state root from a witness you supply.

What it does

The layerxExchange precompile at 0x0000000000000000000000000000000000001015 lets an EVM caller deposit margin, request a margin release, place an order, cancel an order and request settlement of a position. Each write checks the shape of the request, records a pending intent under a deterministic intent id, and emits an EVM log for the LayerX intent router. Matching happens in the LayerX agent domain: the Paxeer chain checks only the shape of the order. Read methods return LayerX perps state proven under the finalized state root of a batch, from a witness the caller supplies.

Key capabilities

  • Deposit native PAX, or a bank denom addressed by its ERC20 pointer, as margin of a LayerX account.
  • Record order intents with side buy or sell and GTC, IOC, FOK or post-only time in force.
  • Cancel an order, request settlement of a position, or request a margin release.
  • Read proven market, order, position and margin records against a finalized LayerX state root.
  • Emit one indexed EVM log per intent, carrying the intent id and the owner's nonce.
  • Reject any order whose market is not listed and enabled in module params.

Who it's for

Developers building trading contracts, front ends or indexers against LayerX markets.

Why it matters

An order or margin move gets an on-chain record with a stable identifier before LayerX acts on it, so a contract or an indexer can follow it from EVM calldata through to the matched LayerX state. Margin is held in the layerxcustody module account, and its release is paid later by a proof-carrying custody withdrawal rather than by a chain-side transfer.

Differentiators

Views read only LayerX state proven against a finalized state root taken from the custody anchor; nothing is read over the network. Intents are absent from the module's Msg service on purpose, so every intent enters through the precompile and carries an EVM log.

Outcomes

  • Follow an intent from EVM calldata through to matched LayerX state.
  • Read market, order, position and margin records proven under a root.
  • Build the calldata and decode the logs with layerx-sdk helpers.

Technical notes

  • Not an on-chain exchange. No order book, matching, fill, funding or liquidation logic runs on the Paxeer chain, and no code transitions an intent out of pending: on-chain status is only none or pending.
  • Params hold only authority and markets[], up to MaxMarkets (256) unique market ids, each with a margin asset id and an enabled flag. Default params list no markets. Markets are set by authority-only UpdateParams and SetMarket messages.
  • Sides are 1 buy and 2 sell; time in force is 0 GTC, 1 IOC, 2 FOK, 3 post-only. Prices, quantities and amounts must be positive and fit a LayerX u128. Witnesses are bounded by MaxWitnessBytes (64 KiB). Perps state lives in LayerX module 6.
  • The module registers no query service, no gRPC gateway route and no CLI commands; exchange state is read through the precompile.
  • intentId = sha256(abi.encode("LXP/Paxeer/exchange-intent/v1", chainid, precompile, owner, kind, nonce)), with kinds 1 deposit, 2 withdraw, 3 place, 4 cancel, 5 settle and a single 1-based nonce per owner across kinds. Gas is 3000 + 16 per calldata byte + 100 per proof node + 5000 per write, with 11 writes for the two margin deposits and 3 for the other writes.
  • Install layerx-sdk with npm (Node.js 22 or newer) or pip (Python 3.11 or newer); its exchange helpers build the calldata and decode the logs.
import { sendExchangePlaceOrder } from "layerx-sdk";

const txHash = await sendExchangePlaceOrder(wallet, trader, {
  marketId,
  side: 1,
  price: 65000000000n,
  quantity: 500000n,
  timeInForce: 0,
});

More in Paxeer chain

Build on Paxeer.

Give your agent a wallet, set its policy, and settle your first call on LayerX.