Skip to content

Perp DEX Development for EVM Chains and DeFi Protocols

Protofire builds the code for a leveraged-trading venue that a chain or protocol team operates itself. We deliver the perpetual contracts, price adapters, liquidation and funding logic, indexer, front end and keeper code. We built Somnia's Chainlink-compatible oracle stack in 2025 and the Swarm Markets DEX core in 2021.

Luis Medeiros

Reviewed by Luis Medeiros, Field CTO at ProtofireLast reviewed: November 2026

On this page
  1. Overview
  2. Why it matters
  3. What you get
  4. Routes and licenses
  5. Why Protofire
  6. How it runs
  7. How work starts
  8. Not the right fit
  9. Related guides and services
  10. FAQ

Work shipped for 60+ networks and 95+ protocols, including

  • Chainlink
  • Ethereum
  • Solana
  • Safe
  • Ripple
  • Aave

Perpetual DEX development for a venue you operate

Protofire's perpetual DEX development covers the parts of a perp venue that decide who pays when someone moves a market's price. Those parts are the contracts, the price feed they mark against, the liquidation and funding logic, and the keeper code. You operate the venue.

For example, your venue lists a thin market, and someone moves its price with a small amount of capital. Can your team say who pays?

This page covers what you get, three routes to the contracts with the license each one rests on, and where Protofire's work stops.

Who owns each layer of a perpetual venue

Protofire builds the contracts, the price adapters and the keeper code. We also build the indexer and the front end. Your team sets the risk parameters and runs the venue.

Protofire builds

Perpetual contracts

Protofire writes the logic for positions, margin, funding and liquidation, or adapts it from a codebase whose license permits it.

Price adapters

The pipeline delivers signed prices from Pyth, Chainlink Data Streams or another pull oracle to the contracts.

Keeper code

Protofire delivers the bots that execute orders and liquidate positions as code in your repository.

Indexer and front end

The indexer and the front end show traders positions, markets and funding data.
Your team

Risk parameters and deployment

Your risk team sets the margin rates and position limits that Protofire prepares, and your engineers deploy each release with your key.

The venue

Your team operates the venue, holds authorization where it applies and launches the pool.

Price feeds, pool losses and the ESMA and CFTC statements

A perpetual venue marks positions to an index price, and its pool pays the winners.D8X's documentation says of its non-bluechip markets that "Often no oracle provider is providing price data". The same page says that "Manipulating those spot markets is relatively cheap" (D8X). When D8X's default fund cannot pay the traders, the perpetual is settled and "traders share the loss proportionally" (D8X).

Regulators now name the product. On 24 February 2026 ESMA said that derivatives "often marketed as perpetual futures or perpetual contracts" give leveraged exposure to underlying values, including crypto-assets. Such instruments "are likely to fall within the scope of" the temporary product intervention measures on CFDs. National measures now mirror the temporary ones. Instruments that meet the definition of a CFD are subject to measures including limits on the ratio of position size to margin. These measures also include a mandatory risk warning, a margin close-out and negative balance protection.

For the categorisation under MiFID II, ESMA's statement says the commercial name "is irrelevant". Whether the product is traded on a trading venue is also irrelevant. A funding rate mechanism and voluntary safeguards such as "insurance funds" are irrelevant as well (ESMA). The statement is addressed to firms and national authorities and does not mention DeFi protocols.

In the US, the CFTC adopted a policy statement on 29 May 2026, and the Federal Register published it on 3 June 2026. The statement says perpetual contracts "have become a dominant form of crypto derivative trading in global markets". With an order, the Commission permitted a designated contract market to list a perpetual contract as a futures contract. That perpetual contract references the spot price of bitcoin. Perpetual contracts on other asset classes "should be submitted for Commission review and approval pursuant to the voluntary product approval process under Commission Regulation 40.3". The statement "does not impose any obligation on any person" (CFTC, Federal Register).

A team that fixes its margin rules and market list before it reads the ESMA and CFTC statements may have to reopen those choices. Whether your venue needs authorization, and where, is for your counsel. Protofire's design step starts from the two statements instead.

What Protofire's perpetual DEX development delivers

A written design before engineers start coding

Protofire writes the markets, collateral, price sources and launch plan into one document. Your counsel reads that document before code exists.

Contracts under a license that permits your use

The code behind your venue comes with a license you can state. Protofire writes new perpetual contracts or starts from a published codebase whose license permits your use. A third route is a white-label front end on an existing venue's contracts, and that route gives you no contracts of your own.

Price adapters for each market you list

Each market needs an index price on your chain that the contracts can check. Protofire builds the price adapters and the pipeline for the assets you list. We build them with Pyth, Chainlink Data Streams or another pull oracle. Our oracle integration page covers the price layer as a service of its own.

