Skip to main content
Perpetra combines an off-chain orderbook with on-chain settlement. This page walks through what that means end to end, from the moment you submit an order to the moment your position is live.

The hybrid model

1

You sign an order, not send a transaction

Placing an order doesn’t cost gas and isn’t a blockchain transaction. Instead, your wallet signs an EIP-712 typed message describing the order: market, side, size, price, leverage. The signature proves the order came from you without broadcasting anything on-chain yet.
2

The matching engine looks for a counterparty

Your signed order is sent to Perpetra’s off-chain matching engine, which holds the live orderbook in memory. It checks incoming orders against resting orders on the opposite side and looks for a price match.
3

A match triggers on-chain settlement

Once two orders match, the matching engine hands the fill off to be settled on-chain. A transaction is submitted to Perpetra’s contracts, which validate the match, move collateral, and update both traders’ positions.
4

Your position is now on-chain

From this point, your position (size, entry price, collateral, accrued funding) lives in Perpetra’s on-chain position registry, the same as it would on a fully on-chain orderbook. Nothing about your custody or final state depends on the off-chain engine staying up.
Perpetra supports both limit orders, which rest on the book at your price until they’re filled, and market orders, which match immediately against the best available price on the opposite side.

Why not a pooled-liquidity model?

Pool-based perpetuals (like GMX) let traders take the opposite side of a shared liquidity vault, with price derived from an oracle rather than an orderbook. That model needs less counterparty depth to get going, but it means every trader is effectively trading against the pool, and pricing follows the oracle rather than real bid/ask activity. Perpetra’s orderbook model means:
  • Prices reflect actual resting orders, not just an oracle feed
  • Liquidity providers aren’t on the other side of every trade; other traders are
  • Limit orders behave like limit orders: they sit at your price until filled
The tradeoff is that an orderbook needs depth to have tight spreads and reliable fills, which is why Perpetra runs market-making keepers to keep the book populated (more on this in Protocol Architecture).

Keeping prices honest

Because matching happens off-chain, Perpetra needs a way to make sure the price you trade at doesn’t drift too far from the real market. Two mechanisms handle this:
  • Mark price: a smoothed reference price (index price plus an EMA-adjusted premium) used for PnL and liquidation calculations, so a single stale or manipulated orderbook print can’t trigger unfair liquidations. See Mark Price & Index Price.
  • Funding rate: a periodic payment between longs and shorts that pushes the perpetual’s price back toward the spot price whenever they drift apart. See Funding Rate.

What’s next

  • New to placing an order? Start with Placing Orders.
  • Want the contract-level view of this same flow? See Order Lifecycle in Protocol Architecture.