Build permissionless perp markets with open infrastructure.
OpenPerps is open-source infrastructure for permissionless perpetual markets, distributed through token launchpads and an OpenPerps reference application. Launchpads integrate once so eligible new tokens can gain a perp market alongside their spot launch.
Status
Pre-launch. Nothing on this page is deployed. The trading engine, price construction, audits and economic testing are release gates. Code samples show the intended shape of the SDK; event names and API schemas are finalised with the engine selection.
- Networks
- Base and Robinhood Chain are target ecosystems, both planned. One chain is validated first.
- Collateral
- One approved stablecoin per deployed chain. Asset and precision to be confirmed.
- Scope at launch
- Isolated markets and isolated margin, market orders with execution protection, LP deposits and withdrawal requests, partner embed.
- Not in scope
- Cross-margin, cross-chain collateral, arbitrary collateral, unrestricted leverage and any protocol token.
Testnet quickstart
The documented path covers one complete market lifecycle: token lookup, market creation, funding, activation, a trade and a withdrawal.
npm install @openperps/sdk # not yet published
import { OpenPerps } from "@openperps/sdk";
const op = new OpenPerps({ chain: "base-sepolia", signer });- 1
Look up a token
Resolve name, symbol, decimals and pool candidates for a token contract on a supported chain. If a canonical market exists, you get it back instead of a duplicate.
TypeScript · illustrative const token = await op.tokens.lookup({ chain: "base-sepolia", address: "0x7a3f…c91e", }); // { symbol: "MEOW", decimals: 18, pools: [...], market: null } - 2
Register the market
Registration is its own transaction with its own status. No paid registration happens before the mandatory compatibility checks pass.
TypeScript · illustrative const { marketId, txHash } = await op.markets.register({ token: token.address, partner: "your-launchpad", // optional attribution }); - 3
Fund the vault
Seed liquidity is optional and separate from registration. A deposit in one market never allocates capital to another market.
TypeScript · illustrative await op.vaults.deposit({ marketId, amount: "5000", asset: "USDC" }); // returns minted shares from the receipt, not an estimate - 4
Watch activation
Read the blockers. Each check reports an observed value, the policy threshold and a timestamp. Waiting states never imply an activation time.
TypeScript · illustrative const s = await op.markets.status(marketId); // s.state === "registered" // s.blockers: [{ check: "observation_history", observed, threshold, at }] - 5
Open and manage a trade
Get a fresh quote, review every cost, then sign. A quote is an estimate until execution; submission is disabled when capacity, margin, freshness or status fails.
TypeScript · illustrative const q = await op.trade.quote({ marketId, side: "long", margin: "100", leverage: 2 }); // q.fee, q.priceImpact, q.liquidationEstimate, q.expiresAt await op.trade.open(q); - 6
Request a withdrawal
Preview the immediately available and queued portions. Track the request and claim when available. Dates are shown only if the mechanism guarantees them.
TypeScript · illustrative const r = await op.vaults.requestWithdrawal({ marketId, shares: "1200" }); // r.immediate, r.queued, r.status
Markets and identity
A market is identified by chain + token contract + collateral. The token symbol is shown for recognition but is never the unique key. Deep links preserve market and chain; a wrong network prompts a switch before any transaction.
Creation is permissionless for eligible tokens. Transparent, automated activation rules replace discretionary listing approvals. Permissionless does not mean every token is immediately safe to trade.
Activation
New positions are impossible until every required check passes. Numeric thresholds are configured in the published risk policy.
| Check | What is observed |
|---|---|
| Usable spot pricing | A supported price source with freshness and deviation checks |
| Observation history | Minimum history of the price source |
| Independent collateral | LP backing supplied to this market’s vault |
| Operational readiness | Keepers, indexer and monitoring healthy for this market |
Market states
Every surface consumes the same authoritative lifecycle. Scroll to follow one market from registration to settlement.
| State | Meaning | User actions |
|---|---|---|
| Registered | Market exists; activation checks are incomplete. | View requirements, seed if allowed. No positions. |
| Ready | Checks pass; activation is pending confirmation. | View progress and eligible liquidity actions. |
| Live | Pricing and risk conditions permit normal operation. | Open within capacity, manage, close, deposit, withdraw. |
| Close only | New exposure is restricted; valid pricing permits reduction. | Reduce or close; add margin where allowed. |
| Paused | Execution cannot proceed safely, or an incident is active. | Inspect status and balances. Only incident-safe actions. |
| Settling | A documented terminal settlement is in progress. | Inspect settlement basis and claim status. |
| Closed | Positions are settled and the market is retired. | Claim eligible balances; view history and receipts. |
Price-integrity failures may require Paused rather than Close only, because closing at an unreliable price is also unsafe. Chain outages and maintenance are operational overlays, distinct from permanent closure.
Action permissions
A single “paused” flag is not enough. Each capability is exposed separately and enforced by contracts and backend, never by hiding a button. Y allowed, P set by policy, — not allowed. Illustrative until the policy is final.
| State | Open | Increase | Reduce | Add margin | Deposit | Request withdrawal | Claim |
|---|---|---|---|---|---|---|---|
| Registered | — | — | — | — | P | — | P |
| Ready | — | — | — | — | P | P | P |
| Live | Y | Y | Y | Y | Y | Y | Y |
| Close only | — | — | Y | Y | P | P | Y |
| Paused | — | — | P | P | — | P | P |
| Settling | — | — | — | — | — | — | Y |
| Closed | — | — | — | — | — | — | Y |
Vaults and liquidity
Each market has a distinct vault and loss boundary. One market cannot draw collateral from another market’s vault. LP returns combine fee income, trader PnL and defined costs; LP principal can decline.
- Deposits show actual minted shares from the receipt.
- Withdrawals can be immediate or queued; reserved collateral and outstanding liabilities constrain them.
- Annualised measures always state their observation window. New markets show “insufficient history” instead of an extrapolation.
Launchpad embed
The MVP integration is an embeddable perps tab plus an SDK for market registration and status. The same market opened from the embed or the app shows consistent prices, fees, risk status and positions.
<OpenPerpsTab
chain="base"
token="0x7a3f…c91e"
theme={{ accent: "#0078BF" }}
onRegister={(m) => track("perp_registered", m.id)}
/>
// Shows: No market → Registered checklist → Live ticket → Restricted status
// Always renders "Powered by OpenPerps" and a route to full market detailsA spot launch can succeed while perp registration fails. Recovery retries only the failed step. Embed domains and permitted origins are explicit, and no signer keys belong in the partner console.
Lifecycle events
Consumers must tolerate duplicate events, chain reorganisations and delayed delivery. Contract events are the settlement source of truth. Working names:
- MarketRegistered
- MarketActivated
- MarketRestricted
- Deposit
- WithdrawalRequested
- PositionExecuted
- PositionLiquidated
- FeesClaimed
Fees
Trading fees are allocated across LPs, the protocol, the launchpad and an optional creator share. Percentages are not set yet, and the allocation always reconciles to the charged fee. Creators earn only their disclosed share.
Widths are placeholders, not proposed values.
Contracts and license
- Addresses
- Not deployed. Versioned addresses and ABIs will be published per chain.
- License
- Core interfaces and selected code under a reviewed open-source license. Hosted service boundaries will be documented.
- Security
- Independent review of access controls, pricing manipulation, funding, liquidation, bad debt and emergency settlement is a release gate. Reports and known limitations will be published here.