fly.trade SVM

fly.trade SVM Smart Contract Audit Report

Share
Share
SolanaSolana
DeFiToken SwapDEX+1
SolanaSolana
DeFiToken Swap+2

QuillAudits audited the fly.trade SVM smart contracts on Solana between Oct 10, 2025 and Nov 10, 2025. The audit found 8 issues: 4 medium, 3 low, 1 informational, of which 2 resolved and 6 acknowledged.

Project Description

FlyTrade Protocol implements a decentralized cross-chain swapping and delegation framework. It defines core functionalities such as contract initialization, user whitelisting, and secure delegation of operations. The swap module manages token swaps across chains, while the registry handles asset and participant registrations.relayers coordinate and validate cross-chain transactions, ensuring reliable execution. Supporting modules like close enable controlled contract termination and settlement processes. Overall, the codebase establishes a modular, secure, and scalable foundation for multi-chain DeFi operations.

Note : Starting May 2025 Magpie has been rebranded as fly.trade. Same platform, new name - reflecting a refreshed identity and direction.

Timeline

S1
Oct 10, 2025
IA
Oct 23, 2025
S2
Nov 10, 2025

Scope of Audit

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

Methodology: the QuillAudits smart contract audit process.

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

Critical

High

Medium

Low

Informational

open00000
acknowledged00231
partially resolved00000
resolved00200
fly.trade SVM

fly.trade SVM

Medium Severity Issues

Swap fee can be manipulated by users

Acknowledged
arrow-right
Description

The protocol allows users to directly specify the swap_fee amount in the calldata they submit for swaps. The protocol doesn't enforce any minimum fee requirements, which means users can arbitrarily set very small fees or completely avoid fees by setting them to zero.


When examining the fee handling, we can see that the swap_fee is parsed directly from user input with no validation against a minimum value
Later, this fee is applied without any further validation
While gasless swaps have a check that requires fees to be non-zero, regular swaps can be executed with a swap_fee of 0, allowing users to completely bypass the protocol's fee.

Contract

programs/magpie-router/src/instructions

Recommendation

Create a global configuration account that defines the minimum swap fee required for different types of swaps and validate user supplied fees against these fees.

Users Can Bypass Swap Fees Using is_bridge_call Parameter

Resolved
arrow-right
Description

The swap function accepts a user-supplied boolean parameter called is_bridge_call which, when set to true, allows users to completely bypass swap fees. There is no validation to ensure that only legitimate bridge calls can use this parameter.
Looking at the swap function, When is_bridge_call is set to true, the function skips the call to transfer_swap_fees(), allowing users to bypass all fee payments. This parameter is directly exposed in the program's public interface.

Contract

programs/magpie-router/src/instructions

Recommendation

Remove the is_bridge_call parameter entirely if it's not needed & If bridge functionality is required, implement proper authorization to make sure the call is indeed a bridge call internally and not user facing, just like how we have implemented to decide if a transaction is gasless or not, in the same way we should implement to decide whether its a bridge call or not, rather than taking it from user as input

Users can drain the protocol vault by exploiting how token accounts are initialized, closed, and validated.

Resolved
arrow-right
Description

The attack flow is:
1. Include multiple token accounts in remaining accounts & swap data with owned_by_initiator = true
2. Have the vault pay to initialize these accounts
3. Use program's CPI to close them during execution
4. Collect rent refunds(inside cpi)
5. post cpi check is flawed and hence anyone can get away with it

Inside init_multiple_token_accounts we can see that vault pays for creation and initialization of token accounts of swap_data.token_acccounts

1. Vault pays for user-owned token accounts:

Once these accounts are initialized we validate these accounts inside `validate_swap_accounts` , in which the final if block is allowing the token accounts whose owner is not vault, if the authority is not vault we are not throwing error, if authority is some other wallet than vault, it lets it pass so basically we can pass random token accounts of ours for random tokens and let vault pay for its initialization and then those rent sol(paid by vault) can be farmed by utilizing cpi, we can cpi into token program, have this new formed account closed and the authority(from addresss, not vault) would receive the rent back, this way we could farm rent sol for so many accounts for so many tokens. we can do so because the post validation of accounts is as follow inside:

2. post validation is flawed inside validate_token_accounts_post_state we are doing so if we closed that newly formed token account, the authority would be none hence the execution won't throw an error, it only throws an error why authority is some and is not vault, but since we have closed our token accounts in cpi, the authority comes out as none and we dont get error back and have successfully farmed rent sol from those random accounts supplied in remaining accounts whose initialization is done via vault.

Contract

programs/magpie-router/src/instructions

Recommendation

Inside validate_token_accounts_post_statechange the check to this

Fee receivers can be manipulated by users to redirect protocol revenue

Acknowledged
arrow-right
Description

Users can provide their own addresses as fee receivers in swap transactions, redirecting protocol fees and slippage revenue to accounts they control. This happens because fee receiver information is parsed directly from user-provided calldata without validation.


When examining the SwapData parsing logic in swap.rs, we can see that swap_fee_receivers and slippage_receivers are directly extracted from user input

These values are later used in get_amounts_and_receivers to calculate fee distributions, a malicious user can simply pass his own accounts as receivers

Contract

programs/magpie-router/src/instructions

Recommendation

Create a global config, where we can store 2 arrays of authorized protocol fee receivers and slippage receivers, instead of taking and parsing those accounts from input.

Low Severity Issues

Informational Issues

Appendix

Disclaimer

fly.trade SVM

fly.trade SVM

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