Keeper and liquidation code in your repository

Protofire writes the bots that execute orders and liquidate positions. Your engineers get them as code in a repository you hold and deploy each release themselves. You keep your keys and your capital.

A trading front end and its indexer

Protofire builds the front end where traders see positions, markets and funding data. That data comes from an indexer we also build (subgraph development).

Testnet runs and mainnet launch preparation

Protofire runs the full user flows on a testnet and prepares the launch with your engineers. After launch, monitoring and oracle verification run under a written scope (managed onchain operations).

Three routes to the contracts and the license for each

The codebase a venue is built on decides what you may deploy.So the proposal from Protofire names the code and its license.

New contracts written for your venue

Protofire writes the perpetual contracts from your design. The contracts cover positions, margin, funding and liquidation. We prepare the risk parameters for your risk team.

A published codebase whose license file permits your use

GMX Synthetics is one such base, and its license file reads "Business Source License 1.1". The usage grant is defined at an ENS name. The change date is "the earlier of 31 August 2026 or a date specified at" a second ENS name. The change license is GNU General Public License v2.0 or later. The file says the license "is not an Open Source license" and that the change date "may vary for each version". The 31 August 2026 date has passed, so read the license of the version you copy (GMX license, read November 2026).

A white-label front end on an existing venue's contracts

D8X's docs describe a white-label route, and that route gives you no contracts of your own to deploy. Trades from your front end are routed to D8X. Your team pays into a D8X contract through "depositBrokerLots". Each order you broker includes your signature over the trader's address, a deadline and your fee (D8X). Protofire can build a front end for a venue that takes this route. The terms of the route are between you and D8X. The D8X organization on GitHub lists no repository of its perpetual contracts. D8X's trader front end comes with Quantena AG's Terms of Service, which take precedence over the MIT text. D8X's white-label app is marked "Proprietary".

Our record: Somnia's oracle stack, Swarm Markets and Solhint

A perpetual venue needs a price feed, an exchange core and Solidity code that is linted and audited.

A Chainlink-compatible oracle stack for Somnia

A perpetual venue marks its positions to a price feed of the kind Protofire built for Somnia. In 2025 we built Somnia's Chainlink-compatible oracle stack. The stack used five oracle nodes in OCR consensus behind three mainnet price feeds and VRF. We operated it until the engagement ended in late 2025 (Somnia case).

Protofire is a Chainlink core contributor and helps maintain Chainlink CCIP.

The Swarm Markets DEX core

A perpetual venue needs an exchange core and an indexer, the two pieces Protofire built for Swarm Markets. In 2021 we built the DEX core, a Balancer fork, and the subgraph for Swarm Markets, and contributed to dOTC. Swarm Markets was a BaFin-licensed DEX at launch where only KYC-verified wallets trade. Swarm held the license and ran KYC and permissioning (Swarm case).

Our work on Solhint, funded by the Ethereum Foundation

Solhint is the open-source Solidity linter Protofire created and maintains. It has been downloaded 25M+ times from npm. The Ethereum Foundation's Ecosystem Support Program funded our work on Solhint in Q4 2022, Q4 2023 and Q1 2025. The Q1 2025 allocation was for ongoing maintenance and support.

How a perpetual DEX build runs from design to launch

  1. Step 1

    A design based on the ESMA and CFTC statements

    Protofire starts from the ESMA statement of 24 February 2026 and the CFTC policy statement of 29 May 2026. We write the architecture, the market list, the price source for each market and the launch plan. We hand that document to your counsel and your risk team.
  2. Step 2

    Your choice of route and license

    You choose one of the three routes to the contracts. Protofire's proposal names the codebase and the license file it rests on.
  3. Step 3

    Contracts and risk parameters

    Protofire writes or adapts the contracts and prepares the margin rates and position limits. Your risk team sets the rates and limits, and your engineers deploy the contracts with your key.
  4. Step 4

    Oracle, keepers, indexer and front end

    Protofire builds the price adapters and the keeper and liquidation code. We also build the indexer and the trading front end.
  5. Step 5

    Testnet, outside audit and your mainnet launch

    Protofire runs user flows on a testnet. The code we wrote goes to an outside audit firm (smart contract audit). An audit does not guarantee the absence of bugs. The mainnet launch is yours.

How work with Protofire starts

You send your target markets, the collateral asset, your chain's price-feed coverage and a codebase you hold, if you have one.An engineer goes through them before the first call. The terms below apply to each phase, as set out on how we work.

