Bean Exchange

Bean Exchange Smart Contract Audit Report

Share
Share
MonadMonad
Perpetual DEX
MonadMonad
Perpetual DEX

QuillAudits audited the Bean Exchange smart contracts on Monad between Nov 24, 2025 and Dec 8, 2025. The audit found 10 issues: 1 high, 4 medium, 3 low, 2 informational, of which 10 resolved and 0 acknowledged.

kyc
KYC VerificationQuillAudits Verified
icon
kyc
Verified ContractsContract Verification Status
icon
kyc
Vigilant SquadQuillAudits Multilayered Audit
icon

Project Description

Bean Exchange is a prepetual dex and a fork of GMX that enables users to trade perpetual futures and spot cryptocurrencies with high leverage directly from their non-custodial wallets.

Timeline

S1
Nov 24, 2025
IA
Dec 3, 2025
S2
Dec 8, 2025

Scope of Audit

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

Methodology: the QuillAudits smart contract audit process.

icon
speedometer
0
50%
60%
70%
90%
100%
98.0%
QUILLAUDITS SCORE
Remediation Score100
Operational Resilience73
Governance & Centralization70
Tests, Coverage & Doc44

Critical

High

Medium

Low

Informational

open00000
acknowledged00000
partially resolved00000
resolved01432
Bean Exchange

Bean Exchange

High Severity Issues

Wrong Index Price Used in _getPerpValue Calculations

Resolved
arrow-right
Description

The _getPerpValue function mistakenly uses the token’s own price (price) as the indexPrice parameter when calling IPerpMarket.getVaultInfo. If a perpetual market’s index token differs from the long/short tokens, this mispricing occurs. In other words, it passes the long/short token price instead of the actual market index token price to the Perp market. This yields completely incorrect valuation of positions in that market.


if (marketState.asset0 == token && marketState.enabled) {
    uint256 indexPrice = price;  // BUG: using the asset’s own price as the index price
    uint256 longPrice = _getTokenPrice(marketState.asset0);
    uint256 shortPrice = _getTokenPrice(marketState.asset1);
    (, , , , uint256 longTokenAmount, ) = IPerpMarket(market).getVaultInfo(
        indexPrice,  // Wrong! Should be the index token’s price
        longPrice,
        shortPrice
    );
    totalUsd += _tokenToUsd(marketState.asset0, longTokenAmount, price);
}


Notice indexPrice is set to the passed-in price (the vault token’s price), not the price of the Perp market’s index token. This misaligns the getVaultInfo inputs.

Contract

PerpVault.sol

Recommendation

Look up the actual index token for each Perp market and use its price. For example:


Params.MarketInfo memory marketInfo = IPerpMarket(market).getMarketInfo();
uint256 indexPrice = _getTokenPrice(marketInfo.indexToken);  // Correct index price
uint256 longPrice  = _getTokenPrice(marketState.asset0);
uint256 shortPrice = _getTokenPrice(marketState.asset1);
(,,,, uint256 longTokenAmount, uint256 shortTokenAmount) =
    IPerpMarket(market).getVaultInfo(indexPrice, longPrice, shortPrice);
if (marketState.asset0 == token) {
    totalUsd += _tokenToUsd(marketState.asset0, longTokenAmount, price);
}
if (marketState.asset1 == token) {
    totalUsd += _tokenToUsd(marketState.asset1, shortTokenAmount, price);
}

Medium Severity Issues

Low Severity Issues

Informational Issues

Appendix

Disclaimer

Bean Exchange

Bean Exchange

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