PrepX

PrepX Smart Contract Audit Report

Share
Share
EVMEVM
Perpetual DEX
EVMEVM
Perpetual DEX

QuillAudits audited the PrepX smart contracts on EVM between Jun 4, 2025 and Jul 15, 2025. The audit found 7 issues: 2 high, 2 medium, 2 low, 1 informational, of which 7 resolved and 0 acknowledged.

Project Description

Perpx is a perpetual futures trading protocol that allows users to trade leveraged positions on various tokens. The protocol centers around a Vault contract that manages liquidity pools, collateral, and position tracking, while the Perpetual contract provides the interface for opening/closing leveraged long/ short positions. Users can deposit collateral and create positions with leverage through an order book system, with the protocol supporting both token-to-token swaps via the Router and ETH handling through WETH integration. The system includes comprehensive risk management features like liquidation mechanisms, funding rates, and fee structures. The architecture resembles GMX-style perpetual DEXs where traders get leveraged exposure while liquidity providers supply capital to a shared vault that acts as the counterparty to all trades.

Timeline

S1
Jun 4, 2025
IA
Jun 27, 2025
S2
Jul 15, 2025

Scope of Audit

The scope of this Audit was to analyze the PerpX Smart Contracts for quality, security, and correctness.

Methodology: the QuillAudits smart contract audit process.

speedometer
0
50%
60%
70%
90%
100%
96.8%
AUDIT SCORE
icon

Critical

High

Medium

Low

Informational

open00000
acknowledged00000
partially resolved00000
resolved02221

High Severity Issues

Incorrect Interface will lead to contract being non-operational

Resolved
arrow-right
Description

There are two important interfaces uses by Perpetual.sol namely IOrderBook.sol and IExchangeRouter.sol 
Both of them are initialized in the constructor. The exchange router is responsible for calling createIncreasePosition in the gmx contract. 
However if we take a look at ExchangeRouter.sol implementation, there is no such function as createIncreasePosition 
The official implementation of this function is present in PositionRouter.sol . If we consider the possibility that IExchangeRouter will have address of position router, the name is highly misleading. 
Moreover, if we look at IOrderbook.sol , it has functions like createIncreasePosition , createIncreasePositionETH, createDecreasePosition and many more functions that are absent in OrderBook.sol 
That means we have two interfaces namely IOrderBook.sol and IExchangeRouter.sol and both of them have createIncreasePosition as an interface function. Provided that both orderbook and exchange router will have different addresses, subsequent call to createIncreasePosition will not be able to execute since there is not function present in the actual implementation.

Contract

Perpetual.sol

Recommendation

If the name is misleading, change the name otherwise change the implementation of interface.

Some critical functions won’t work in the contract

Resolved
arrow-right
Description

There are several critical functions that in the current state will permanently revert. 

Take a look at these functions:

1. getRequestQueueLengths
2. executeIncreasePosition
3. cancelIncreasePosition
4. executeDecreasePosition
5. cancelDecreasePosition
6. closePositionById


Notice how all of these function are being called on orderbook address. If we look at the actual implementation of IOrderBook.sol

https://github.com/gmx-io/gmx-contracts/blob/master/contracts/core/interfaces/IOrderBook.sol
These functions do not exist. Instead, these functions are present in PositionRouter.sol
getRequestQueueLengthsexecuteIncreasePosition
cancelIncreasePosition
executeDecreasePosition
cancelDecreasePosition
createDecreasePosition
Calling these functions on wrong contract will make them permanently. As a result, the contract will be useless since any user won’t be able to execute them.

Contract

Perpetual.sol

Recommendation

Ensure that the functions to be called are actually present in the external contract before. Also user given interfaces from GMX instead of creating your own.

Medium Severity Issues

Low Severity Issues

Informational Issues

Appendix

Disclaimer

PrepX

PrepX

High Severity Issues
Medium Severity Issues
Low Severity Issues
Informational Issues
Appendix
Disclaimer
View Report PDF

Get an Audit done today for your Smart Contract

Join 1500+ leaders who secured themselves from losing Billion Dollars

cta-banner
cta-banner-bgcta-banner-bg-mobile

Related audits

WE SECURE EVERYTHING YOU BUILD.

From day-zero risk mapping to exchange-ready audits, QuillAudits helps projects grow with confidence. Smart contracts, dApps, infrastructure, compliance: secured end to end.

QuillAudits Logo


ISO 27001Circle Alliance Program
Uniswap FoundationAethiropt-collectivePolygon SPNBNB Chain Kickstart

All Rights Reserved. © 2026. QuillAudits - LLC