Proposal
In writing, one business day after the discovery call: findings, a plan in phases and the first step we recommend.
Price
Fixed per phase when you commission it, against written acceptance criteria. Overruns inside them are ours to absorb, invoices follow delivered milestones, and you can stop at any phase boundary. Anything we operate after launch is priced in the proposal as its own recurring line, with the notice to end it.
Ownership
Code we write for you, contracts, the keys and credentials this work creates and the accounts your infrastructure runs in are yours by contract, within the license of any third-party software involved. Keys that a custody platform or a staking provider holds under its own key model stay with it under your contract; every other custody key stays with you or the custodian you appoint. Where the scope places something on servers we rent, it says what moves to you and when. An NDA is available from your first message, and we sign a data processing agreement (DPA) together with it.
After launch
Delivery closes with a hypercare window and a defect warranty, with their terms written into the proposal. A service we operate continues under its written scope until that scope ends.
Access
Read-only by default. A role that can start requests only if your written scope names one; never a signer, approver, administrator, key holder or recovery role on your contracts, wallets or custody platform. Services we build call each platform on credentials your staff issue and keep in your vault. Anything that approves or moves funds runs in your environment, and a scope under which we operate a service lists every write call it makes. Where the scope has us operate nodes, validators, monitors, explorers or indexers, it names the role and any key we hold on those servers, and in your own cloud account you can remove it.
Licenses
Protofire is an engineering firm and holds no financial or crypto-asset license; licensed activity stays with you and your providers.

How we work shows a worked proposal.

When a perpetual DEX build with Protofire does not fit

  • You want Protofire to operate the exchange or hold its keys. You operate the venue and hold the authorization it needs. Protofire holds no client funds or keys.
  • You need a licensed venue operator or legal structuring. Protofire holds no license and gives no legal opinion. Licensed venue operation and legal structuring are work for a licensed firm and your counsel. Our MiCA license routes guide maps the EU options.
  • You want a guaranteed volume or a market maker. Protofire promises no volume or fee level. The pool you launch has the depositors you attract.

FAQ

What is a perpetual DEX?
A perpetual DEX is a decentralized exchange for perpetual futures. Perpetual futures are leveraged long and short derivatives with no fixed expiration date. A periodic funding rate keeps their price near the spot price. Protofire builds the contracts, price adapters, liquidation and funding logic, indexer, front end and keeper code for a perpetual DEX on EVM chains. You operate the venue.
Who can build a perpetual DEX for an EVM chain?
A team that writes the pricing, funding and liquidation contracts, wires a pull oracle and delivers keeper code can build a perpetual DEX. Protofire builds those parts for a venue you operate on an EVM chain that has a price feed for the assets you list.
Do I need a license to run a perp DEX?
Your counsel answers that question, because it depends on the contract, the users and the place. In the EU, MiCA requires authorization for "operation of a trading platform for crypto-assets" (Articles 3(1)(16) and 59(1)). MiCA does not apply to crypto-assets that qualify as financial instruments (Article 2(4)(a)). MiFID II lists derivative contracts and financial contracts for differences among financial instruments (Article 4(1)(15), Annex I, Section C, points 4 and 9). ESMA's 24 February 2026 statement says the commercial name "perpetual futures" is irrelevant for the categorisation under MiFID II.
Can we start from GMX or D8X code?
GMX Synthetics is under Business Source License 1.1, which is not an open-source license. So the license file of the GMX version you copy decides what you may do with it. The D8X organization on GitHub lists no repository of its perpetual contracts. D8X's white-label route sends trades to D8X and gives you no contracts to deploy. Protofire's proposal names the codebase and its license.
How do oracles, funding and liquidation work on a perp venue?
A pull oracle delivers a signed price that the contract verifies in the same transaction that uses it (Pyth, Chainlink Data Streams). Funding keeps the perpetual near spot. On D8X "the side with higher demand pays a funding rate to the side with lower demand". On GMX the rate "changes over time based on the balance of longs and shorts". On D8X a position is partially or fully liquidated when its margin rate falls below the contract's maintenance margin. GMX executes orders in two steps, a request and then a keeper transaction that bundles signed prices (GMX). GMX's auto-deleveraging closes profitable positions when pending PnL exceeds a pool threshold (GMX).
Who runs the keepers and supplies liquidity after launch?
Your team runs the keepers after launch, and liquidity providers supply the liquidity. Your keeper, liquidator and order-executor bots run on your key and capital from the code in your repository. Liquidity providers deposit into the pool you launch. Protofire neither runs the keepers nor supplies liquidity.
Is a perpetual venue different from a spot DEX?
Yes. A spot DEX swaps tokens at the current price. A perpetual venue also prices leveraged positions and holds margin. A perpetual venue marks positions to an oracle and liquidates them. Protofire's DEX development page covers spot exchanges.

Get a proposal

Tell us what you are building. An engineer reads it, we have a short call, and the written proposal follows within one business day.

Luis MedeirosField CTO, reads every request · LinkedIn

A demo or repository link also works.